Karteikarten
OS Mid term
Karten in diesem Stapel (200)
- 1A program that acts as an intermediary between a user of a computer and the computer hardware?Operating System
- 2What are the goals of OS?- Execute user programs and solve problems.
- Make computer Convenient to use.
- Use h/w in an efficient manner. - 3What are the 4 components of computer system structure?. Hardware
. Operating System
. Application Programs / software
. Users - 4CPU, Memory, IO device are example of ?Hardware
- 5What controls and coordinates use of hardware among various applications and users?Operating System
- 6Defines ways in which system resources are used to solve problem of the user?Application Programs / sw.
- 7People, machines and other computer are example of ?Users
- 8They are resource poor and optimized for usability and battery life?Hand-held Computers
- 9They have little or no memory?Embedded Systems
- 10--------- is a resource allocator?OS
- 11--- controls the execution of programs and prevent errors/improper use of the computer?OS
- 12The ---- is one program running at all times on the computer?Kernel
- 13What are examples of resources?CPU
Memory
IO Devices - 14What program is loaded at power-up or reboot?Bootstrap
- 15Bootstrap is typically stored in the -----?ROM
or
EPROM - 16Another name for bootstrap is ----?Firmware
- 17Is it possible to execute IO devices and CPU concurrently?Yes
- 18Each device controller is in charge of --------- type?a particular device type.
- 19Each device controller has a ------local buffer.
- 20CPU moves data from ----main memory to/from local buffers.
- 21Device controller informs the CPU that it has finished its operation by causing ------an interrupt.
- 22Interrupts transfer controls to the interrupt service routine which contains the ---addresses of all service routines.
- 23Interrupt Architecture must ----save the address of the interrupted instruction.
- 24------- is a software generated interrupt caused by either an error or user request.A trap or exception
- 25An operating system is --- driven?interrupt driven.
- 26Types of interrupts?Hardware interrupts
Software interrupts
Traps - 27Hardware interrupts are ---generated by hardware. e.g. device controller, CPU, timer, hw failure, parity error, power failure.
- 28Software interrupts are ----generated by software e.g. kernel code for system call.
- 29Traps are software interrupts caused by ---exceptional software conditions. e.g. division by zero, incorrect use of instruction.
- 30What are motivations of the interrupts?Efficiency - does not waste CPU in polling
Fast Response - CPU can be aware of an event ASA it occurs. (no polling) - 31What are the steps involved in Interrupt Processing?1. Events occurs and CPU is interrupted.
2. CPU stops current process.
3. Disable interrupt.
4. Store infor. related to current process in the PC.
5. OS lookup ISRoutine in IStable.
6. Execute ISR
7.Resumes the interrupted process.
8. Enable interrupt. - 32After IO starts control is returns to user program only upon ----IO completion.
- 33Wait instruction idles the CPU until the ---next interrupt.
- 34Device status table contains --entry about IO device indicating type, address and state.
- 35The basic unit of computer storage is ----the bit.
- 36A bit contains 2 values either ----0 or 1
- 37A byte is ---8 bits.
- 38The smallest convenient chunk of storage of a computer?Byte
- 39A computer does not have instruction to move a bit but a ------byte.
- 40Network measurements are exception to this general rule because -----network move data in bits.
- 41Storage Structure ------Main memory - large storage media that CPU can access directly. Random access & typically volatile.
- 42Storage Structure ------Secondary storage - extension of main memory, non-volatile .
- 43Storage Structure ------Hard Disks - rigid metal/glass platters with magnetic recording materials, divided into tracks and sectors.
- 44Storage Structure ------Solid state Disks - faster than hard disks and are non volatile.
- 45Storage Hierarchy - Speed Cost VolatilityRegister - Cache -Main memory - Solid state disk - Hard disks -Optical disks - magnetic tapes.
- 46Caching means copying of ----copying of information into faster storage system. e.g. main memory is a cache for secondary storage.
- 47Direct Memory Access Structure used forused for high speed IO devices to transmit infor. at close to memory speeds.
- 48Only one interrupt is generated per block rather than -----one interrupt per Byte.
- 49Most use single general purpose processor butMost system has special purpose processors as well.
- 50Parallel systems or tightly coupled systems are known as ------ systems.Multiprocessor Systems
- 51Advantages of Multiprocessor are ------Increase throughput.
Economy of scale.
Increased reliability. - 52There 2 types of Multiprocessor ------Asymmetric Multiprocessing-each processor assigned specie task.
Symmetric Multiprocessing-each processor performs all tasks. - 53Multi-Chip / Dual core /Multi-core are systems -----systems containing all chips.
- 54Clustered Systems are ----multiple system working together.
Sharing storage via SAN and provides HA service. - 55Some application written in parallelism have ---- to avoid conflicting operations.DLM - Distributed Lock Manager to avoid conflicting operations.
- 56Multiprogramming/Batch System are need for ------Efficiency.
- 57Time sharing / Multitasking is a logical extension in which -------CPU switches jobs so frequently that users can interact with each job while it is running etc. Creating interactive Computing.
- 58Each user have at least one job running, if several jobs ready to run at the same time CPU needs to do ----------CPU Scheduling.
- 59If processes don't fix into memory -------Swapping moves them in & out to run.
- 60VM allows execution of process not -------completely in the memory.
- 61OS have ------ mode operation to protect itself and other system components.Dual mode operation
- 62Name 2 OS modes of operation?User Mode
Kernel Mode - 63------ can distinguish between system running user / kernel mode?Mode Bit
- 64Some instructions are designated as privilege and ------- in the kernel?ONLY executable in the kernel.
- 65------ is used to prevent infinite loop and process hogging resources?Timer.
- 66Timer is decremented by physical clock, when counter zero is generated -------- occurs?an interrupt occurs.
- 67When Mode Bit = 1User process executing.
- 68When Mode Bit = 0Kernel process executing.
- 69A process is -------- in execution?a program in execution.
- 70A program is ----- of instructions?sequence of instructions.
- 71A process is a unit of ------ within the system.work
- 72Program is ------------entity while process is -------- entity?Program is PASSIVE entity,
Process is ACTIVE entity. - 73Process needs resources to accomplish its -------?tasks
- 74Examples of resources are ---CPU, Memory, IO, files, Data.
- 75Process termination requires reclaim of any ------------------?any reusable resources.
- 76Single threaded process has ------ counters?one program counter.
- 77Multi-threaded process has one program counter -------?per thread.
- 78OS is responsible for -----?process creation, suspension, resuming, synchronization, communication and deadlock handling.
- 79To execute a program all/part of instructions must be in the -------memory.
- 80Does OS deal with uniform & logical view of infor. storage, abstract physical properties-files?Yes.
- 81Files are usually organized into -------directories.
- 82Program stack grows -------downwards.
- 83Heap grows ------upwards.
- 84OS is made up of the ff. layers structure----Stack Segment
Possible holes in address space
Heap
Data Segment
Text Segment - 85WORM means ------Write Once Read Many times.
- 86RW means -----Read-Write
- 87Multi-processors must provide ---- in hw such that all CPUs have the most recent value in their cache.Cache Coherency
- 88Does OS hide peculiarities of hardware devices from users?Yes.
- 89---- is responsible for memory mgt. of IO such as buffering, caching, spooling, device driver, hardware drivers?IO Subsystem
- 90Does OS protect access to process or users to resources and security defense?Yes
- 91Mention 3 Kernel Data Structures ------Singly Linked List
Doubly Linked List
Circular Linked List - 92In Binary Search trees the left is ---- the right. Search performance is 0(n).<=
- 93Balanced tree is complexity of ----0(log n)
- 94Hash function can create ---------------Hash Map
- 95Linux data structures is defined include files -----
- 96Mobiles use ----- for connectivity?IEEE 802.11 wireless for connectivity.
- 97---- is collection of separate/possibly heterogeneous systems networked together.Distributed Computing
- 98Dumb terminals supplanted by smart PC's -------Client-Server Computing
- 99Does not distinguish clients/servers, all nodes are peers?Peer-to-Peer Computing
- 100Skype, VoIP, Gnutella, Napster are example of ------peer-to-peer computing
- 101------ allows OS to run application with other OSes?Visualization
- 102--- is an OS service providing useful & helpful function to users?User Interface
- 103All OS have ----- interface?User Interface
- 104Mention 3 types of user interface?CLI - command line interface
GUI - graphical user interface
Batch - 105List examples of shells?Bourne shell
Korn shell
C shell - 106Apple Mac OS X uses -----Aqua GUI and UNIX kernel under.
- 107What are Programming interface to services provided by the OS?System Calls
- 108List 3 major API's?POSIX API - Unix, Linux, Mac OS X
Win32 API - windows
Java API -JVM - 109Why use API over system calls?Portability.
Easy and Simple. - 110Mention 3 general methods of system call parameter passing?Simplest -pass parameters in registers.
Block -pass parameters in block.
Stack - pushes parameters onto stack.
NB: Block & Stack does not limit the # or length of parameter passed. - 111Create Process() in windows is ------ in UNIX?fork()
- 112Exit Process() in windows is ------ in UNIX?exit()
- 113Shell executes fork() system call to -----------create a process.
- 114Execute exec() to ------------load a program into process.
- 115Process exit with code 0, means ------------ Process exit with code > 0, means ------------no errors.
error code. - 116Error process is Child process is equal to Parent process isless than 0.
0.
greater than 0. - 117User mode will call printf() while Kernel mode will call ------------ system callwrite()
- 118A Registry is used to ----------- information?store and retrieve configuration information.
- 119Subsystems and Daemons that runs in the user context are known as -----------Background services.
- 120Application programs are not considered as part of -----OS.
- 121OS design is a task of -----------------software engineering.
- 122OS are in ------------ language?assembly language.
- 123Mention OS structures?1. Simple Structure - MS-DOS
2. More Complex - UNIX
3. Layered Structure - an abstraction
4. Microkernel - Mach (Mac OS X). - 124Dynamic loadable modules called ----- extensions?Kernel extensions.
- 125What is debugging?Debugging is finding and fixing errors or bugs.
- 126OS generates log files, failure of an application generates -------- file?core dump.
- 127failure of an OS generates -------- file?crash dump file.
- 128Profiling means?Profiling is periodic sampling of instruction pointer to look for statistical trends.
- 129Kernighan's Law says debugging is twice as hard as writing a code, therefore if you write a code as cleverly as possible you are by definition not smart enough to ------debug it.
- 130Dtrace allows ----- on prod. systems.live instrumentation on production systems.
- 131GRUB is an example of common ------that allows selection of kernel from multiple disks.bootstrap loader.
- 132When kernel loads ---- running?system is running.
- 133Process is a program in ------?execution.
- 134Program becomes process when --- the memory?executable file is loaded into the memory.
- 135When process executes it changes ------state.
- 136Process states are ------New - process being created.
Running - instructions being executed.
Waiting - process waiting 4 some event to occur.
Ready - process waiting to be assigned to processor.
Terminated - process finished. - 137PCB - Process Control Block contains ------- each process.information associated with each process.
- 138CPU can switch from process to ----process .
- 139Job queue is ----set of all processes in the system.
- 140Short-term scheduler are invokedinvoked frequently within milliseconds, very fast.
- 141Long-term scheduler are invokedinvoked infrequently within minutes/seconds, very slow.
- 142Mid-term scheduler are used for ----Swapping.
- 143When CPU switches to another process, system must save the state of the old process and load and save state for the new process......this is known as?Context Switching.
- 144Context switching if frequently occurs might be ------expensive and decrease system performance.
- 145Solution to Context Switching include d ff.....a. Multiple sets of Registers.
b. Special hardware instructions.
c. Threads. - 146Parent process creates the ----- processes?child/children processes
- 147pid meansprocess identifier
- 148Parent and children share ---- Children shares a subset of ---- Parent and child share ------ Parent and children execute concurrently --- Child duplicate of parent and have -----all resources.
parent's resources.
no resources.
parent must wait until children terminate.
program loaded into it. - 149UNIX fork() system call creates a ----- exec() system call used as a fork to replace ----new process.
process memory space wt a new program. - 150Process execute d last stmt and ask OS to -----delete it (exit)....means process termination.
- 151Parent terminate / abort child process if -----child exceed allocated resources.
task no longer required.
parent is exiting. - 152Cascading Termination all -------?all children are terminated.
- 153If parent dies the children areinherited by (init) process 1.
- 154Either parent/child can terminate either process using command ----kill().
SIGKILL()
child pid;
getppid(); - 155If no parent is waiting then ---process is a Zombie.
- 156If parent terminated without invoking wait then ----process is Orphan.
- 157Chromo Browser has 3 processes ---Browser, Renderer and Plug-In
- 158Process can be independent or ------cooperating.
- 159Cooperating process can ---- by other processes?affected / be affected by other processes.
- 160Reasons for cooperating are ----Information sharing, Computation Speedup, Modularity, Convenient.
- 161Cooperating processes need ----?IPC
- 1622 Models of IPCShared Memory
Message Passing. - 163Massage size can be either ---fixed or variable.
- 164P and Q can communicate via ---- link.an established communication link.
- 165Link may be unidirectional but usuallybi-directional.
- 166Indirect communication is through ---mailbox / port.
- 167Message passing can be eitherblocking or non-blocking.
synchronous or asynchronous. - 168If both receive & send are blocking we have a -----rendezvous.
- 169Buffering - queue of msg attached to a link is implemented in 3 ways:Zero Capacity- no msg is queue on link.
Bounded Capacity - finite length of n msgs.
Unbounded Capacity - infinite length of msgs. - 170Client-Server Systems communicates using the ff. ----Sockets
Remote Procedure Calls -rcp
Pipes
Remote Method Invocation -java. - 171Ordinary pipes can not be ---- created it.accessed outside the process that created it.
- 172Named pipes can beaccessed without parent-child relationship.
- 173Threads runs within anapplication.
- 174Process creation is heavy-weight while thread creation islight-weight.
- 175A thread is an independent stream of instruction that can be scheduled to run by the -OS.
- 176Benefits of threads areResponsiveness
Resource Sharing
Economy - thread 30 times faster creating and 5 times faster switching than process.
Scalability/Utilization of MP. - 177Types of threadsUser threads
Kernel threads - 178User threads are independent of OS. 3 primary thread libraries arePOSIX threads
Win32 threads
Java threads - 179Kernel threads are supported by kernels, slower than user threads. Examples areWindows XP 2000
Solaris
Linux
Tru64
Mac OS X - 180Parallelism implies a system cana system can perform more than one task simultaneously.
- 181Concurrency supportsmore than one task making progress.
- 182Amdahl's Law identifies performance gains from additional core to an app. dt has both serial and parallel components.Serial portion of an app has disproportionate effect on performance gained by additional cores.
speedup <=
1/
s+(1-s)/N - 183Multithreading models are as follows:Many-to-one
One-to-one
Many-to-many
Two-Level Model. - 184Many-to-oneMany user-level threads mapped to a single kernel. e.g.
Solaris Green threads
GNU Portable threads - 185One-to-oneEach user-level thread mapped to a kernel thread. More concurrency than many-to-one. e.g
Windows
Linux
Solaris 9 & later. - 186Many-to-manyMany user-level threads mapped to many kernel threads.
Solaris before 9
Windows wt thread Fiber package. - 187Two-Level ModelSimilar to M:M except it allow user thread bound to kernel thread.
IRIX
HP-UX
Tru64 UNIX
Solaris 8 & before. - 188Explicit threadsPthreads
Java threads - 189Implicit threadsThread Pools
Open MP
Grand Central Dispatch
TBB Microsoft Thread Building Blocks - 1902 types of Dispatch queues:Serial -block removed in FIFO order
Concurrent - removed in FIFO order but several can be removed at a time. - 191Threading issues includes:Semantics of fork() and exec() system calls
Signal handling
Thread cancellation
Thread local storage
Scheduler activations - 192Does fork() duplicates only the calling thread or all threads?Some UNIXes have 2 version of fork()
- 193exec() works as normalreplacing d running process including all threads.
- 194Signals are used to notify a processto notify ta process that a particular event has occurred. A signal handler processes signals.
- 195Terminating a thread before it has finished is calledThread Cancellation
- 196Thread to be cancelled is calledtarget thread.
- 197Asynchronous Cancellationterminates target thread immediately.
- 198Deferred Cancellation allowstarget thread to periodically check if it should be cancelled.
- 199Concurrent access to shared data may result in -----. Race condition isData Inconsistency.
a situation where several processes access and manipulate shared data concurrently. Final value depends on the process that finishes last. - 200Solution to Critical Section problem must satisfy 3 requirements:1. Mutual Exclusion -if process pi is executing in its CS no other process can execute in their CS.
2. Progress -If no process exe in CS & some process wish to enter, ONLY those dt are not exe in the RS can participate. dis selectn can't be postponed.
3. Bounded Waiting -there exist a bound on d # of times other process are allowed to enter their CS after request made & b4 its granted.
Informationen
- Beschreibung
- Karteikarten am OS Mid term, erstellt von Abolanle Sule am 08/10/2016.
- Erstellt von
- Abolanle Sule
- Aufrufe
- 0
- Bewertung