diff --git a/jiangruohong_notes/W12D2/W12D2.md b/jiangruohong_notes/W12D2/W12D2.md new file mode 100644 index 0000000..dc2da0b --- /dev/null +++ b/jiangruohong_notes/W12D2/W12D2.md @@ -0,0 +1,26 @@ +### Distributed Shared Memory + +#### DHT/Chord + +Files are stored on distributed systems. + +$Hash(IP)$ is node's id. + +Suppose $suc_i$ is the next available node from $i$. + +Finger Table: maintain $suc_{u+2^i}$ for every node $u$. Time complexity lowered to $O(\log n)$. + +File is hashed to a number $x$, and is stored in several successors after $x$. Any machine can quickly get $suc_x$ and ask the machine for the file. + +Some machines may go offline. Every machine's finger table is self-maintained. + +When a machine enter the system, notify other machines to update finger table. + +#### Distributed Systems +Chip: SoC (System on Chip) + +Board: SMP (Symmetric Pultiprocessing) + +LAN: Cluster + +Internet: Grid $\to$ Cloud \ No newline at end of file diff --git a/jiangruohong_notes/W4D2/W4D2.md b/jiangruohong_notes/W4D2/W4D2.md new file mode 100644 index 0000000..172970e --- /dev/null +++ b/jiangruohong_notes/W4D2/W4D2.md @@ -0,0 +1,36 @@ +### Memory Management + +Reallocation, Swapping, Overlay, Replacement + +#### Swapping +Memory <- exchange processes -> disk storage + +#### Virtual Memory & Paging + +Consider a part of disk as extension of memory + +#### Page replacement algorithms + +Optimal algorithm is based on the future + +- NRU (not recently used) algorithm + +Referenced bit and Modified bit + +- FIFO algorithm +- Second-chance algorithm +- Clock algorithm +- LRU (least recently used) algorithm +- Working set algorithm + +#### Physical Memory Management +Buddy System (UNIX) + +Maintain lists of blocks of $2^i$ size. + +Breaks large blocks into 2 smaller blocks when allocating. + +Merge requirements: +- same size +- next to each other +- after merging into a $2^{i+1}$ size block, the beginning of block should be a multple of $2^{i+1}$ \ No newline at end of file diff --git a/jiangruohong_notes/W8D2/W8D2.md b/jiangruohong_notes/W8D2/W8D2.md new file mode 100644 index 0000000..41de714 --- /dev/null +++ b/jiangruohong_notes/W8D2/W8D2.md @@ -0,0 +1,17 @@ +### Security + +#### Buffer Overflow Attacks + +The attack is able to bypass the canary and modify the return address directly. + +![](p1.png) + +#### Code Reuse Attacks + +![](p2.png) + +#### Format String Attacks + +If not enough args provided, compiler will reserve space for these args. These can be used to either leak information or modify registers. + +![](p3.png) \ No newline at end of file diff --git a/jiangruohong_notes/W8D2/p1.png b/jiangruohong_notes/W8D2/p1.png new file mode 100644 index 0000000..1bc2c50 Binary files /dev/null and b/jiangruohong_notes/W8D2/p1.png differ diff --git a/jiangruohong_notes/W8D2/p2.png b/jiangruohong_notes/W8D2/p2.png new file mode 100644 index 0000000..b21e16b Binary files /dev/null and b/jiangruohong_notes/W8D2/p2.png differ diff --git a/jiangruohong_notes/W8D2/p3.png b/jiangruohong_notes/W8D2/p3.png new file mode 100644 index 0000000..029b1b3 Binary files /dev/null and b/jiangruohong_notes/W8D2/p3.png differ