What is an operating system?
An operating system is the software layer that manages a computer’s resources for its users and their applications.
What happens when you run a program?
CPU:
What are the jobs of an OS?
What are the design goals of an operating system?
- Efficiency of usage of CPU, memory etc.
Explain short: What is the goal of process abstraction?
The goal of process abstraction is to run multiple processes concurrently, by time sharing the cpu. We then need mechanisms (context switch) and policy(scheduler). This makes the illuision that each program has it’s own isolated machine.
What is virtualization of the CPU?
What can a program read and update when it is running?
What is I/O?
I/O stands for input and output and is reffered to devices connected to a computer. This could be a mouse and keyboard.
Which states can a process be? Explain them
Give the possible transitions between the three states.
Running to ready: OS preempts the running process.
Running to Blocked: Process makes system call to innitiate IO
Ready to running: OS schedules process to run next.
Blocked to ready: IO requested by process is done.
Which data structure is where the operating system keeps the program counter, stack pointer and other information about a process.
PCB (process control block)
What does a PCB (process control block) contains?
What does API stand for?
Application programming interface (API)
Why do we have an API in the OS?
-Makes it possible for all services in the operating system to communicate.
What does fork() do?
What does exec() do?
In computing, exec() is a functionality of an operating system that runs an executable file in the context of an already existing process, replacing the previous executable.
What does exit() do?
Exit() terminates a process
What does wait() do?
Wait() causes a parent to block until child terminates/exits or a signal is received.
What happens during fork()?
What happens during wait()?
What happends during exec()?
What different modes can an OS run a executable from?
Which two modes does the OS have?
User and kernel mode
What is kernel mode?
In Kernel mode, the executing code has complete and unrestricted access to the underlying hardware. It can execute any CPU instruction and reference any memory address. Kernel mode is generally reserved for the lowest-level, most trusted functions of the operating system. Crashes in kernel mode are catastrophic; they will halt the entire PC.
When is trap function called?
What is a trap function?
It is a software interrupt generated by the user program or by an error when the operating system is needed by it to perform the system calls or an operation