Concepts Flashcards
(48 cards)
What is an Operating System?
An operating system is the one program running at all times on a computer (called the kernel) that manages a computer’s hardware. Everything else is either a system or application program.
First 3 OS phases?
Serial Processing → Simple Batch Systems → Multi-programmed Batch Systems
Why is an Operating System likened to a government?
Because, like a government, it can’t execute a useful function on its own, but can create an environment within which other programs can execute them.
How does an OS act as an intermediary between a user and computer hardware?
An OS acts as an intermediary by acting as a manager of these resources and controlling and allocating resources. A computer’s resources refer to its hardware such as CPU time, memory space, I/O devices (for e.g. printer, keyboard, mouse). The OS must decide how to allocate these to specific programs and users so it can operate the computer system efficiently.
What do System Calls do?
Provide an interface to the services made available by an operating system.
Why would an application programmer prefer programming according to
an API rather than invoking actual system calls?
Because an API can specify a set of functions and parameters for the programmer, and actual systems. Direct systems calls require more integration effort because all integration logic has to be manually coded.
What is the microkernel approach, and why was it developed?
As an OS expanded, it became difficult to manage. Microkernel removes all nonessential components from a kernel and implementing them as system and user-level programs. This results in smaller kernels, requiring less processes and memory management.
One pro and con of the microkernel approach.
Pro: The resulting OS is easier to port from one hardware design to another. The microkernel also provides more security and reliability, since most services are running as user—rather than kernel— processes. If a service fails, the rest of the operating system remains untouched.
Con: Performance of microkernels can suffer due to increased system-function overhead (slower processing speed, less memory, etc).
What is the Modules approach?
Involves using loadable kernel modules for an OS design - so the kernel has it’s core functions, and then other additional functions are added dynamically.
Why is the Modules Approach similar but better than the Microkernel Approach?
Like the microkernel approach, the primary module has only core functions, but it also has nonessential modules added as layers. This means modules do not need to invoke message passing up and down those layers to communicate.
What are hybrid systems? Provide examples with reasoning.
In reality, most OS combine different structures to address performance, security and usability issues.
For example, Linux and Solaris are monolithic - where all core components are in one place - which provides efficient performance. However, they are also modular, so that new functionality can be dynamically added to the kernel.
What is the definition of a process?
A program in execution / a program that’s been activated.
How does an OS execute a program (to turn it into a process)?
By loading the program into memory
What is a process made up of (in memory)?
text (the code), data (global and static variables), heap (memory dynamically allocated during run time), stack (keeps track of active function calls)
What 2 parts of a process grow toward each other?
The stack grows downward in memory, whilst the heap grows up in memory.
What happens when the heap and stack overlap?
The program could crash, but the OS monitors this to avoid a collision.
What different states can a process be in during execution?
New (process is being created)
Running (executing)
Waiting (for an event)
Ready (to be assigned)
Terminated (finished)
What is a Process Control Block (PCB)?
A structure that contains all the information about a process:
Process state
Program counter
CPU registers
Scheduling Info
Memory-management info
I/O status
In brief what does a PCB serve as?
A repository for any information that may
vary from process to process.
What is a thread when compared to processes?
A process is a container for threads - one single process can have one or multiple threads of execution, allowing a process to perform more than one task at a time.
Benefits of multithreading?
1) Responsiveness - let’s a program keep running even if one thread is busy or blocked.
2) Threads share the memory and resources of the process by default - no need for message passing.
3) More economical if resources are being shared
What is a context switch?
When CPU switches to another process, the system must SAVE the
state of the old process (in the PCB) and LOAD the saved state of the new process - aka, a context switch
What is process creation?
A process may create several new processes, like how a parent would create children.
What 2 options are there for parent/child process execution?
- The parent and children process execute concurrently.
- The parent waits until children have terminated.