Modern Operating Systems Notes
Modern Operating Systems Notes
These two functions can sometimes seem unrelated, but they are both essential parts
of the operating system's role.
Problem with hardware: Hardware at the machine language level is difficult and
complex to program, especially for input/output (I/O) operations.
o Example: SATA hard drives have complex interfaces. In 2007, an entire book
was dedicated to explaining how to interact with them.
o If programmers had to deal with hardware directly, it would be too
cumbersome.
Abstraction of Hardware:
o Disk Drivers: Instead of interacting with the hardware directly, OS provides
drivers to manage hardware and offer simple interfaces (e.g., reading and writing
data to disk).
o Files: Even higher-level abstraction, where OS manages disk data as files,
allowing programs to store, retrieve, and organize data without dealing with the
complexities of disk operations.
Role of Abstraction:
o Good abstractions make complex hardware simpler for programmers. For
instance, a digital photo is easier to handle as a file than as a series of complex
instructions for disk management.
o OS hides the "ugly" hardware details and provides a clean, consistent interface
for users and programs.
Time Multiplexing:
o Resources are shared by giving each program a turn.
o Example: If multiple programs want to use the CPU, the OS assigns the CPU
to one program at a time. After the program has run for a while, it passes control to
the next program.
o Example of Printer Sharing: Multiple print jobs can be queued, with the OS
deciding the order in which they will be printed.
Space Multiplexing:
o Instead of taking turns, resources are divided up among programs.
o Example: RAM is divided between several programs so they can run
simultaneously, allowing more efficient use of memory.
o Example of Disk Space: The OS allocates disk space to various users,
ensuring that files from different users are stored correctly and separately.