The UNIX Time-Sharing System
Notes
Overview
- Unix is a moving target
- Strengths: Good designs can adapt to changes over time.
- Achievement: demonstrate that a powerful operating system for interactive use need not be expensive either in equipment or in human effort.
Cross-Examination
Everything as file
What is one way in which Unix differs from Tenex, Multics?
- Doesn’t depend on hardware
The File System
Files
- File are simple abstractions of a linear sequence of bytes
Three kinds of files:
- ordinary disk files
- the structure of files is controlled by the programs which use them, not by the system.
- directories
- provide the mapping between the names of files and the files themselves
- Linking: The same non-directory file may appear in several directories under possibly different names.
- Link: a directory entry for a file is sometimes called a link.
- Thus a file exists independently of any directory entry, although in practice a file is made to disappear along with the last link to it.
- special files
- Each I/O device supported by UNIX is associated with at least one such file.
- Advantage
- File and device I/O are as similar as possible
- File and device names have the same syntax and meaning, so that a program expecting a file name as a parameter can be passed a device name
- Special files are subject to the same protection mechanism as regular files.
- ordinary disk files
How does file abstraction differ from Multics?
- file processing doesn’t go through memory device
- Unix use “mount” to get access to device, while Tenex use device symbol (MSDOS, e.g., C:)
- Files exist independently of directories
- “links” in paper are hard links, but nowadays it refers more to soft link.
- System does buffering
In computing, a hard link is a directory entry that associates a name with a file on a file system. All directory-based file systems must have (at least) one hard link giving the original name for each file the creation of hard links to directories is sometimes forbidden to avoid creating loops within the structure of the directories
Removable File Systems
Protection
- Each user of the system is assigned a unique user identification number.
- Protection appiled to files. Each file has a set of seven protection bits.
- Six of these specify independently read, write, and execute permission for the owner of the file and for all other users.
- If the seventh bit is on, the system will temporarily change the user identification of the current user to that of the creator of the file whenever the file is executed as a program.
I/O Calls
- open, create, read, write, seek ...
Processes and Images
- image: computer execution environment.
- Process: execution of an image
- a new process can come into existence only by use of the fork system call
- The two processes have independent copies of the original core image, and share any open files.
- Because the return points in the parent and child process are not the same, each image existing after a fork may determine whether it is the parent or child process
- a new process can come into existence only by use of the fork system call
- pipe(): An interprocess channel, like other open files, is passed from parent to child process in the image by the fork call
- wait(): causes its caller to suspend execution until one of its children has completed execution.
- Optimization to implementation of fork -> copy on write
Protection & Permissions
- Each user of the system is assigned a unique user identification number. (When a file is created, it is marked with the user ID of its owner)
each file has a set of seven protection bits
- Six of these specify independently read, write, and execute permission for the owner of the file and for all other users.
- seventh bit (set-user-id) is on-> the system will temporarily change the user identification of the current user to that of the creator of the file whenever the file is executed as a program.
lack of group permissions
Questions
What aspects of Unix as described in the 1974 paper do not survive today, or have been considerably changed?
- File protection (used to be 7 bits, now it’s 9 bits?)
- No mention paging (paging in, paging out)
- No network
- No Threads