CS252 FINAL

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Dynamic Host Configuration Protocol (DHCP) (Lec 29 slide 18)

DHCP is a protocol that automates the assignment of: IP address Subnet mask Default route DNS server Example on slide 19

Domain Name System (DNS) (Lec 25 slide 13)

DNS is a distributed system that resolves host naems to IP addresses

Caching (Lec 29 slide 16)

DNS servers also cache (save) HTTP responses. It causes less strain on the server side when sending information

Process control block (PCB) (Lec 18 slide 21)

Data structure in the kernel that holds various information regarding an executing process

Lazy binding (Lec 5 slide 53)

Delaying the linking of a library until a call is actually made

tail (lec 2 slide 7)

Delivers n units from a file ex. tail -30 yes.txt (returns last 30 lines) tail -30c yes.txt (returns last 30 characters)

SYN flood (Lec 29 slide 35)

Denial of service (DNS) attack. Basically an attacker sends a bunch of SYN requests to a server, which overfloods it

Device drivers (lec 17 slide 20)

Device drivers register ISR's (Interrupt service routines) for various I/O devices

Process properties (Lec 14 slide 18)

Different properties for a process: - PID (process ID) - Command/program name - Arguments - Env. variables - Current working directory - User ID - File descriptors

Inode indirect VS direct pointers (Lec 9 slide 33)

Direct pointers- pointers directly to data blocks Indirect pointers- Pointers to direct pointers to data blocks Example on slide 34-35

Process memory layout: Heap (Lec 5 slide 21)

Dynamically allocated memory (malloc), grows upward as memory is requested

IP Addresses (Lec 25 slide 12) (Lec 26 slide 15)

Each host/system has atleast 1 IP address. An IP address is used to define a connection between a computer and a network Ex. 192.168.1.1

Preemptive process scheduling: Round robin (Lec 19 slide 20)

Each process gets a small unit of CPU time (called a quantum), and when that quantum expires, if the process isn't done, it moves to the end of the ready queue. Examples on slides 21-27

VM's (Virtual machines) (lec 31 slides 28-the end)

Emulation of a computer system, Provides functionality of a physical computer within another machine

Unix file system /lib (Lec 4 slide 43)

Essential libraries

Loader (Lec 5 slide 50)

Establishes mappings for memory when executing a program

Execution modes (Lec 17 slide 4)

Execution modes refer to what 'level' the CPU executes commands. Levels have parameters such as privilege level, valid instructions, etc.

Explicit memory allocation (Lec 7 slide 13)

Explicit memory allocation is when a user has to do the memory allocation (malloc() or free() )

File systems: Extended attributes (Lec 10 slide 30)

Extension to the normal attributes associated with every inode in a system

Statically linked libraries (Lec 5slide 47)

Fast, portable, no updates

Directories (Lec 10 slide 28)

Files that basically contain a (file name, inode number) mapping

Unix file system /var (Lec 4 slide 42)

Files that may change frequently (logs, emails, etc.)

Function calls VS System calls (Lec 11 slide 14-15)

Function calls are more commonly used in code, because those wrap system calls, and helps prevent context switches

Non-determinism (Lec 20 slide 16)

Gonna ask at office hours

HDD/SSD (lec 9 slides 9-11)

HDD: Hard drive disk, mechanical, moving heads, basically a giant disk SSD: Solid state drive, same storage size as a HDD, but no moving parts and it's 4-5 times faster Know the structure of a HDD: Slide 10

Automatic way of changing execution modes (Lec 17 slide 8)

Hardware interrupts and OS-Specified handlers

Process memory layout: Stack (Lec 5 slide 22-23)

Holds local, temp, or auto variables. Grows downward (decreasing addresses)

Networking: Routers (Lec 30 slide 29)

Household routers- usually have a couple of things in them: - Actual router itself - NAT - Firewall - DHCP Server - Caching DNS server

I/O Vs CPU bound (lec 18 slide 29)

I/O bound processes spend most of their time waiting (mouse, keyboard, etc.) CPU bound processes spend most of their time ready/running (compilers, renderers, etc.)

IPv4 vs IPv6 (Lec 25 slide 11)

IPv4: 32-bit number: 4 billion addresses; four sets of numbers marked off by periods IPv6: 128-bit addresses, able to handle up to 1 quadrillion addresses; almost unlimited # of addresses

Coalescing (Lec 6 slide 31)

If multiple free chunks are next to each other in the free list, coalescing makes them into one big free chunk Picture example on slide 32

Process memory layout: Data segement (Lec 5 slide 19)

Initialized global variables and static strings

Manual way of changing execution modes (Lec 17 slide 8)

Initiated by software, usually system calls, signals, and page faults

Synchronization (Lec 20 slide 7)

Instructions are guaranteed to execute in order within a single thread

What are interrupts, and how are they handled (Lec 17 slide 15-19)

Interrupts are signals sent to the processor saying that an event needs immediate attention An interrupt is handled by saving the current state of the PC, switching to kernel mode, does the task needed, and then switches back to user mode

What is an operating system (OS) (lec 4 slides 29-34)

It's code that manages resources, extends (abstracts) the machine, comsumes resources, and makes the computer simpler!

Sycnhronization in java (Lec 24 slides 28-the end)

Java uses the 'synchronized' keyword, no explicit calls to mutex's or other things static synchronized type method_name1() { ... }

Hard disk structure (Lec 9 slides 10 and 13)

Large one-dimensional arrays of logical blocks, and those blocks are mapped onto sectors

Hard links (Lec 10 slide 29)

Links to files only, directory entry + duplicate inode

Ls (Lec 1 slide 26)

Lists directory contents. Ie: ls ls -a

Whereis (lec 2 slide 4)

Locates the binary, source, and man pages for a given command Ex. whereis ls

TCP (Transmission Control Protocol) (Lec 29 slide 25)

Major transport protocol used on the internet. It's reliable since it uses acknowledgements and re-transmissions.

Synchronization (Lec 20 slide 17)

Making sure that programs are multi-thread safe, putting locks where needed to protect critical sections

Malloc() (Lec 6 slide 16)

Malloc() searches the free list for the appropriate size chunk that's requested. Uses sbrk() to extend the heap if needed

Server: listen() (Lec 25 slide 25)

Marks the socket as a passive socket int listen (int sockfd, int backlog) Backlog is the max. length for the pending connections queue

Block device storage (Lec 9 slide 8)

Mass storage, usually slow. Examples are SSD's, HDD's, and tapes

Proxies (Lec 31 slide 18)

Mediates communication between un-trusted hosts on behalf of the hosts that it protects.

Malloc (Lec 6 slides 6-8)

Memory allocation package to get memory from the heap. It encapsulates sbrk() Malloc works through a 'free list', only calling sbrk when more memory is needed

Explicit memory allocation errors (Lec 7 slide 14)

Memory leaks, premature frees, double free, wild free and memory corruption (smashing)

DMA Controller (MMU) (Lec 16 slide 35)

Memory management unit: Responsible for refreshing the DRAM, also translates virtual memory addresses to physical addresses

Web server: Thread pool (Lec 27 slide 10)

Method of making a server where threads are pre-created at a set number, and incoming requests are rotated between the threads Code on slide 10

Web server: fork() (Lec 27 slide 8)

Method of making a webserver where each incoming connection is a new process Code on slide 8

Web server: threads() (Lec 27 slide 9)

Method of making a webserver where each incoming connection is a new thread Code on slide 9

Symmetric multiprocessors (SMP's) (Lec 18 slide 30)

Modern machines are usually SMP's, two or more processors sharing a bank of memory

Computer systems: Parallel (Lec 31 slide 24)

More than one CPU in a computer, Ideally a task that takes T seconds will take T/N time (N = # of processes) Big overhead due to communication O(n^2)

Double free (Lec 7 slide 21)

Multiple calls to free() for the same object or address, which can corrupt the free list since the same location is added multiple times Example on slide 22

Preemptive process scheduling: Multilevel feedback queue (Lec 19 slide 28)

Multiple queues, processes can move between them. As a process gets older waiting in the queue, it moves up a level in a new, prioitized queue Example on slides 29-30

How to make accept() for a server fair on multiple platforms (Lec 27 slide 13)

Mutex locks/synchronization!

Mutexes (Lec 21 slide 30)

Mutexes are objects that protect critical sections, and can be locked/unlocked. Such objects make sure only one thread is using the critical section at a time

Network Address Translation (NAT) (Lec 30 slide 18)

NAT's remap one IP address space into another by modifying the IP address Example on slide 20

Version control: Distributive model (Lec 33 slide 7)

No authoritative repo for code, only "working copies", each local user downloads an entire copy of the codebase, and

Networking: DMZ (Demilitarized zone) (Lec 30 slide 33)

No clue, gonna ask at office hours

Special bash variable '$#' (Lec 2 slide 44)

Number of command line arguments

Premature frees (Lec 7 slide 18)

Object continues to be used after free() is called on it. Can affect the free list Example on slides 19-20

Signals (Lec 14 slide 29)

One form if Inter-process communication (IPC), signals are similar to interrupts, and signals are sent between process to communicate

Storage Area Network (SAN) (Lec 9 slide 16)

One or more storage arrays, connected to each other through fiber channel switches

Starvation (Lec 22 slide 11-12)

One or more threads are unable to gain access to a shared resource and unable to make progress

NAT: One to one and one to many (Lec 30 slide 19)

One to one: Basic NAT, only has IP addresses, headers, and checksum re-writing One to many: Port numbers are often changes, typically maps private hosts to one public IP address

SA_NOCLDSTOP flag (lec 14 slide 32)

Only deliver a SIGCHLD signal on termination, not stopping

Joels' test (Lec 31 slide 4)

Only need to know 3-5 of these: 1. Do you use source control? 2. Can you make a build in one step? 3. Do you make daily builds? 4. Do you have a bug database? 5. Do you fix bugs before writing new code? 6. Do you have an up-to-date schedule? 7. Do you have a spec? 8. Do programmers have quiet working conditions? 9. Do you use the best tools money can buy? 10. Do you have testers? 11. Do new candidates write code during their interview? 12. Do you do hallway usability testing?

File descriptors (Lec 13 slide 9-11)

Open files, pipes, sockets, etc. are referred to as an integer called a 'File Descriptor' or 'fd' This int value is kept in a table called the 'File Descriptor table' in the kernel Examples on slides 10-11

Unix file system /sys (Lec 4 slide 44)

Other hardware and kernel-related information

Unix file system /dev (lec 4 slide 42)

Peripherals and other devices

Normal TCP Exchange (Lec 29 slide 27)

Picture on slide 27 describes it way better Host 1 sends a packet, host 2 then recieves that packet and sends back an acknowledgement. There's a timer, so if host 1 doesn't recieve that acknowledgement in a set amount of time, then the packet is re-sent. Rinse and repeat

I/O Redirection- pipes (lec 2 slide 36)

Pipes help redirect output of commands into inputs for other commands Ex. ls -a | wc -l ls -a | grep "input.txt"

Parts of XP programming (Lec 32 slides 6-10)

Planning: User stories, etc. Coding: Have customer available, code one thing at a time Designing: Keep it simple, use CRC cards Testing: All code must have unit tests, integration tests also optional

IP Addresses: Prefixes and suffixes (Lec 26 slide 16)

Prefix- Identifies the network Suffix- Identifies the host Prefix:Suffix 192.168.1.1:5000

Shell: Lexical Analysis (Lec 12 slide 5)

Process of converting a sequence of characters into tokens. The lex file (.l) reads in a string, recoginizes a stream of characters through a regex, and takes an action Example on slide 6-9 and slide 13

Roles of a scrum team (lec 32 slides 15-18)

Product owner: Defines the features of the product, release date, etc. Accepts/rejects the work done Scrum Master: Middle-man between management and the dev team. Keeps the dev team on track while handling management Development team: Cross-functional members that do the development/testing for the product

Memory smashing (Lec 7 slide 27)

Program writes memory outside of the allocated range. Can corrupt the heap Example on slide 28

Processes (Lec 14 slide 16)

Programs may have multiple processes running. An executing program is a process

Bash: double quote ( " ) (Lec 4 slide 11)

Protects whitespace for a string, doesn't protect against special characters Examples on slide 12

TLS Handshake (Lec 28 slide 7)

Provides mutual authentication and choice of encryption method. Steps: 1) Client --> server: Hello 2) Server --> Client: Hello 3) Verify server ceritficate on client end 4) Client --> server, send keys 5) Client --> server, send client certificate 6) Verify client certificate (server side) 7) Client--> server: Finished 8) Server --> Client: Finished

Read command (Lec 3 slide 15)

Read van be used to obtain user data (sort of like stdin) echo -n "Feed me data: " read DataVar echo "You fed me ${DataVar}!" Examples on slides 16-17

File permissions (chmod) (lec 10 slide 22-24)

Read: Access the contents of a file (4) Write: Modify a file (2) Execute/search: Execute a file (1) You set the bit through chmod (that's what the #'s are)

Superblock (Lec 9 slide 30)

Record of the characteristics of a filesystem. Params include: Size Blocksize Empty/filled blocks Size and location of inode tables Block map and sizes Location of root Inode

RAID (Lec 9 slide 26)

Redundant array of independent disks. Raid is NOT a backup.

Direct memory access (DMA) (Lec 16 slide 34)

DMA allows other hardware subsystems to access main memory without going through the CPU. Modern systems usually have it

Subnet mask (Lec 26 slide 17)

Displays the number of bits used for network

TCP: Congestion control (Lec 29 slide 32)

Lost packets during transmissions are able to send a congestion signal, which tells TCP to slow down when sending requests

Partitions (Hard drive) (Lec 9 slide 19)

MBR- Master Boot record GPT- GUID Partition table

Mkdir (Lec 1 slide 27)

Makes directories mkdir bob mkdir yeet

Fragmentation (Lec 6 slide 12)

Memory that's too small to actually be allocated

Web server: Native iterative (Lec 27 slide 7)

Method of a webserver where one connection is accepted at a time, code on slide 7

Web server: Process pool (Lec 27 slide 11)

Method of creating a web server where a set number of process (fork() ) are created, and requests are dispersed among the threads

mv (Lec 1 slide 29)

Moves (renames) files mv dir1 dir2 mv bob mike

Networking: Firewall (Lec 30 slides 30-32)

Network security system that monitors and controls incoming/outgoing traffic. Firewalls can be implemented on a router or locally on a machine

Binary semaphores (Lec 20 slide 24)

Often called a mutex/lock, sets a bit for lock VS unlock Examples on side 25-26

Math in bash (Lec 3 slide 18)

Only has basic math operators (+ - * / %) Example: ( ( x = 11 + 3 ) ) Must be in ( ( ... ) ) Examples on slides 19-20

Mandatory access control (MAC) (Lec 10 slide 33)

Policy-based access control

Port forwarding (Lec 30 slide 27)

Port forwarding is used if you want to expose an internal host to the outside world. You're able to add a static entry to the NAT so "Any traffic received on port 5000 goes to this host"

Steps for building a program (Lec 5 slides 35-36)

Pre processor, Compiler, assembler and linker

Printf command (Lec 3 slide 3)

Printf can be used in bash too A=3.4 printf "%d\n" $A

Multithreading: producer/consumer problem (Lec 23 slide 15)

Producer: Creates instance of a resource Consumer: Uses (destroys) instance of a resource Buffers: Used to convey resources between the two Examples on slide 16-24

Regex (Regular expressions) (Lec 4 slide 20)

Regular expressions are used to express patterns. Usually used to find info from a string Examples on slides 20-28

rm (Lec 1 slide 30)

Remove files or directories rm -r dir1 rm -r yeet.txt

Server: accept() (lec 25 slide 26)

Removes first connection request from pending connections queue int accept (int sockfd, struct sockaddr *addr, socklen_t addrlen)

Why do we want to use threads (Lec 20 slide 5)

Responsiveness- Can continue executing if part of the process is blocked Resource sharing, threads can share resources and make process faster Economy- Cheaper than process creation Scalability- Can leverage multiprocessor architectures

Routing (Lec 26 slide 18)

Routing tables provide the next hop to reach the destination network, can be manual or automatic

SIGSEV/SIGCHLD (Lec 14 slide 30)

SIGSEV- Segmentation violation SIGCHLD- Child process has stopped, exited or changed

Tee command (Lec 2 slide 37)

Saves a copy of all input/output commands to a file Ex. ls -a | tee save_out.txt (saves a copy of the output of ls -a to save_out.txt)

Critical section (Lec 20 slide 10)

Section of code in which one thread can be executing it at a time

HTTPS (lec 28 slide 4)

Secure HTTP. Protocol is encrypted by TLS (Transport Layer Security)

NIX philosophy (Lec 1 slide 23)

"Do one thing and do it well"

Processes and mutual exclusion (Lec 20 slide 20)

- Always lock before manipulating shared memory - Always unlock after maniuplating shared memory - Don't mess with other people's locks

How to handle deadlock (Lec 22 slide 6)

1) Detect and recover 2) Dynamic avoidance (careful allocation) 3) Prevention 4) Do nothing, pretend it doesnt happen

4 conditions for deadlock (Lec 22 slide 5)

1) Mutual exclusion- resource only assigned to exactly 1 process 2) Hold and wait- Multiple independent requests 3) No preemption- Resource can only be released voluntarily by the holder 4) Circular chain of requests

Steps for connecting a client to a server (lec 25 slide 30)

1) create a socket() 2) (optional) bind() it 3) connect() to an address:port 4) close() the connection

Loadable modules (lec 28 slide 13)

Sort of like lazy binding, dynamically load a library and relevant symbols when needed

fork() system call (lec 13 slide 16)

Spawns a new process to be uitilized, returns 0 if child process Examples on slides 17-19

Sed (Lec 2 slide 28)

Stream editor command- performs basic text transformations, replacing characters, etc. See slides 29-31 for examples

Semaphores (Lec 20 slide 22)

Synchronization variable that takes on positive integer values, has two parts: P and V P: Atomic operation that waits for sema > 0, then decrements by 1- implementation on slide 29 V: Atomic operation increments sema by 1 - implementation on slide 30 Psuedocode on slide 23

synchronous vs. asynchronous (lec 17 slide 20 something)

Synchronous transmissions involve a clock (so timing), asynchronous tranmissions don't. Polling is considered to be synchronous, and interrupt handling is asynchronous

Unix file system /etc (Lec 4 slide 43)

System wide configuration files

Tramission Control Protocol (TCP) (Lec 25 slide 14)

TCP builds on IP to create a reliable connection (also known as TCP/IP) TCP supports acknowledgements between connections and re-transmissions, which increases reliability

Unix file system /tmp (Lec 4 slide 42)

Temporary files that do not survive a reboot

Internet architecture (Lec 26 slide 10)

The internet is a collection of networks and ports, interconnected by routers Good diagram on slide 10

Special bash variable '$0' (Lec 2 slide 44)

The name of the shell script

Building a program: Preprocessor (Lec 5 slide 37)

The pre-processor finds likes starting with #, and either hides them from the compiler or does something with them (#include, #define, #ifdef, #else, #endif) Examples on slides 41-42

Shell: Parsing (Lec 12 slide 20)

The process of analyzing symbols (tokens) conforming to the rules of a formal grammar Example on slide 20

Shell: Parser (lec 11 slide 21)

The process of reading a string and symbols and parsing them into individual parts

Mutual exclusion (Lec 20 slide 10)

The property that exactly one thread is doing a certain thing at one time

Computer: Time (lec 31 slide 22)

There's different times on a computer, the three are: User time: Time spent in usermode System time: Time spent in kernel mode Real time: Wall clock time User time + System time < real time (Slide 23)

Thread safety (Lec 21 slide 32)

Thread-safe code manipulates shared data structures properly, don't have to worry about locking/unlocking thread safe methods

Malloc: first-fit algorthm (Lec 6 slide 10)

Traverse the linked list from the head node, and allocating memory from the first avaliable block in the list

Malloc: best-fit algorithm (Lec 6 slide 10)

Traverse the linked list of free nodes from the head node, and find the free block that can best fit the amount of memory needed

Malloc: Worst-fit algorithm (Lec 6 slide 10)

Traverse the linked list starting from the beginning of the free list, finding the block that would be the worst fit (usually the biggest block) and allocating that

I/O Redirection- reading (Lec 2 slide 33)

Use the < command or << command mail [email protected] < input.txt

Backslash ( \ ) in bash (Lec 4 slide 16)

Used to remove any special meaning for a character. Also used to add meaning to regular symbols Ex. echo "Yeet!\n" echo "This is \$2.00"

grep bash command (Lec 4 slide 19)

Used to search files for lines of information Ex. cat output.txt | grep "I hate my life" Examples of slides 20-28

Unix file system /proc (Lec 4 slide 44)

Virtual file system that provides info about processes through files

Shell: Yacc (lex) (Lec 12 toward the end)

YACC parses tokens with certain values. It doesn't care about the input stream, that's why we have lex Examples on slides 24-29

Harvard computer architecture (lec 16 slide 27)

architecture that consists of a processor, various I/O devices, and two seperate memory banks, one for data and one for instruction. More flexible Picture on slide 27

POSIX semaphores (Lec 22 slide 18) (lec 23 slide 3)

sem_wait decrements a semaphore by 1 sem_post() increments a semaphore by 1 sem_init() initalizes a semaphote sem_t sem; is the semaphore object passed to the above methods

Bash command to get processes (Lec 4 slide 45)

top, ps

Unix file system /boot (lec 4 slide 41)

Files necessary for startup

Regfree() (lec 15 slide 28)

Free function for regex expressions void regfree (regex_t *preg)

Process memory layout (Lec 5 slide 15)

From high address to low address: Stack, heap, BSS, Data, text (DEMO ON SLIDE 26, KNOW IT)

BSD file system (Lec 9 slide 29)

From left to right (Pic on slide 29) Boot-sector, superblock, block bit-map, inode table, data

Regexec() (Lec 15 slide 27)

Function to do a comparsion between a regex and a string passed into it

Scrum: Burn-down chart (Lec 32 slide 35)

Graphical representation of work left to do VS time left in which to do it

Multithreading: Hoare VS Mesa (Lec 24 slide 26)

Hoare signaler: relinquishes control to the awakened process Mesa-style signaler: Keeps the CPU and locks it

Implicit memory allocation (Lec 7 slide 13)

Implicit memory allocation is when a language takes care of memory allocation (ie. garbage collection)

Man command (Lec 1 slide 24)

Interface to reference manuals Example: man cp (manual pages for the cp command)

ICMP (Lec 26 slide 24)

Internet control message protocol, used for error reporting when sending/recieivng packets

TCP three-way handshake (Lec 29 slide 33-34?)

1. It sends a message called a SYN to the target host. 2. The target host opens a connection for the request and sends back an acknowledgment message called an ACK (or SYN ACK). 3. The host that originated the request sends back another acknowledgment, saying that it has received the ACK message and that the session is ready to be used to transfer data.

Resource allocation graph (Lec 22 slide 3)

4 major parts: Circles: represent processes Squares: represent resources Assignment edge: A <-- R indicated that lock A holds resource R Request edge: B--> S indicates B is requesting S Example on slide 4, know it

Bounded buffer/Circular buffer (Lec 25 slide 4)

A buffer with a head and tail pointer, pulling from the head and pushing to the tail, making a ciruclar motion Example on slides 5-9

Malloc: Free list (lec 7 slide 6)

A double linked list of the free blocks in a chunk. Parameters are usually: void * next void * prev int size int left_size

Readers/writers problem (Lec 24 slide 4)

A multithreading problem that allows multiple reads at a time, but only a single write Writers can proceed only if there are no active readers or writers Readers can proceed only if no active writers Implementation on slides 5-15

Inode (Lec 9 slide 31-32)

A node that contains information about a file system and associated data. Most files are small Parameters include: File size User Id (uid) Group ID (gid) Mode (rwx, special flags) Timestamps (ctime, atime, mtime) Link count Pointers to data blocks

Program VS process (Lec 5 slide 14)

A program is an executable file that contains a set of instructions A process is a program in execution, it resides in memory

Clients/servers (lec 25 slide 15)

A server is a process that waits for a connection A client is a process that connects to a server

Concurrent server (Lec 20 slide 6)

A server that is able to handle multiple clients at a time through threads

Shells (Lec 2 slide 40)

A shell is a command interperter, it provides an interface betwee the user and computer (OS)

Shell (Lec 11 slide 18-20)

A shell is a program, It's a command interperter, it provides an interface between the user and the computer (OS)

Unix file /usr (lec 4 slide 41)

A users storage

XP programming (lec 32 slide 5)

AKA "Extreme programming", Early agile, encourages a more iterative approach (sprints) instead of a more traditional approach (waterfall)

Internet protocol suite (Lec 26 slide 9)

AKA TCP/IP specifies how data is packetized, addresses, tansmitted and routed for end-to-end communication

Kernel mode (Lec 17 slide 9)

AKA ring 0, can run any instruction, can modify any memory location, can access/modify registers and has full control of the computer

User mode (Lec 17 slide 10)

AKA ring 3, instructions are limited, only can access sections of memory, and privileged access must go through the OS

Process memory layout: Text (Lec 5 slide 17)

AKA the 'code segment', contains actual program instructions and any static libraries

Address Resolution protocol (ARP) (Lec 26 slide 23)

ARP is a communication protocol for discovering link layer addresses. ARP links your hardware address (MAC address as an example) to an IP address

TCP: Adaptive re-transmission (Lec 29 slide 30)

Adaptive re-transmission is the method to set the timer for when a packet should be resent if no acknowledgement is sent back. Timers differer depending on the enviroment.

Free() (Lec 6 slide 17)

Adds the chunk of memory back into the free list. Also coaslesces if needed

Memory leaks (Lec 7 slide 15)

Allocated and unused object aren't freed when they should be... can cause problems in the long run Examples on slides 16-17

Wildcards (lec 15 slide 23)

Allow us to perform actions on more than one file at a time. Also called globbing

Bash: Single forward quote ( ' ) (Lec 4 slide 8)

Allows you to ignore special characters in a string and protect whitespace Ex. Path='/b/cs252' path now is /b/cs252

Server: shutdown() (Lec 25 slide 29)

Allows you to only close one side of the socket, like if you're done sending stuff but you're still recieiving stuff int shutdown (int sockfd, int how)

Preemptive process scheduling: FCFS (First come first serve) (Lec 19 slide 19)

Also know as FIFO: Processes are executed in a linear order, first come first serve

Von Neumann computer architecture (Lec 16 slide 30)

Architecture that consists of a processor, various I/O devices and one big memory bank for both instructions and data. More flexible Picture on slide 30

Delegation (Lec 29 slide 14)

Authorative name servers can delegate authority for subdomains Example: Name server = www.purdue.edu Subdomain = cs.purdue.edu, ecn.purdue.edu Picture on slide 15

Basic computer booting process (Lec 17 slide 11)

CPU always starts in kernel mode, OS is bootstrapped, then switch to usermode, and then OS executes the first process to start booting

Wild free (Lec 7 slide 23)

Calling free() on something that was never malloc()'d Examples on slides 25-26

Certificates (Lec 28 slide 8)

Certificates are a way of authentication for HTTPS, it contains a public key and is signed by a certificate authority, to make sure they're legit

Network sockets (lec 25 slide 21)

Clients/servers communicate between sockets, which are endpoints for sending and recieving data. Ex. 192.168.1.1:1000 1000 is the socket for the IP address 192.168.1.1

Server: close() (Lec 25 slide 28)

Closes the socket fd. always check the value of close int close(int fd)

Computer systems: Clusters (lec 31 slide 25-26)

Collection of inexpensive computers connected through a fast network. Low cost of O(n) for communication, more robust, but communciation is slightly slower

Computer systems: Grids (lec 31 slide 27)

Collection of inexpensive computers connected through the internet. They all run the same application to complete a collective task

Head (lec 2 slide 6)

Collects the first n lines of a file ex. head -30 yes.txt head no.txt

Awk (lec 2 slide 23)

Command for pattern scanning and processing language Takes in a regex as an argument and a file to apply that regex too Refer to slides 24-27 for an example

Special bash variable '$*' (Lec 2 slide 44)

Command line arguments

Special bash variable '$1' to '$n' (Lec 2 slide 44)

Command line parameters (separated by whitespace)

Echo command (Lec 2 slide 45)

Command to print out it's arguments Ex. echo yeet echo $1 (can be used to print out bash variables) Examples on slide 46-47

Cgi-bin (Lec 28 slide 11)

Common gateway interface, mechanism for webservers to execute programs based on a URL/data and transmit the results

Preemptive process scheduling (Lec 18 slide 40)

Context switches can be forced (interrupts and whatnot), and invokes a queue to allow processes to be executed fairly

Non-preemptive process scheduling (Lec 18 slide 39)

Context switches only happen when the running process waits or yields, no room for interrupts or priority. Not used today

File systems (Lec 10 slide 15/18-19)

Controls how data is stored in a computer. Major parts of a file system are: Directories- List of other files Special files- Mechanisms for io, usually in /dev Links- Symbolic links and hard links (Domain) sockets- Inter-process networking Named pipes- similar to sockets Regular files

cp (Lec 1 slide 28)

Copy files and directories cp bob joe (makes a copy of bob into joe) cp -r dir1 dir2 (copies all the contents of directory 1 into directory 2)

Steps for getting a connection on the server side (Lec 25 slide 22)

Create a socket() Bind() that socket to an address and a port Listen() for a connection Accept() the connection Close() the connection Example on slides 32-the end

pipe() system call (Lec 13 slide 29)

Creates a unidirectional data channel int pipe (int pipefd[2], int flags) pipefd[0] is the read end and pipefd[1] is the write end Example on slide 30

Server: socket() (lec 25 slide 23)

Creates an endpoint for communication, returns a file descriptor int socket (int domain, int type, int protocol)

Shell: Executor (Lec 11 slide 22)

Creates processes for the table entires. Also juggles file descriptors to create pipes between inputs/outputs

Special bash variable '$$' (Lec 2 slide 44)

Current process ID number

Process memory layout: BSS (Lec 5 slide 20)

Block started by a symbol, holds uninitialized global variables

Execvp() system call (Lec 13 slide 20-21)

Replaces the current process image with a new process image. Successful exec's never return Example on slide 22

SA_RESTART flag (Lec 14 slide 32)

Resume the function after a signal is handled properly

Special bash variable '$?' (Lec 2 slide 44)

Return value from last executed command

Why do we use macros (Lec 5 slide 38)

Run time efficiency, and arguments can be any type Example on slide 38-40

Find (lec 2 slide 32)

Search for files in a directory and returns those files Ex. find cs252/lab6

Self-signed certificates (Lec 28 sldie 10)

Self-signed certificates are just like certificates (contain a public key) except they're self signed, so there's no certificate authority to prove they're valid

Setuid/Setgid bits (lec 10 slide 25)

Setuid: When executed, file runs as the user/owner Setgid: When executed, file runs as the group ID This is accomiplished through the sticky bits (Slide 26) Examples on slide 27)

which (Lec 2 slide 5)

Shows the full path to a command Ex. which ps which ls which sudo

Version control: Centralized model (Lec 33 slide 5)

Single authorative repository for the code, all code is checked in/out of this repo, and local changes aren't 'versioned' Picture on slide 6

Dynamically linked libraries (Lec 5 slide 48)

Slower, mote complex, easy to upgrade libraries, the loader has to re-link everytime the program is executed

Multiple IP addresses (Lec 29 slide 17)

Some hostnames have multiple IP's associated to them. This helps with load balancing for traffic (round robin queue)

SCRUM events (Lec 32 slide 19-28)

Sprint: A set period of time to code and work, a deliverable should be made by the end of it Sprint planning: Planning meeting before each sprint to plan the work that's gonna get done Daily scrum: Daily meeting that goes over what did you do yesterday, what are you doing today, and any roadblocks Sprint review: At the end of a sprint, there's a review meeting to show the deliverables made throughout the sprint Sprint retro: A reflection on the past sprint, going over what went well, what didn't go well, and what can be improved

Unix file system /sbin (Lec 4 slide 42)

System (supeuser) binaries. Utilities needed to start/maintain/recover the system

sbrk() system call (Lec 6 slides 3-5)

System call to allocate memory out of the heap. Sort of like malloc s = sbrk(n)

close() system call (Lec 13 slide 14)

System call used to close active file descriptors int close (int fd) Returns 0 on success, -1 on failure

open() system call (Lec 13 slide 13)

System call used to create a new file object based on the path passed to it int open (const char *pathname, int flags)

System calls (Lec 11 slide 11)

System calls are the interface between processes and the OS kernel Picture on slide 11

Dup() and Dup2() (lec 13 slide 8)

System calls to change file descriptors: int dup (int oldfd) (slide 28) Creates a copy of the file descriptor using the next avalaible fd int dup2 (int oldfd, int newfd) (Slide 25-27): Creates a copy of the file descriptor using the provided newfd

Context switch (Lec 18 slide 27-28)

The ability to switch between tasks in a processor without losing track of the tasks' progress. This happens when: - A process needs to wait on I/O - A process voluntarily yields - An interrupt occurs - The OS preempts the process

Soft (symbolic/symlink) links (Lec 10 slide 29)

The actual file itself (has an Inode)

Process states (Lec 18 slide 19-20)

The different states are: - New: Process is being created - Ready: Waiting to be assigned to a processor - Running: instructions are being executed - Waiting: Waiting on scheduling from an external device - terminated: process is done executing

Malloc: next-fit algorithm (lec 6 slide 10)

Traverse the linked list starting where the previous block was allocated, and find the next available free block to satisfy the request

Deadlock (Lec 22 slide 12)

Two or more threads are blocked forever

User Data Protocol (UDP) (Lec 29 slide 23-24)

UDP is an unreliable method of transfer through IP's. It's good for LAN (local area network) transports, and realtime communication.It's message orientated

Process ID (lec 14 slide 19)

Unique ID for a given running process. System call to get the process ID is getpid()

I/O Redirection- writing (Lec 2 slide 34)

Use the > command to redirect output Use the >> command to append output to a file Use the 2> command to append error to a file ls -a > test.txt pwd >> test.txt ls -l 2> test2.txt More examples on slide 35

Spinlocks (Lec 21 slide 29)

Used as a mechanism for implementing semaphores. Basically a process that's requesting to lock consistently 'spins' and keeps requesting until the lock is available

paste (lec 2 slide 12)

Used to combine lines from 2 files together

wc (lec 2 slide 14)

Used to count characters, lines, or words in a file. Ex: wc -c yes.txt wc -l no.txt wc -w ok.txt

$(Command) in bash (Lec 4 slide 15)

Used to issue a UNIX command and obtain it's output Ex. echo "Current directory is $(pwd)" returns "Current directory is /u/david22/cs252"

Bash: back quote ( ` ) (Lec 4 slide 14)

Used to issue a UNIX command and obtain it's output Ex. echo "Current directory is `pwd`" returns "Current directory is /u/david22/cs252

cut (lec 2 slide 9)

Used to make vertical cuts through a file

Sort (lec 2 slide 16)

Used to sort a file based on it's contents See lec 2 slides 17-22 for examples

Discretionary access control (DAC) (lec 10 slide 32)

User dictated control for file permissions

Unix file system /home (Lec 4 slide 43)

User home directories

Various user bash commands (Lec 4 slide 46-47)

Useradd- creates a new user Passwd- changes a user's password

Four components of a computer system (Lec 4 slide 31)

Users, system/application programs, OS (operating system) and hardware

wait() and waitpid() (lec 13 slide 23)

Waits for changes in a child's state. Good to check for zombies Example on slide 24

Fenceposts (Lec 6 slide 35)

When memory is allocated in a 'chunk', Fenceposts are at the beginning and end of a the chunk to ensure that malloc'd memory stays within the chunk Picture example on slide 35

Errno (Lec 13 slide 15)

When system call wrappers return -1 on failure, they set a global variable called errno, which gives more detail for an error

When does a system switch to kernel mode? (Lec 17 slide 14)

When there are: System calls, page faults, signals, and hardware interrupts

Race condition (Lec 20 slide 15) (lec 21 slide 36)

When two or more threads try to access/modify shared data at the same time, output is dependent on the sequence or timing of uncontrollable events

Transport Layer Security (TLS)

a cryptographic protocol that ensures data security and integrity over public networks, such as the Internet

For loops in bash (Lec 3 slide 10)

for ( (i = 0; i < 10; i++) ) do .... done Examples on slides 10-12

If/else loops in bash (Lec 3 slide 21)

if (command) then ... else ... fi Examples on slides 22-23, also has elif (else if) statements

Client: connect() (lec 25 slide 31)

int connect (int sockfd, const struct sockaddr *addr, socklen_t addrlen) Connects sockfd to address addr

Regcomp (Lec 15 slide 27)

int regcomp(regex_t reg, const char *regex, int flags) Compiles a regular expression that regexec() can use

_exit() system call (lec 14 slide 12)

void _exit(int status) - terminate the process immediately, doesn't reset fd's or anything

exit() system call (lec 14 slide 12)

void exit (int status) - Causes normal process termination. Resets stdio streams, etc.

While loops (Lec 3 slide 13)

while (whatever is true) do ... done Example on slide 14

Sudo (Lec 4 slide 48)

Allows you to run commands as admin sudo rm -r

What's the difference between a thread and a process? (Lec 18 slide 31)

A process is a set of instructions, and threads are what executes the instructions

Monitors (Lec 24 slide 18-27)

Another method of thread synchronization, it's a high level data abstraction that combines shared data, operations on the data, and all the sync info. Compilers must support monitors, mostly dead today

Atomic (Atomicity) (Lec 20 slide 21)

Appears to the entire system as occuring at once without interruption

Server: bind() (Lec 25 slide 24)

Assigning a name to a socket. bind() assigns an address to the socket bind (int socketid, const struct sockaddr *addr, socklen_t addrlen)


Ensembles d'études connexes

Curriculum & Instruction: Primary Reading Final Exam

View Set

Investments 4360 Chapter 1 review

View Set

The Iroquois Creation Myth: "The World on Turtle's Back"

View Set

Declaration of Independence facts

View Set

Excel Lesson 4- Using Basic Formulas

View Set