What is an operating system? Flashcards
What Do computers consist of?
Processor, Main Memory, Disk, Various input/output device/interfaces.
Operating Ststem manages these.
Functions of OS
> Extended/ virtual machine
Resource Manager
OS as an extended machine
> Provides abstractions for complex hardware which usually has binary interface.
> It is presented better to the application programs at the top.
OS as a resource manager
> Allows multiple programs to run at the same time.
Manage protect: memory, IO devices + other resources.
Share resources in time and in space.
Shares processor time and memory/disk.
Kernel
> Core of OS:
Mediates + controls access to hardware and
system wide resources.
> Privileged kernel mode for operations on hardware or operations with system-wide consequences.
User level processes switch to kernel mode as
the result of invocation of a system call.
> Operations within memory allocated to process don’t require kernel privileges.
> Controls access to hardware.
Interface
> Kernel/OS provides programmable interface to layers above
-Generic systems interface application programmers use are often standardised abstraction of OS and hardware. E.g. POSIX: can be implemented by many different operating systems.
-OS-Specific kernel interface is a set of privileged operations for which the standardised systems interface operations are wrappers. e.g. the read systems call to read form a file will call disk operations at the kernel interface.
OS Structure
Different types of systems:
-Mainframe, servers, PCs, mobile, embedded
-One size doesn’t fit all
-Design decisions and trade-offs to meet
requirement in each system
And need to meet non-functional requirements. e.g. maintainable and reliable structures.
Monolythic OS
Traditionally all OS layers are in kernel. OS is a single binary library that applications link to.
Problem is that kernel operations have system-wide consequences: can impact whole system. Bugs in kernel can bring whole system down. Bug in audio driver accessed by media player can crash whole system.
Microkernel OS
Improve reliability by putting as little as possible in the kernel.
Split OS into small, well-defined modules.
Run only essential modules in kernel mode (the microkernel for process management, IPC etc.)
Device drivers, filesystem etc are separate user mode processes. A bug in audio drive will garble sound not whole system.
MINIX: example microkernel OS
MINIX3 micro kernel: 15000 lines of code
Monolithic 0S (Linux): 15,000,000 lines of code