Operating Systems Flashcards
What are the 2 main responsibilites of an OS?
- To manage the resources of a system
- To provide an execution environment for programs
What are the 3 main components of an OS’s structure?
- UI (GUI, CLI)
- System Call Module
- Kernel (resource management, program execution, file system, etc.)
What is a kernel?
A kernel is the core component of an operating system. A kernel is composed of services such as resource management, program execution, file system, protection and security, etc. The kernel is what communicates with the hardware of a system
What are the 4 main hardware devices of a system?
- CPU
- Memory
- Storage
- I/O devices
What is the purpose of a CPU?
The purpose of a CPU is to execute the instructions of a program that has been loaded into memory
What is the difference between a single-core and multicore CPU?
A single-core CPU can only execute 1 process/thread at a time. A multicore CPU with N
cores can execute N
processes/threads at a time. Multicore CPUs make parallel execution possible
How does CPU cache make a system more efficient?
CPU cache makes a system more efficient by storing future instructions so that the CPU does not have to retrieve it from memory
What data structure is normally used to represent memory?
An array of bytes where each byte is indexed to a memory address
What are the 3 attributes that you should keep in mind when comparing memory and storage?
- Speed
- Size
- Volatility
What is a process?
A process is a program (executable) that has been loaded into memory for execution
Give an illustration of the structure of a single-threaded process
- Heap (allocated memory)
- Stack (function call memory)
- Global data (initialized/uninitialized variables)
- Code (executable code)
- Thread (basic unit of executaion by the CPU)
Give an illustration of the structure of a multithreaded process
- Heap (allocated memory) shared
- Stack (function call memory) not shared
- Global data (initialized/uninitialized variables) shared
- Code (executable code) shared
- Threads (basic unit of executaion by the CPU)
When a process is created what data structure does the OS create to represent that process and where is it stored?
A process control block which contains the process ID, process state, and other information needed by the OS. This data structure is stored in kernel space
Can 2 processes communicate with one another?
Yes, but this is not the default setting. If 2 processes agree to communicate with one another, they can do so by either shared memory or message passing