Term
What is an OS (formally and informally)? |
|
Definition
Informal: It is the software layer between the applications and the hardware because the hardware would be too difficult for users to use.
Formal: It is a resource abstractor and resource allocator.
|
|
|
Term
What is the OS not a program that runs at all times and watches everything? |
|
Definition
First off, there is no need to "reserve" one CPU/core for it. |
|
|
Term
How is the OS a resource abstractor? |
|
Definition
It defines a set of logical resources that correspond to hardware resources, and well-defined operations on these logical resources.
- CPU <=> Running Programs (Start, Run, Terminate, Behave, ...)
- Memory (DRAM/SDRAM/Future RAM) <=> Data (Read, Write, Allocate, Free, ...)
- Storage Medium (HDD/SSD/.../Punchcard) <=> Files (Create, Open, Read, Write, Delete, ...);
|
|
|
Term
How is the OS an resource allocator? |
|
Definition
It decides who (i.e., which running program) gets how much (e.g., CPU cycles, bytes of RAM) and when
- CPU <=> Should the currently running program keep going? Which program should run next?
- RAM <=> Where in RAM should a running program’s data be?
- Storage <=> Where on "disk" should pieces of files be?
|
|
|
Term
What is virtualization??? |
|
Definition
|
|
Term
Why do we want virtualization? |
|
Definition
To make the computer easier to program and to provide each program the illusion that it is alone on the computer as each program goes through it's fetch-decode-execute cycle. |
|
|
Term
What is the main concurrency problem???? |
|
Definition
|
|
Term
What is Persistence in terms of OS's? What part of the OS handles this? |
|
Definition
The ability to store data that survives a program termination or computer shutdown. The file system (typically considered part of the OS) handles this through system calls and other stuff. |
|
|
Term
What is the kernel? What does it do? |
|
Definition
It is the 'core' part of the OS software. It is an event handler so it is in charge of implementing resource acstraction and allocation, making it very powerful. |
|
|
Term
Where does the kernel reside? Is it a running program? |
|
Definition
It is code and data that always resides in RAM but it is not a running program. |
|
|
Term
Is the Unix Shell technically part of the kernel? Why????? |
|
Definition
|
|
Term
Why can't a kernel use standard libraries? |
|
Definition
|
|
Term
what happens when you turn on a computer? |
|
Definition
- POST (Power-On Self-Tests) are performed by the BIOS in firmware/ROM (Read-Only Memory)
- Booting: The BIOS runs a first program: the bootstrap program (or boot loader, bootstrap, ...)
- The bootstrap program initializes the computer (register contents, device controller contents, ...)
- Then it loads another program in RAM, the bootstrap loader, and runs it
- The bootstrap loader loads (whole or part of) the kernel (i.e., some code and associated data) into RAM at a known/fixed address
- It can then load another bootstrap loader, which can load more stuff into RAM, and call another loader, etc... (so-called chain loading)
- At some point, a bootstrap loader creates and starts the first program (called init on Linux, launchd on OS X)
- Once all this has been done... nothing happens until an event occurs
|
|
|
Term
What loads the kernel onto RAM? |
|
Definition
|
|
Term
|
Definition
|
|
Term
What is memory protection? |
|
Definition
Processes never access each other's space(s) in the RAM |
|
|
Term
What is the UNIX/Linux command that lists the processes? |
|
Definition
|
|
Term
In terms of the kernel, what happens when an event occurs? |
|
Definition
The CPU stops what it was doing (i.e., going through the fetch-decode-execute cycle of some program), and instead starts running Kernel code. |
|
|
Term
What are the two kinds of OS events? |
|
Definition
|
|
Term
What are Interrupts? Give an example |
|
Definition
They are asynchronous events that stop what the CPU was doing and, instead, has the CPU run kernel code. It's typically some device controller saying "some hardware thing happened" (e.g. incoming data from the keyboard) |
|
|
Term
What are traps? Give an example. |
|
Definition
Traps (aka exceptions or faults) are synchronous events that stop what the CPU is doing and, instead, has the CPU run kernel code. It's caused by an instruction executed by a running program. It's synchronous because it's generated as part of the fetch-decode-execute cycle from the "inside world". A system call is a trap. |
|
|
Term
What is a system call? What is it for? Give examples. |
|
Definition
It's a way for user programs to interact with the OS. Technically, it is a trap that is a call to a function that is not part of the application but is inside the kernel. It's used to do almost anything that's not "compute" (e.g. open a file, allocate some memory, get input from the keyboard, etc.). |
|
|