Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Fiche Final CSE205 A IMPRIMER

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

LECT 1 - BASH Load/use hasard = use data before a Implicit free list: Header & footer with

$PWD (current dir), $$ current process id, previous stage has loaded it from memory size and allocation status (linear time)
$PPID parent process id, and solve req 1 cycle stall. Explicit free list: As implicit and free
Processes = a mem space + threads of Control/Branch hasard = should not jump blocks have a pointer to prev + next
execution + kernel (process dscript), ps -l but suppose that jump is taken, mispred, free block, Last in 1st out policy (root)
Ls -l, chmod “g+x” or “o-rw” or “u=rw, cancel it by adding bubbles. Segregated free list: free lists for di
g=r” user/group/other (rwx) (sans les “”) size classes, cut + sort free blocks
Redirecting < le.txt (redirect to stdin), > LECT 6 - X86-64 Malloc, calloc, realloc give pointers !
le.txt (create, truncates le ∃, then Stack grows down (toward lower Heap is cleared when program term
stdout), >> le.txt (create, appends if le addresses), allocated in frames, %rsp Top of heap brk pointer, increment
∃, then stdout), 1>&2 redirects stdout to stack pointer, %rbp frame pointer heap size with void *sbrk(int incr)
stderr le (duplicate le descrptr to other) - pushq src = decr %rsp by 8, move Max throughput + peak mem utilisat
Combining commands Cmd1 | cmd2 operand to (%rsp) (the address) (max(sum payloads alloc) / heap size)
(output = input next), ; then, && run cmd2 - popq dest = increment %rsp by 8, move
if cmd1 success, || if cmd1 not success operand from -8(%rsp) to dest LECT 9 - SYSTEMS I/O
echo “she’s $NAME” = she’s Lea. - movq (ne precisions), movz(ero)bq, 0 stdin, 1 stdout, 2 stderr, dev/sda, /
Pattern matching * any string, ** any le, movs(ign)bq, movabq (mov 64-bit to reg) sda2, /tty, /kmem, -=reg, d=dir, l=link,
**/ any subdir, ? Any solo character, [a-z] - leaq (save what is in address to register), c=term, b=disk, p=pipe, s=sock type
any these characters, —> alphabt sort - jo, jno (OF), js, jns (SF) Lseek() to change le o set, ags
Job control ctrl-z (kill -STOP) stop, ctrl-c - cmpl, cmpq (compare a-b), testq (a&b) with open() O_RDONLY/WRONLY/
Memory address / array allocation:
(ps) kill, jobs (list) fg (continue), bg(stop), RDWR/CREAT/TRUNC/APPEND
kill %#, in bckgrnd (sleep 2; echo “hi”) & D(Rb, Ri, S) = Mem[Reg[Rb] + S*Reg[Ri] + Unix I/O: systm call, async-signl-safe
D], array decl: T A[R] [C]; RIO: no short count, work w/ sockets
LECT 2 - BITS, BYTES Array ordered in order of declaration, Standard I/O: C std lib, uses bu ers,
Shifts <3 (left shift by 3) arithmetic right starting by the biggest is optimal array work with disk or les + 1 system call
shift > most signi cant bit, logical > 0 size = Row*Col*K(bytes of T el) to write ( ush() at “\n”). BUFFER to
Word Size Char(1), short(2), int/ oat(4), Aligned = address is multiple of K, or read more than 1 by 1 byte, ll up, ptr
pointer/double/long/quad(8), succes addr inserts gap to ensure alignment, Metadata (= le data, stat), sharing a
words di er by 4 (32 bits) or 8 (64bits) le = 2 descriptor tables point to
Negative bits LECT 7 - Exceptional Control Flow same le table + 1 arrow to v-node,
1=-, 0=+ 2’s complement neg value = CPU: kernel mode, user mode redirect dup2(oldfd, newfd),old in new
(logic complmt+ 1) mod 2^(wordsize) Operating System Kernel deals with FIFOs: system call, sending bytes
2 = 0010, -2 = (1101+1)mod (4) = 1110 exceptional situations. Exceptions: streams between unrelated process
Asynchronous (interrupts, events external Pipes: child-child, parent-child
LECT 3 - MEM & STATE MACHINE to the processor), synchronous: traps
Combinatorial circuit = input based on (intentional, system call then next), faults LECT 10 - Memory Hierarchy
output VS Sequential circuit = also use (recoverable, reexecute), aborts (unrecov) Locality: temporal (referenced again
memory (previous input, clock cycle) Context space = address + registers, so in the near future), spatial (nearby
Von Neumann model cntxt switch w/ CPU (user - kernel - user) address referenced close together)
The state machine (hardcoded control in Fork: concurrent prog, get_pid, get_ppid Misses: Cold = empty cache; con ict
combinatorial circuit) interprets the fork() == 0 => child, gives order of exec = multiple map to same; capacity
program stored in memory, the same wait(), waitpid() to reap, otherwise init LRU, LFU, random replacemnt policy
state machine can perform di tasks WIFEXITED, WEXITSTATUS etc. Put Cache size = S(set)xE(line)xB(block),
Stages Fetch (read inst from inst mem), execv() in child for di prog in a process S=1 full associat, E=1 direct mapped
Decode (read program reg), Execute argv[0] = lename in %rsi, envp[0] %rdx Tag, set index, addr in hex or binary !!
(compute val/address), Memory (read/ Background job done = kernel send signal Midde bit set idx. valid, tag, data
write data), Write Back (write program Signals have IDS (1-30), force the dest Write-back (write to mem from cache
reg), PC (update pc go next instr) process to react, can block recv only when evicted from cache) /
No signal queue, getpgroup, setpgid write-allocate (write + put in cache)
LECT 4 - PROCESSOR Y86-64 \bin\kill -9 -2817, “-“ = process group
0xBAFE at 0000, BA for big-endian (msb STAT (ps), sleeping, stopped, running LECT 12 - Linking
rst), FE for small-endian (lsb rst) Pnb = pending & ~blocked (==0 pass to p, .so: shared obj le, .a: archive static
Instructions mrmovq, rrmovq, rmmovq, else force p to recv all nonzero k signals libraries, .o: relocatable object les
irmovq, (addq, subq, andq, xorq they set and then pass to p process) Strong symbol: functions & initialised
condition codes, ags), pushq, popq Signal handler to change reaction to global Weak sym: uninit global var
nop, bubble, halt, ZF = if the result is 0 signal of a process signum + handler Symbol resolution -> symbol tables
OF = over ow (sign change (- + - = +)) async-signal-safe = uninterruptible by Linker Symbol Rules:
CF = carry ; SF = if the msb is 1 (sign is -) signals + reentrant (all stored locally) - No Multiple strong symbols
setjmp: ret 0, then longjump (only to env - Strong symbol > weak symbol
LECT 5 - PIPELINE (faster in prllel!) of called but not completed func) - Arbitrary one if multiple weak
Data dependency (dd) = next op dep on Shared lib = sol to static libraries
the result of previous op = RAW LECT 8 - Dynamic Memory Alloc DLLs: dynamic link libraries, .so les
Data hazard = dd cause wrong comp Internal fragmentation: block larger then Load-time dynamic linking: automatic
To avoid them: Stalling (nop (bubble) to payload, External frag: enough memory when loading Run-time dynamic
hold back), Forwarding (give new data but no good free block. 1st/next/best t, linking: during prog execv w/ dlopen()
back in earlier stage to be used), and Coalescing. Garbage collection: block that Ldd -> list shared lib need, where dyn
even reordering instructions! is never freed —> Mark-and-Sweep linker nds them + what load address
fi
fi
fi
fi
fi
fi
ff
ffl
fi
fl
fi
fi
fi
fi
fi
fl
fi
fi
fi
ff
ff
fi
fi
fl
ff
fi
fi
ff
fl
fi
fl
ff
fi
fi
fi
LECT 11 - Virtual Memory TLB to speed up (avoids calls to main
mem): small hardware cache in MMU
Multi-level page table: table maps to other table,
last table map to PPN
Sharing: 2 VMs can map to same Physical memory
When VM writes, create a new private copy
Unallocated, cached, uncached (VM but not PM)
Useful for: efficient use main mem, simplify mem
management, isolating address spaces (users can’t
access privileged kernel info), memory mapping

Page hit or page fault (then restart)


Working set size (wss) < main mem size
If sum(wss) > mms THRASHING (cst page swap, meldown, infinite)

Extend PTEs w/ permission bits (Superviser, Read, Write) + can have both sup and unsup ptr to PA ! Mem protection

TLB

X86-64 !!

2-way, 1024-
byt, 16 blocks,
4 offset, 5 indx,
tag 23, sets 32,
lines 64

You might also like