CSE221 - lec02: Historical Perspectives: TENEX & UNIX

date
Oct 10, 2024
slug
cse221-lec02
status
Published
tags
System
summary
type
Post

02 - Historical Perspectives: TENEX & UNIX

TENEX, a Paged Time Sharing System for the PDP-10

Terminology

explain some confusing terminologies.
  • different terms for same thing: monitor := kernel
  • same term for different things: virtual machine
    • OS-Syscall Interface (in TENEX)
    • Virtualizing Hardware (VMWare)
    • Language Runtime (JVM)

The Goals of the TENEX System

  • SOTA virtual machine
    • paged virtual memory
    • multi-process with IPC
    • file system
  • good human engineering
  • modular, maintainable
  • backward compatibility
  • efficiency

Virtual Memory

some terminologies related to modern terms:
  • Address Space (same as today)
  • Memory Maps / Table: Page Table
  • BBN Pager: TLB (page table cache)

Page Sharing

Three types of ptr in page table entry:
  • Direct: points to a private page of a process
  • Indirect: points to an entry of another process’s page table
  • shared: points to an entry of the system’s page table
Copy-On-Write Mechanism enables page sharing to avoid overhead for pages that are only read. When a write reference occurs, trap into OS and make a copy.

Backward Compatibility

TENEX’s approach to achieve backward compatibility:
  • Add a compatibility layer: implement all TENEX Syscall by the new instruction JSys, and implement legacy system call by TENEX’s new system call.

Summary & take-away

  • Virtual Memory - sharing & copy on write
  • time sharing system
  • support for backward compatibility

The UNIX Time Sharing System

The Goals of UNIX

  • Unifying abstraction
  • Easy to use
  • Easy to extend
  • maintainability
  • simplicity

File System

File Data Model
Before Unix:
  • impose structure on file
  • file size should be predeclared
Unix:
  • treat file as a sequence of uninterpreted bytes, no imposed structure.
  • allow variable-length file
 
File System API
Before Unix:
  • no buffer cache in kernel
  • different API for different access way (random, sequential …), a lot of work for programmers
Unix:
  • buffer cache in kernel, which means I/O operations are buffered
  • unified API for different access method, which simplifies things for programmers.
 
File Names & Directory
Before Unix:
  • one directory per user
  • directory represented different from regular file
Unix:
  • hierarchical namespaces
  • directory is represented the same way as regular files, but the content is interpreted by the file system.
  • files are independent of directory
 
Device
Before Unix:
  • use different sets of system call for different kinds of devices.
Unix:
  • device independent I/O for most cases (wrap device as file)
  • special syscall for device-specific functionality: ioctl
 
Protection Model
Before Unix:
  • list of users (multics does this)
Unix:
  • six bits, rwx, for owner and everyone else
  • much like today, except today we have more bits

Process

Before Unix:
  • one process per user
Unix:
  • user can fork() & exec() syscall to create child process
  • slightly different api from today’s fork()
 

Shell

Before Unix:
  • built into the kernel
Unix:
  • as a user program, so can be customized.
  • featured with I/O redirection
 

Summary & take-away

  • nice unifying abstraction
  • careful decomposition(which should be put into kernel, which should be implemented in user space)

© Lifan Sun 2023 - 2024