Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
79 Cards in this Set
- Front
- Back
Operating System |
- a software that controls the computer system - it's design relies on the computer's architecture - manages and distributes computer resources. |
|
Preemptive Multitasking |
- task in which a computer's operating system decides how long to allocate any task before giving another task a chance to use operating system - result is one or more processes in some state of execution at the same time. |
|
Preemptive |
Giving control of OS from one task and giving it to another task |
|
Multitasking |
When operating system shares physical memory and the CPU(s) with multiple processes |
|
What needs to happen when a process is not executing on a CPU? |
The virtual CPU state must be saved so it can be restored on the real CPU once process is restarted. |
|
Responsibilities of Kernel |
- process creation - scheduling process on CPU - managing the system memory - providing an abstraction of storage devices using file system - managing devices - providing network access control |
|
Virtual Memory |
- a memory management technique that provides representation of the storage resources that are actually given to a machine. - this creates illusion to users of a very large memory. |
|
Physical Memory (RAM) |
- it is limited - kernel must share between processes in a fair and efficient way. |
|
How are modern Operating Systems preemptive multitasking devices? |
Operating system decide how long to allocate a task before giving another task a chance to use operating system. |
|
Process Scheduling |
- computer can have one or multiple CPU(s) which executes instructions of programs. - the activity of the process manager that handles the removal of running processes and selection of another proccess. |
|
Kernel |
- program that is used to own and operate all resources of the computer system. - kernel simplifies writing and use of other programs and increases the power and flexibility available to programmers |
|
2 Advantages of Virtual Memory Management |
- processes are isolated from one another and kernel so they cannot read or modify memory of other processes or kernel. - only part of the process needs to be in memory, which lowers memory requirements of each process and allows more processes to be held in RAM. |
|
Processor ID |
- when a process is created, it has ots own id - the operating system has a table to organize these ids and each table has links to other tables such as memory. |
|
CPU |
- central processing unit carries out instructions of programs by performing basic arithmetics provided by the instruction. - CPU fetches or executes instructions, which increases instruction counter - ISR exectues on CPU and anything in CPU belonging to the executing process needs to be saved. |
|
CPU Scheduling |
- CPU scheduling is a process which allows one process to use the CPU while the execution of another process is on hold due to unavailability of any resource thereby making full use of CPU. - the aim of CPU scheduling is to make the system efficient, fast and fair. |
|
How does the Operating System create the "abstraction" of many computers in this one computer system? |
- component to switch virtual CPU onto real CPU in order to execute code that was im virtual CPU (CPU SCHEDULE) - component to make the memory allocated to the virtual CPU appear to be real (MEMORY MANAGER) |
|
Context Switch |
- when CPU switches to another process. |
|
Why do we need a virtual CPU? |
To represent the execution state of a process |
|
What happens when process is not executing on CPU? |
The virtual CPU state must be saved so it can be restored to real CPU. |
|
What happens as popgram executes? |
- Kernel must convert the virtual address to provided by CPU to the physical address because processes are stored together in real memory. - processes are executed with virtual addresses and than later mapped to a real address at runtime. Any program that executes has to be in real memoy. |
|
How does CPU fetch and execute instructions? |
It uses the virtual address of the process |
|
How is communication with devices done? |
Done by using the kernel code. The result of the communication is giving to the process that needs the data |
|
What do CPU registers provide? |
- they provide the state of the CPU that will need to be saved. - later restored if we want a preempted program to continue in the future without losing info |
|
Interrupts |
- events or triggers that come from device or program that is being executed. - each type of interrupt has an associated ISR, which is executed when that specific type of interrupt is triggered - if interrupt occurs when process is being executed, the interruot is serviced at the end of the instruction - makes you lose real time not virtual time |
|
Why does hardware save the state of the process when paused to start ISR? |
Because the IP must point to first instruction on the ISR befor next CPU fetch |
|
Interrupt Vector |
- area of memory that belongs to OS(kernel) and contains an entry for each type of interrupting entity. - each entry contains a pointer to the ISR for that type of interrupt and a PSW to be used while execiting in ISR. - IV has IVs for each type of interrupt - each of those vectors have a pointer to ISR for the type of interrupt and PSW to be used when ISR begins - pounters to functions in ISR and PSW - holds status of CPU while servicing interrupts |
|
Mechanism For Saving Interrupts |
- PC and PSW are components of the CPU state which are saved on kernel stack and fetching new PC and PSW from IV relating woth the interrupt that occured. - happens between last instruction executing for pricess and next fetch by CPU, if the next fetch is from ISR |
|
Interrupt Service Routine |
- is a software routine that hardware invokes when interrupt occurs
|
|
Memory Address Space |
Component that allows devices to be shared among processes or temporarily allocated processes. |
|
Virtual address |
The address space of a process |
|
Physical Address |
Actual address space of real addresses in the main memory of CPU |
|
Last Instruction of ISR |
- causes kernel stack to be popped - first word goes to PC and PSW of the machine |
|
Programmed I/O |
Method of transferring data between CPU on a peripheral. |
|
Virtual CPU |
- every process has a virtual CPU - when not running, virtual CPU is stored somewhere - if running, its content is in CPU register |
|
Trap |
Software generated interrupt caused by an error or user request |
|
Synchronous I/O |
- wait until I/O is done before we can continue - large amount of CPU time being wasted |
|
Asynchronous I/O |
- initiate I/O and later use info associated with I/O - when function called, give instructions for device to do, also enable interrupts - allows you to continue executing program even before I/O is done |
|
Cache Memory |
- device for handling movement of data between main memory and processor(CPU)registers to improve performance - not usually visible to the programmer or CPU - even though invisible to OS it interacts with other memory managment hardware. |
|
Main Memory(RAM) |
- main memory system of the computer - each location main memory has a unique address - most machine instructions refer to one or more main memory address. |
|
Cache Operation |
- CPU requests contents of memory location - checks cache for data - if there, get it from cache - if not, read required block from main memory to a slot in cache - than deliver from cache to memory - cache has tags to identify which blocks of memory is in each slot |
|
Memory Mapped I/O v.s DMA |
- memory mapped i/o allows device registers to be mapped into machines memory space. So when read by CPU, its reading and writing to device rather than memory - DMA allows hardware to directly read and write memory without involving CPU. |
|
How does OS code manage all resources |
- through tables and data structures - uses alot of OS memory |
|
What happens when an interrupt occurs when another interrupt is occuring? |
- disable interrupt while the other is being serviced. |
|
Interrupt Priority |
- some devices should have higher priority because if not serviced, the data might be lost. |
|
Control wires |
The BUS has control wires that have requests for interrupts. |
|
What happens if proccess needs that from I/O and is not finished? |
Kernel can pause the process and let another process use CPU |
|
Interrupts disabled |
- interrupts can be disabled by kernel - when interrupts are disabled and device requests an interrupt, it is in pending state till interrupts is enabled. - request is honored and serviced |
|
Hit ratio |
- measures performance of cache memory. - if CPU finds memory location in cache, a cahce hit occurs and data is read from cache. - if not found in cache a cachr miss occurs. - when cache miss occurs, new entry is created and copied in cache before being accesed by CPU - each cache miss slows down overall process, because after miss, CPU looks for that in higher level cache and memory. |
|
Memory Cycle |
Time it takes to read/write one word to memory. |
|
Structure of Cache and Main Memory |
- main me has upto 2^n addressable words - each hss a unique n bit address. -for mapping, main memory has a fixed length block of K words each. M = 2^n/k blocks. - cache has slots of k words each. C<M |
|
Monolithic Kernel |
- early model for a kernel - initially Linux OS was based on a monothilic kernel. - monolithic kernel is implement as a single process with all elements sharing same address space - touch one thing, have to rebuild whole kernel - all reaources and capabilities of kernel are in one process - get into kernel by interrupts traps or libraries. - user programs can invoke OS services directly or using library programs |
|
What happened when Linux OS became open source? |
- people made changes that influenced other things, in a negative way. - wasn't safe enough to interrupt because of all the data structures that were being manipulated. |
|
2 categories of activities that have to be handled by kernel |
File subsystem - exchanges data between memory and external devices either as streams of characters or blocks,achieved by device drivers Process Control subsystem - interprocess communication -scheduler -memory management |
|
File Subsystem |
- knows about files, devices these files reside on and directory structures - provides caching of File I/O - gerernally don't do I/O directly into a process, do I/O into some kind of buffer or cache that belongs to OS and then do re-mapping of buffer into address space of process or do a copy |
|
Memory management |
- allocation and management of memory among all processes that are executing |
|
Scheduler |
- highest process is made a runnable process - does binding of selected process to CPU, than makes it runnable. |
|
Interprocessing communication |
- having shared memory and communicating that way. - a way of process interacting with one another. |
|
2 parts of Device Drivers |
Low level - asscoiated with ISR - all interrupt based activities that have to do with the device is handled in one part of device driver Upper level - has to do with higher level of control of device - make device do what you want it to do, enabling interrupts and ISR handles requests and lets rest of device driver know results of interrupts. |
|
Loadable modules |
- dynamic linked libraries for the OS |
|
Microkernel |
- small reusable part of an OS kernel that implements its basic feautures - code that is small and managed in pieces - not all code has to be in kernel - reduced amount of time spent in kernel mode - gives us a much more simplified kernel, flexible - assigns only few essential functions to kernel, including address space, IPC and basic scheduling. - other OS services are provide by processes t hat run in user mode and are treated like any other application or environment by microkernel - dont have to rebuld whole OS
|
|
How does microkernel make the kernel more flexible? |
Other pieces can be built as servers |
|
Distributed OS |
Machines distributed over a network that have an OS that executes task over these machines |
|
How to get into system call interface and what happens there in monothilic kernel? |
- get into kernel by interrupts and traps - takes you to system call interface - decodes whatever functionality trap is asking for |
|
How do processes communicate with each other? |
- P1 sends message to kernel that is to be sent to P2. Kernel than sent it to P2 - same for processes in different machines with different kernels. P1 of machine 1 sends message to kernel than kernel sends to kernel of machine 2 which sends it to P2. |
|
Uniprogramming |
- Executes one program at a time. - CPU spends time executing program than when I/O operation occurs it waits till its done. This wastes time |
|
Multiprogramming |
- when one or more programs are in memory, ready to execute - when one job wait for I/O another proccess is executed by CPU. |
|
MultiProcessing |
- executing multiple processes on multiple CPUs. |
|
What happens when you have multiple CPUs |
- OS schedules processes acroaa all CPUs - can migrate processes between multiple CPUs because they share memory. - if multiple CPUs and one is't working, it executes processes on CPUs that work. - can break up task and split work between multiple CPUs - if one CPU fails, doesnt halt, runs on other CPUs |
|
What happwns when CPU has multiple threads of control? |
Can take each thread an run at aame time on different CPUs. |
|
How is true parallelization occured? |
- threads has PC associated with it - PC points to fetching and executing prpgrams |
|
Incremental growth |
- performance of a system can be enhanced by adding more CPUs - continue to system to meet demands of OS |
|
Why overcommit resources with programs? |
Keep CPU busy at all timee |
|
Threads |
- dispatcheable unit of work - threads belongs to processes - have their own state - threads can share resources of the process that owns it. - threads are independent executing entities - has its own stack for its data, stack pointer and PC - is interupptible so CPU can turn to another thread. - esentially a vCPU |
|
What if process needs to do more than one thing? |
- can create multiple threads of control - each thread of control can fetch and execute on their own |
|
Multithreading |
- technique in which a process executing on application is divided into threads that can run concurrently. |
|
PCB |
- contains everything not code based - created and managed by OS - key tool that allows support for multiprocessing. - when process is intetrupted current values of PC and CPU context data are saved in appropriate fields of the coressponding PCB. |
|
What are 3 components of process |
- executable prgram - data needed by program - process state of program |
|
What does execution content of orocess include? |
- contents of the process registers - info such as priority of the process and wherer process is waiting for I/O |
|
Threads vs processes |
- resource ownership belongs to process - scheduling and execution context belongs to thread |