diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 16ca4c4..dcc17b2 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -13,12 +13,12 @@ "state": { "type": "markdown", "state": { - "file": "Operating Systems/Input Output.md", + "file": "Operating Systems/Mass Storage.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "Input Output" + "title": "Mass Storage" } } ] @@ -200,27 +200,28 @@ }, "active": "f9fe04cad473d20c", "lastOpenFiles": [ - "Pasted image 20250505195901.png", + "Pasted image 20250505203114.png", + "Pasted image 20250505202532.png", + "Pasted image 20250505201950.png", + "Pasted image 20250505201859.png", + "Operating Systems/Input Output.md", + "Operating Systems/Mass Storage.md", + "Operating Systems/Inter-Process Communication.md", + "Operating Systems/File Systems Management.md", + "README.md", + "Untitled.md", + "Operating Systems/assets/Pasted image 20250505195901.png", + "Operating Systems/assets/Pasted image 20250505201102.png", + "Operating Systems/assets/Pasted image 20250505200548.png", + "Operating Systems/assets/Pasted image 20250505200028.png", "Operating Systems/assets/Pasted image 20250505194426.png", "Operating Systems/assets/Pasted image 20250505193602.png", "Operating Systems/assets/Pasted image 20250505192629.png", - "Operating Systems/File Systems Management.md", - "Operating Systems/Input Output.md", - "Operating Systems/assets/Pasted image 20250505163335.png", - "Operating Systems/Inter-Process Communication.md", "Operating Systems/Processes and Threads.md", "Operating Systems/Scheduling.md", "Operating Systems/Overview.md", - "Operating Systems/assets/Pasted image 20250505162331.png", - "Operating Systems/assets/Pasted image 20250505161542.png", - "Operating Systems/assets/Pasted image 20250505161031.png", "Operating Systems/Memory Management.md", "Operating Systems/Virtual Memory.md", - "Operating Systems/assets/Pasted image 20250505155546.png", - "Operating Systems/assets/Pasted image 20250505160518.png", - "Untitled.md", - "Operating Systems/assets/Pasted image 20250505154746.png", - "README.md", "Untitled.canvas", "Discrete Structures/Midterm/attempt 2.md", "Discrete Structures/Mathematical Data Structures.md", @@ -237,7 +238,6 @@ "Software Engineering/Reqirements.md", "Introduction to Machine Learning/Introductory lecture.md", "Languages & Machines/Introduction.md", - "Functional Programming/Proofs.md", "Languages & Machines/assets", "Languages & Machines", "Extracurricular/Misc/Proposed Routine Plan.canvas", diff --git a/Operating Systems/Input Output.md b/Operating Systems/Input Output.md index b78b9ae..9bc5751 100644 --- a/Operating Systems/Input Output.md +++ b/Operating Systems/Input Output.md @@ -86,3 +86,40 @@ An alternative mode is to have the device controller send the word to DMA contro ![](Pasted%20image%2020250505195901.png) + +![](Pasted%20image%2020250505200028.png) + + +### Handling interrupts +- Microprogram or hardware checked to see if there was an interrupt pending. +- Instruction cycle: + - Fethc + - Decode + - Read operands + - Execute + - Store + - Check for interrupts + +This can be pipelined + +### Precise interrupts +1. PC is saved in a known place +2. All instructions before the one pointed to by the PC have completed +3. No instruction beyond the current one has vfinished +4. Execution state is known + +An interrupt that doesn't meet the above requirements is called **imprecise** + +![](Pasted%20image%2020250505200548.png) + +## Clocks +![](Pasted%20image%2020250505201102.png) + +> [!IMPORTANT] +> Watchdog timers **ARE clocks** + + + +## Mass Storage +Secondary storage for modern computers and shit. + diff --git a/Operating Systems/Mass Storage.md b/Operating Systems/Mass Storage.md new file mode 100644 index 0000000..be852d4 --- /dev/null +++ b/Operating Systems/Mass Storage.md @@ -0,0 +1,38 @@ + +## Hard disks (HDDs) +Spin platters of magnetically-coated material under moving RW heads +- Rotate at 60 to 250 times/s +- Transfer rate is rate at which data flows between drive and pc +- Positioning time (Random access time) to move disk arm to desired cylinder (seek time) and time for desired sector to rotate under the disk head (rotational latency) + +![](Pasted%20image%2020250505201859.png) + + +### Controller +Receives data/ command from the OS, controls I/O operation and sends back results to OS +![](Pasted%20image%2020250505201950.png) + + +### I/O steps +- Move head to track -> Seek Time (S) +- Find sector -> Rotational Latency Time (r) +- Transfer data to/from controller -> Block Transfer Time (btt) +- Error checking and report to OS + + +### Disk Formatting +Each platter must receive a low-level format done by software, i.e. marking the cylinders and tracks, each containing a few sectors, with short gaps in between + +Each sector includes: +- Preamble: starts with start of the sector bit pattern, the cylinder and sector numbers +- Data: size of the data portion is determined by the formatting program -> 512 bytes usually +- ECC: error correction, typically 16 bytes + + +Numbering the sectors +- Position of sector 0 on each track is offset from the previous track when the low-level format is laid down (cylinder skew) + + +![](Pasted%20image%2020250505202532.png) + +![](Pasted%20image%2020250505203114.png) \ No newline at end of file diff --git a/Pasted image 20250505195901.png b/Operating Systems/assets/Pasted image 20250505195901.png similarity index 100% rename from Pasted image 20250505195901.png rename to Operating Systems/assets/Pasted image 20250505195901.png diff --git a/Operating Systems/assets/Pasted image 20250505200028.png b/Operating Systems/assets/Pasted image 20250505200028.png new file mode 100644 index 0000000..f867e84 Binary files /dev/null and b/Operating Systems/assets/Pasted image 20250505200028.png differ diff --git a/Operating Systems/assets/Pasted image 20250505200548.png b/Operating Systems/assets/Pasted image 20250505200548.png new file mode 100644 index 0000000..512195d Binary files /dev/null and b/Operating Systems/assets/Pasted image 20250505200548.png differ diff --git a/Operating Systems/assets/Pasted image 20250505201102.png b/Operating Systems/assets/Pasted image 20250505201102.png new file mode 100644 index 0000000..ed1d413 Binary files /dev/null and b/Operating Systems/assets/Pasted image 20250505201102.png differ diff --git a/Pasted image 20250505201859.png b/Pasted image 20250505201859.png new file mode 100644 index 0000000..3be3dc6 Binary files /dev/null and b/Pasted image 20250505201859.png differ diff --git a/Pasted image 20250505201950.png b/Pasted image 20250505201950.png new file mode 100644 index 0000000..7098d25 Binary files /dev/null and b/Pasted image 20250505201950.png differ diff --git a/Pasted image 20250505202532.png b/Pasted image 20250505202532.png new file mode 100644 index 0000000..297c8ff Binary files /dev/null and b/Pasted image 20250505202532.png differ diff --git a/Pasted image 20250505203114.png b/Pasted image 20250505203114.png new file mode 100644 index 0000000..c12a7e2 Binary files /dev/null and b/Pasted image 20250505203114.png differ