Kun's Blog

File Table Design

OS161 Design Document

File Table Design

File table

File Table is an array with fixed length 64. Array index is the descriptor number and its value points to file handles.

File Handle Design

A sturct contains three fields.

  • Status Flag is the current ststus of the file. 0 - closed, 1 - open, 2 - read, 3 - write
  • Offset is the next byte that is ready to be read.
  • File Object is a pointer to vnode struct.

Process Table Design

Process structure Design

Synchronization

Syscall Design

Exception Handling