OS Walkthrough 04— File Management & I/O

PKU’s OS on Coursera: Week 09 ~ Week 11

Yu-Cheng (Morton) Kuo
2 min readFeb 1, 2023

The notes I took here were fewer since I was not quite fascinated by the contents over these 3 weeks.

This article is about FCB (file control block), abstraction, HDD vs. SSD, file system data structure, block cache, disk scheduling algorithm of HDD [FCFS (first come first serve), SSTF (shortest seek time first), SCAN, C-SCAN] , RAID, & I/O management diagram.

Last article:

Next article:

(1) Week 09: File Management-1

(2) Week 10: File Management-2

(1) Week 09: File Management-1

  1. File name — (mapping) — > disk space
  2. FCB (file control block): A file has its unique FCB, and a file directory entry is an FCB.
  • cf. PCB (process control block)

3. Abstraction

  • Files are abstractions of disks
  • Address spaces are abstractions of memory
  • Processes are abstractions of CPU

4. HDD vs. SSD / sector / disk head

5. File system data structure

  • Bitmap
  • Idle block list
  • Idle block linked list

6. Cache writing policies

  • Write-through: More costly but safer.
  • Write-back (or write-behind): Lazy-write. More efficient but less safe than write-through.
  • Transaction log

7. Read-ahead: Read more for data blocks, read less for code blocks

8. Direct memory access (DMA)

(2) Week 10: File Management-2

  1. Windows — FAT16 & FAT32
  2. Block cache
  3. HDD:
  • Seek time
  • Rotational latency
  1. Disk scheduling algorithm of HDD
  • FCFS (First Come First Serve)
  • SSTF (Shortest Seek Time First)
  • SCAN
  • C-SCAN / N-step-SCAN / FSCAN

4. RAID: “redundant array of independent disks” or “redundant array of inexpensive disks”

  • RAID 0: a stripe set or striped volume.
  • RAID 1: consists of an exact copy (or mirror) of a set of data on two or more disks
  • RAID 4: consists of block-level striping with a dedicated parity disk.

(3) Week 11: I/O

I/O management diagram & a typical PC bus structure [1] [2]

--

--

Yu-Cheng (Morton) Kuo

CS/DS blog with C/C++/Embedded Systems/Python. Embedded Software Engineer. Email: yc.kuo.28@gmail.com