OS Part 1 (Intro to OS) Flashcards
What is an operating system?
Software layer that enables communication between the hardware components of a computer.
What are the two main functions of an OS?
- Provides an extended (or virtual) machine that abstracts the hardware components of a computer down to their functionality.
- Manages the resources of a computer (CPU, RAM, Disk usage) so that programs can make progress in the intended manner. Often enables multitasking (more than one program at once).
How and why does an OS provide an abstraction of hardware components?
Individual physical hardware components can have very different interfaces and command sets to one another, and they can all be very complex.
Extended and/or virtual abstractions can help standardise the communication between these components for developers, reducing complex, individual instructions into familiar, repeatable, and human understandable commands.
How and why does the OS act as a resource manager?
Most modern programs require a significant mixture of CPU, Memory, and Disk resources to function. OSs facilitate the management of these resouces between multiple different tasks at a time, allowing for apparent multitasking.
OSs also are often tasked with protecting hardware such as memory, and are able to exit into states that protect components from damage if something goes wrong (e.g Kernel Panic)
What is the “Kernel”?
Core of the operating system.
Mediates and controls access to hardware and system-wide resources.
What is POSIX?
“Portable Operating System Interface”
A set of standards and rules for operating system design that should allow and encourage the easy porting of programs from OS to OS.
Unix and MacOS are examples of POSIX compliant operating systems. Programs should be able to run easily regardless of OS version number, or should be easy to port from one version to the other.
Linux is “mostly” POSIX compliant. Windows is not.
What is a “Monolythic OS”?
Often a huge binary library that contains all the layers of the OS.
This provides a faster system, at the cost of reliability.
Downsides are that kernel operations have system-wide effects due to the sprawling exhaustive nature of the OS. Errors can crash both system programs and general applications.
This means bugs in the kernel brings the whole system down. For example, an error in a trivial system such as an audio driver can end up crashing critical resources such as database clients.
Linux has 15,000,000 lines of code in its OS.
What is a “Microkernel OS”?
Minimalist approach to kernels that aims to include as limited feature set as possible, only providing what is necessary for the system to function.
This provides a more reliable system, at the cost of performance.
Unlike monolithic OS, splits OS libraries into small, well defined modules. Only essential modules (such as the Microkernel and IPC systems) run in kernel mode.
Everything else runs in User Mode, increasing reliability - e.g a bug in an audio driver won’t crash the whole system.
MINIX3 has 15,000 lines of code in its kernel.