Professional Documents
Culture Documents
The Process
Chapter 4
Fakhar Lodhi
Some History
Batch Processing - Just Libraries
• One program ran at a time, controlled by a human operator
• Job queue
• OS didn’t do too much.
• Just a set of libraries of commonly-used functions;
• e.g. low-level I/O handling code, the “OS” would provide such APIs, and thus make
life easier for the developer.
• No interaction – batch processing
Some History
System Calls and Protection
• Realization that OS was different from user program
• control of devices and thus should be treated differently than normal application
code
• User-mode vs supervisor-mode
• System call
• OS as a separate program
• add a special pair of hardware instructions and hardware state to make the
transition into the OS a more formal, controlled process
• raising the hardware privilege level
Some History
Multiprogramming
• Desire to make better use of machine resources
• OS would load a number of jobs into memory and switch rapidly between
them, thus improving CPU utilization
• Slow I/O devices
• program has to wait on the CPU while its I/O was being serviced
• was a waste of CPU time
• Why not switch to another job and run it for a while
• Issues of memory protection and concurrency
The Process – a running program
• A typical system may be seemingly running tens or even hundreds of
processes at the same time
Time sharing!
Machine State
• Memory - Address Space
• the memory that the process can address is part of the process
• where the instruction and data belonging to the process resides
• Registers
• General purpose registers – data that is being processed
• Program Counter (PC)
• Stack Pointer
• Persistence I/O – list of open files
Blocked