CSCE 313 Lecture 2
« previous | Thursday, January 19, 2012 | next »
Multiprogramming
Handling multiple jobs at the "same time" while waiting for other resources (like I/O) Automatically handled by OS
Requires scheduling (which program is executed at what time?) and memory management (program should have access to only its own slice of memory)
Time Sharing
OS interleaves execution of multiple programs with time quantum (200 msec)
Same issues still exist today:
- Resource management and fault tolerance in parallel systems
- Real-time systems have to make decision quickly and without error (mission-critical systems)
- Communication and resource sharing in distributed/networked systems
- System security
Issues will remain relevant in the future, and new issues might arise.
Operating Systems
Coordinates use of system resources
- convenient environment for user to access CPU, memory, I/O, etc. in abstract virtual environment
- efficient operation of computer system
- Resource Management
- transform real hardware into easy-to-use virtual substitutes
- multiplex: illusion of multiple resources from single resource
- scheduling: who gets what resources when?
Serves at the hardware level and the user
Architecture of Modern Computers
All components of a computer "compete" for memory space and usage
Drivers allow devices to communicate with each other through OS:
- I/O and CPU execute concurrently
- Each device controller is responsible for a particular device type
- Each controller has a buffer
- CPU moves data between memory and buffer
- I/O is data from device to local buffer (it is possible to overflow a buffer, in which case data will be lost)
- Direct Memory Access (DMA) allows devices to write buffers directly to memory to prevent from using CPU resources
- Device controller informs CPU that it has finished its operation by calling an interrupt
When dealing with asynchronous events, exceptions and interrupts are important (some systems are not interrupt-based)
Hardware protection, memory mapping, and timers.
Interrupt-Driven OS
- CPU executes processes while it waits for I/O
- When I/O finishes, it sends an interrupt signal to CPU
- CPU stops process execution to service the interrupt
Handling Interrupt Signals
- CPU Saves current state and changes to supervisor mode (privileged mode)
- Looks up service routine for that interrupt using an interrupt vector (maps expected interrupt to certain instruction location)
- Program is responsible for interpreting interrupt.