• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • ←→ pour naviguer
  • esc pour rejeter
⌘ '
raccourcis clavier

The Problem

Applications need to perform I/O (read files, write data, print) but shouldn’t talk directly to hardware — that would require every program to know every device’s details.

Core Idea

The topmost layer of I/O software that provides system calls and library functions (read(), write(), fopen()) for applications to request I/O operations.

How It Works

  1. Application calls I/O functions (fopen("file.txt", "r"))
  2. These functions invoke system calls that switch to kernel mode
  3. Library handles formatting (printf/scanf), buffering in user space
  4. Spooling for devices like printers is managed at this layer
  5. Request is passed down to device-independent I/O software
user_io App Application C program, text editor Lib User-Level I/O fopen, printf, scanf App->Lib library calls Syscall System Call Interface read(), write(), open() Lib->Syscall system call Kernel Kernel Space (lower layers) Syscall->Kernel enter kernel mode

Key Properties

  • Runs in user space (unprivileged mode)
  • Provides familiar APIs (stdio.h in C)
  • Handles user-space buffering and formatting
  • Spooling for shared devices (printers) happens here

Connections

Edge Cases & Gotchas

  • User-space buffering can delay writes (must flush explicitly)
  • System call overhead for each I/O operation (mitigated by buffering)
  • Library functions may mask errors — always check return values