1/75
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Where is the operating system?
Runs in the kernel and has complete access to all the hardware and can execute any instruction the machine is capable of executing
What two functions does the OS perform?
Provide application programmers a clean abstract set of resources and manages these hardware resources
The OS can be defined as what two things?
Extended machine or resource manager
Viewing the OS as an extended machine is considered what type of view?
Top-down view
Viewing the OS as a resource manager is what type of view?
Bottom-up view
What is the processor?
The brain of the computer. Fetches instructions from memory and executes them
What is the basic cycle of every cpu?
Fetch instruction from memory, decode to determine its type and operands, execute it, and then fetch, decode, and execute subsequent instructions
What is multithreading?
Allows the CPU to hold the state of two different threads and then switch back and forth on a nanosecond time scale
What is main memory divided into?
Cache line that are 64 bytes
Where are the most heavily used cache lines located?
High-speed cache located inside or very close to the CPU
What is a cache hit?
When a program needs to read a memory word, the cache hardware checks to see if the line needed is in the cache if it is its a hit. The request is satisfied from the cache and no memory request is sent over the bus to main memory
How long do cache hits and misses take?
Cache hits take two clock cycles while misses have to go to memory with a substantial time penalty
Why should you traverse caches by row?
Take advantage of spatial locality since consecutive elements in a row are stored contiguously in memory and load more efficiently into the CPU
Difference between HDD and SDD
SSD have no moving parts, do not contain platters, and store data in flash memory
What is virtual memory?
Makes it possible to run programs larger than physical memory by placing them on the disk and using main memory as a kind of cache for the most heavily executed parts
What does virtual memory require?
Requires remapping memory addresses on the fly to convert the address the program generated by the physical address in RAM where the word is located.
Who does the mapping for virtual memory?
The memory management unit which is a part of the CPU
IO devices consist of what two parts?
The controller and the device itself
What is a controller for I/O
A chip or set of chips that physically controls the device. It accepts commands from the OS and carries them out
What is a device driver?
The software that talks to a controller, gives it commands and accepts responses. Each controller manufacturer has to supply a driver for each OS it supports
What are the three ways to accomplish I/O?
A user programs a syscall, which the kernel translates into a procedure call to the appropriate driver (simplest)
The driver starts the device and asks it to give an interrupt when it is fine. At that point, the driver returns. The OS then blocks the caller if need be and looks for other work to do.
Use of special Hardware. Direct Memory Access Chip that can control the flow of bits between memory and some controller without constant CPU intervention
What is the Basic Input Output System/Unified Extensible Firmware Interface (BIOS/UEFI)
Contains low level IO software, including procedures to read the keyboard, write to the screen etc
Where is the BIOS/UEFI located?
Flash ram which is nonvolatile but can be updated by the OS itself when patches need to be applied to it
What happens when the computer is booted for BIOS/UEFI?
BIOS/UEFI is started and checks to see how much ram is installed along with other basic checks. It determines the boot device and loads the OS into memory and starts it. The OS then queries the BIOS/UEFI to get configuration information and proceeds to startup
What is a monolithic system?
Most common structure. Entire OS runs as a single program in kernel mode
What is a basic structure of a monolithic system?
Main program that invokes the requested service procedure. A set of service procedures that carry out the system calls. A set of utility procedures that help the service procedures.
What are microkernels?
A layered approach to kernels, designer have a choice to where to draw the kernel-user boundary.
Downside of microkernels?
Takes longer because of message passing between kernel and user
Upside for microkernels?
By having less in the kernel, bugs wouldn’t bring down the system instantly
What are layered systems?
A generalization of the approach of Monolithic kernels to organize the OS as a hierarchy of layers, with each one constructed upon the one below it
What is a client server model?
A variation of microkernel that distinguishes two classes of processes. Servers which provide a service and clients that use the provided services
Communication between Client-Server model is done how?
Message passing
What is a process?
An abstraction of a running program. An instance of an executing program, including the current values of the program counter, registers, and variables
Processes allow a single CPU to have what?
Pseudo concurrent operation.
In the process model what does each process think and what is reality?
Each process believes it has its own virtual CPU, in reality each CPU switches back and forth from process to process
What is multiprogramming?
When a CPU switches back and forth from process to process
What four principal events cause a process to be created?
System Initialization
Execution of a process creation system call by a running process
A user request to create a new process
Initiation of a batch job
What causes a process to terminate?
Normal Exit (Voluntary)
Error Exit (Voluntary)
Fatal Error (Involuntary)
Killed by another process (Involuntary)
What is a process group?
A process and all of its children and further descendants
When a user sends a signal from the keyboard to a process group what happens?
The signal is delivered to all members of the process group currently associated with the keyboard. But individually, each process can catch the signal, ignore the signal, or take the default action
Is there a concept of process hierachy?
No, all processes are equal.
What are tokens in a process?
The parent is given a special token called a handle that allow parents to control the child. But the parent is free to pass this token to some other processes.
Can processes in UNIX disinherit their children?
No, they cannot disinherit
When does a process block?
When it cannot continue because it is waiting for an input that is not yet available. Also possible for a process that is conceptually ready and able to run to be stopped because the OS has decided to allocate the CPU to another process for a while
What states can a program be in?
Started/New, Ready, Running, Blocked/Waiting, Terminated/Exit
What is the scheduler?
The lowest level of the OS with a variety of processes on top of it. All the interrupt handling, process state management and more are hidden here. Makes the choice of which processes get CPU cycles
What is a sequential process?
All the runnable software on the computer, including the OS
In process creation, system initialization is what?
Part of the kernel
What are the 3 main process states we care about?
Ready, Running, Blocked
What is a process table/process control blocks?
OS maintains a table (array of structures) with one entry per process
What is an interrupt vector?
Contains the address of the interrupt service routine (ISR)
What are the three main topics in the process table?
Process management, Memory management, File Management
Actions such as saving registers and setting the stack pointer are unable to be what?
Expressed in high level languages even C, so must be done in assembly
Whats the key idea of a process interupt?
After each interrupt, the interrupted process returns to precisely the same state it was in before the interrupt occurred
What is a main thread?
In traditional OS, each process has an address space and a single thread of control called a main thread
Why use multiple threads within a process?
Multiple activities at once, lighter weight than processes, allows activities to overlap improving performance, and useful in true hardware parallelism environments
How are threads useful in process modeling?
Allow multiple executions to take place in the same process environment and address space
What are the two main ways to implement threads?
User Space and Kernel Space
What is user space for threads?
OS does not know the existence of threads, it thinks its only working on single-threaded processes. Works on OSes that don’t support threading

What is kernel space for threads?
Thread creation/destruction handled by kernel calls. No need for a runtime system

Whats the biggest advantage for user space threads?
Can be implemented on an OS that doesn’t support threads
What is a thread table?
Keeps track of threads in that process, contains stack pointer, program counter, registers, state, etc
Disadvantage of user space threads?
Invisible to kernel and lack of coordination
Advantages of kernel threads?
Directly supported by OS, kernel performs thread creation, scheduling, and management
Disadvantage of kernel threads
Slower to create and manage because you have to switch between the OS and the Kernel
What is the scheduling algorithm?
What the scheduler uses to make decisions of which processes get CPU cycles
What is a long-term schedueler?
Selects a process from the pool of jobs and loads into memory from execution
What is a short-term scheduler?
Selects a process from the ready queue and allocates it to the CPU
What is the memory scheduler?
Decides which processes should be kept in memory and which ones kept on disk when the number of processes is too large
Why is scheduler important?
Process switching is very expensive
What happens when switching from user to kernel mode?
All information for the blocked process must be saved, memory map must be saved, new process selected by scheduler, information from new process must be loaded, and start running a new process
What happens when you context switch?
Flush out the entire cache, very inefficient long term
When to schedule?
Process creation, process switching from running to blocked, process switching from running to ready, terminating a process, process switching from blocked to ready
What is non-preemptive algorithm?
Picks a process to run and then lets it run until it blocks or voluntarily releases the CPU
Drawbacks for non-preemptive algorithm?
Even if it runs for many hours, it won’t be forcibly suspended and no scheduling decisions are made during clock interrupts
What is preemptive algorithm?
Picks a process and lets it run for a maximum amount of some fixed time. If still running at end of time interval, process is suspended and scheduler picks another process to run. Requires clock interrupt to give control of CPU back to scheduler