CPU-intro Flashcards
By running one process, then stopping it running another, the OS promote the illusion that many virtual CPUs exist when in fact there is only one physical CPU (or a few). This technique is also called.
Time sharing of the CPU
What does time sharing allow users to do?
Run many concurrent processes
Negatives with time sharing of CPU
Performance cost, as each will run more slowly if the CPU(s) must be shared.
Low-level machinery of the OS is called
Mechanisms
Explain mechanisms
Are low-level methods or protocols that implement a needed piece of functionality. Mechanisms are the implementations that enforce policies, and often depend to some extent on the hardware on which the operating system runs.
Name an example of low-level machinery
Context switch, it is a time-sharing mechanism employed by the OS
What ability does the context switch give the OS?
Ability to stop running one program and starting running another on a given CPU
Explain what policies are
Policies are algorithms for making some kind of decision within the OS.
Give an example of a policy within the OS
Scheduling policy (deciding which processes should run)
The abstraction provided by the OS of a running program.
Process
What a program can read or update when it is running
Its machine state
Name components of machine state that comprises a process
Memory, registers, storage device
The memory that the process can address
Address space
What are the process registers?
Many instructions explicitly read or update registers, important to the execution of the process.
Give an example of the processes registers
Program counter (PC)
What is the program counter
It tells us which instruction of the program that is currently being executed.
Explain stack pointer and fram pointer
Are used to manage the stack for function parameters, local variables, and return addresses.
Name some of the API that must be included of an operating system.
Create, destroy, wait, miscellaneous control, status
Explan the method create
An operating system must include some method to create new processes.
Explain the method destroy
A way to destroy proesses forcefully.
Explain the method wait
Wait for a process to stop running.
Explain miscellaneous control
For example can be a method to suspend a process, and then resume it.
Explain status
Interfaces to get some status information about a process as well, how long it has run for or its state.
How does the OS get a program up and running?
OS load its code and any static data (initilized variable) into memory, into the address space of the process. Programs reside on disk in some kind of executable format. The OS reads those bytes from disk and place them in memory.