File System

박영재·2024년 9월 25일

File system: abstracts the secondary memory into a logical view

File vs. Memory

File

  1. External device
  2. Stream (conceptually no limit on size)
  3. ex) fwrite

Memory

  1. Virtual memory space
  2. Predefined size
  3. ex) malloc

HDD’s virtual structure

General specification

  • A sector size is 512 bytes
  • A cluster contains four sectors (2KB)
  • A block size is 4KB

Secondary memory as linked list

  • Insensitive to size
  • Discontinuous structure
  • Open-ended

File as an interface of an external device

Untitled

Input and Output

Buffered/Non-Buffered

  • A file involves input buffer and output buffer
  • Buffered I/O :
    • Efficient: Smaller number of accesses to a device
    • Delayed response: Buffering needs data to wait in buffer
  • Non-buffered I/O:
    • Inefficient: Greater number of accesses to device
    • Immediate response: I/O data transfers right away
  • Flush: transfer Buffered data immediately
    • usually apply to output buffer

Synchronous/Asynchronous

A process sends a request to OS by a system call

  • Synchronous: process waits until the request is finished
  • Asynchronous: process doesn’t wait for the end of the request
profile
People live above layers of abstraction beneath which engineers reside

0개의 댓글