GoConqr has a new look! Let us know what you think.

Flashcards

SCC211 - Operating systems

Mac Howarth English 111 cards

Cards in this deck (111)

  1. 1What does the OS do?Manages the hardware and system resources
    Shares out and accounts for resources
    Offers secure environment for apps
    Provides common device or I/O system
  2. 2What is the benefit of hardware abstraction?Allows us to hide hardware differences from the OS, meaning the OS is able to run on different hardware
  3. 3What are the three kinds (not types) of OS?Embedded/real-time
    Server
    Desktop
  4. 4What are the types of OS?Monolithic
    Layered (Multics rings)
    Microkernel
    Modular
    Exo-kernel
  5. 5Describe the monolithic typeThe OS code runs with full privileges (user/system level may not be distinct)
    Pros;
    Efficient call structure
    Cons;
    Difficult to impose security/protection
    Difficult to maintain
  6. 6Describe the layered typeRealisation that we have identifiable layers in the system (higher level built on top of lower level components)
    Pros;
    Tighter security as move away from hardware
    Cons;
    Difficult to manage if complex inter-layer call chain
  7. 7Describe the Microkernel typeFar less code has system privileges
    Components communicate by message passing (IPC)
    Pros;
    Far more secure than the other approaches
    Extendable (meaning can be built upon)
    Cons;
    Can be inefficient
  8. 8Describe the modular typeKernel loads modules as needed
    Pros;
    Kernel modules run with elevated privileges
    Cons;
    Naturally restricted to module API
  9. 9Describe the Exo-kernel type?Kernel configures security at the lowest level
    Libraries provide addition security and OS structure/personality
  10. 10What does BIOS stand for and what does it offer?Basic Input Output System
    Offers;
    Control of simple video modes
    Basic disk access
    Keyboard/mouse functions
    Parallel/serial ports
  11. 11What is the process of BIOS initialisation?POST (Power on self test)
    Finds populated memory areas
    checks basic devices (keyboard etc)
    performs a device discovery(checks ISA and PCI buses for devices)
  12. 12What is memory mapped I/O?Input/output devices visible as normal memory locations (accessed using C pointers)
  13. 13What is isolated I/O?Separate bus for I/O devices
    distinct from high-speed memory bus
  14. 14What is polling (aka busy waiting)?Where some code spins on a busy flag awaiting status change
    AKA Synchronous I/O
    Cons;
    waste of processor time
    difficult to interleave useful code
  15. 15What is interrupt driven I/O?When there is an I/O request, processes passes control to I/O controller which generates an interrupt passing control over to the interrupt handler, which then schedules the processing of data before resuming main task
    AKA Asynchronous I/O
  16. 16What is an interrupt service routine (ISR)?A software routine that hardware invokes in response to an interrupt
  17. 17What is PIC?Programmable Interrupt Controller
    processor can't have separate wire to every device (PC now uses Advanced PIC)
    Gives priority to most important devices
    Orders generated interrupts
  18. 18What is a precise exception?Current instruction(s) complete execution
    interrupt service routine called
  19. 19What is an imprecise exception?Deeply pipelined instructions not fully complete
    interrupt service routine called
    hard to recover from due to unknown state
  20. 20What happens when exceptions go wrong?If no interrupt service routine set for interrupt - processor raises double fault interrupt causing blue screen of death
    If double fault isn't handled - processor trip faults causing machine to restart
  21. 21What is a PIT?Programmable Interrupt Timer
    creates periodic event at set/configurable interval
    Used to invoke periodic kernel tasks
  22. 22What is direct memory access?Alternative to programmed I/O
    Relieves CPU of data transfer
  23. 23What is a single instance device?Devices that can only be used by one process
    There is an error if another process attempts to use them
    Often use spool files to sequence requests
    e.g Printer
  24. 24What is a multi instance device?Can handle requests from multiple sources
    Create another instance of internal data structures
  25. 25How do we obtain PCI addresses?Scan PCI bus hierarchy
    For each device need to establish device type, whether multi-function device, resource requirements and allocate and set I/O address and interrupt used
  26. 26What are the two aims of an OS?Multi-programming - switches between processes as they become blocked
    Multitasking - regularly switch between processes so each appears interactive
  27. 27What is base and limit protection?Need to protect processes from each other
    For memory, can enforce base and limit
    pros;
    Easy to handle in hardware
    simple to set 2 registers in software
    base = lower bound
    limit = upper bound
  28. 28In the context of address spaces, what is a virtual address & physical address?Virtual address - process always sees addresses 0 - N
    Physical address - where the process is located in memory
  29. 29What are the segments we divide a process into and why (base and limit context)?Stack, Heap, Code, Shared libraries and shared data
    We do this so they're tightly defined, meaning it's easier to set a base and set a limit (for each segment)
  30. 30What is internal & external fragmentation and what causes them?Internal fragmentation - when a process is allocated more memory than requested resulting in some being unused
    Caused via fixed size allocation schemes
    External fragmentation - when space is left outside/between allocated memory
    Caused by dynamic memory allocation schemes
  31. 31What is fixed size memory allocation?Allocation of memory into fixed size blocks
  32. 32What is dynamic/variable memory allocation?Allocated a request amount of memory
  33. 33What are the three types of dynamic allocation?First fit - First region of sufficient size found
    Best fit - Smallest memory hole of sufficient size
    Worst fit - Largest memory hold of sufficient size
  34. 34Why does first & best fit cause severe fragmentation?As the sum of un-allocated memory can be large
    Requires shuffling of memory contents in order to de-fragment
  35. 35What is paging?Program formed from fixed sized blocks
    -these blocks are called frames
    -process sees them as pages
    -program sees virtual memory
    -each page has different rights to the program
  36. 36How does the allocation of pages work?Allocate as/when the program grows into the empty space (between heap and stack)
  37. 37What are the three types of page tables?Register based page table
    Memory based page table
    Hybrid of the two
  38. 38Advantages/disadvantages of register based page tables?A;
    very fast
    D;
    limit capacity
  39. 39Advantages/disadvantages of memory based page tables?A;
    higher capacity then register based
    D;
    capacity is limited by size of memory
    slow access time
  40. 40Advantages/disadvantages of hybrid page tables?A;
    faster than main memory
    has a translation look-aside buffer (TLB)
    D;
    none on the slides
  41. 41What is a 'Translation Look-Aside Buffer'?A buffer (table) which stores page number/frame number pairs
  42. 42How does the TLB work?As we are accessing the page table in memory
    We copy the translations into the TLB, which uses associative memory (which is really fast)
    Then reads every address simultaneously until something matches
    If a mapping for the page is in the TLB, we get a TLB hit, which means we can do the translation
    If there isn't a TLB hit we take the translation in main memory and use that instead
    This works because programs tend to look at consecutive memory locations( which are close to each other in memory)
    These translation are only valid for a single process
    Each process has it's own page table
  43. 43How would be adapt TLB for multiple processes?Use process id along with page number/frame number pairs
  44. 44Why is the page table size a problem?Page table can contain 4kB pages which are 32 bit addresses (12 bit off set)
    Meaning that a few processes would use all of the addresses
  45. 45What is the top level page table known as?Page directory
  46. 46How does multi-level paging work?First 10 bits reference the paging directory
    Next 10 bits reference the page table (which references the physical addresses)
    12 bit offset correlates to the offset of the physical address
  47. 47What happens as we increase the depth of hierarchy?We increase the number of memory accesses which reduces the speed of every memory reference
  48. 48What does the offset allow if needed?The ability to add control information e.g. don't cache, user access
  49. 49Why is 64-bit hierarchical paging a problem?Need much larger pages - inefficient due to internal fragmentation
  50. 50What are hashed page tables?The virtual page number is hashed into a page table
    –Because hash functions can have same value for different page no
    Each element contains (1) the virtual page number (2) the value of the mapped page frame (3) a pointer to the next element
    Virtual page numbers are compared in this chain searching for a match
    If a match is found, the corresponding physical frame is extracted
  51. 51What is an inverted page table?Page table have one entry for each frame, one table used for ALL processes
    Take process id and page number and search the page table
    Take the offset in that table as a frame number
  52. 52What is a page fault?An attempt to access a memory address through an empty entry (in the page table)
  53. 53What is demand paging?Kernel allocates memory and page table entry, then the instruction which called the page fault is re-run
  54. 54What does the 'present' bit represent in the x86 architecture?Whether or not the referenced virtual memory resides in physical memory
  55. 55What is secondary storage?Each frame stored in memory will have a shadow copy on the actual disk
    Frames in memory are subsets of the shadow copies on disk
  56. 56What does the 'dirty flag' tell us?If the dirty flag is set there are discrepancies between physical frame and the backup
  57. 57What happens as regions expand (stack, heap)?More pages need to be added as new memory frames referenced in code
  58. 58How does page frame replacement work?if page fault occurs, we find a frame (victim) we aren't using that much, remove it but make sure we have a copy on secondary storage then recover the page and restart the process
  59. 59What are some ways we can speed up page frame replacement?Keep at least one page free - use this page and restart the process, then write next victim to disk and move to free list
    Keep write queue of pages (likely victims) - use any idle time to perform writes, freeing pages
  60. 60What does FIFO & LRU stand for respectively?First In First Out
    Least Recently Used
  61. 61Why is FIFO impractical to use?As the first pages are likely to hold key parts of process e.g. libraries
  62. 62How does LRU work?Replace page not used for the longest time
    Implemented by keeping count of total number of page accesses
  63. 63What is the practical way LRU can be implemented?Shift accessed bit into byte per entry table
    -If a lot of accessed bits are used frequently = 1
  64. 64How does the 'Clock Algorithm' work?On a page fault;
    if access bit is set, clear it and try next
    If access bit is clear, replace page & advance pointer
  65. 65What are the implications if we find page faults too often?That we are replacing pages too often which means that the working set is too small
    No. of bits should be 2 * working set
  66. 66What is 'Equal allocation'?Each process gets m/n frames, for memory size m
  67. 67What is 'Proportional allocation'?for processes P of size S where i = 1.n
    total size will be TS = Esi
    (insert bullshit equation)
  68. 68What is thrashing?If a process is allocated too few frames it will result in a high number of page faults
    = performance drop (wasted CPU cycles)
  69. 69How can we limit thrashing?By using a local replacement algorithm, stopping the thrashing from extending from one process to another
  70. 70What is non-page based allocation?Mechanism to allocate small areas of memory within a page
  71. 71What is buddy allocation?Memory blocks are divided by 2, making 2 buddies
    Requests cannot span buddies
    Likewise 2 buddies can be combined to reform the original block
  72. 72What is slab allocation?Created by Sun as buddy allocation suffers from a lot of internal fragmentation
    This allocation reduces the internal fragmentation by allocating for sets of requests
    for efficiency, slabs normally multiple pages in size
  73. 73What is bitmap allocation?Rather than maintaining a list, just set the bits to 1/0 depending on whether it's being used or not
  74. 74What are the types of system?Batch systems - e.g. payroll processing
    Real-time systems - e.g. high quality multimedia
    Interactive system - e.g. desktops
  75. 75What are the two types of real-time processes?Soft real-time - deadlines may be broken e.g. multimedia
    Hard real-time - deadlines critical e.g. embedded/control systems
  76. 76What are the characteristics of batch systems?Non pre-emptive - meaning jobs run until blocked or complete
    Scheduling policies -
    -first come first served
    -shortest job first
  77. 77What is a CPU bound process?Process spends most of its time processing data
  78. 78What is an I/O bound process?Processes spends most of its time waiting for data
  79. 79What is an interrupt latency?Time taken to process interrupt
  80. 80What are some real-time scheduling techniques?Driven by events
    Rate monotonic
    Earliest deadline first
  81. 81What are the two types of events within the event driven real-time scheduling?Periodic events - predictable
    Aperiodic events - unpredictable
  82. 82What are the characteristics of interactive systems?Multi-tasking
    -Cooperative - tasks/processes actively yield control to scheduler
    -Pre-emptive - scheduler forcibly takes control at regular intervals
  83. 83What is pre-emptive scheduling?Forces context switch at defined interval
    'Quantum' determines how long processes run
    Long 'Quantum' = less interactive, few switches = more efficient
    Short 'Quantum' = more interactive, more switches = less efficient
  84. 84What is round robin scheduling?Each process is given the same 'Quantum'
    go through each process in turn, interrupt happens, then start from first process
    repeat this cycle
  85. 85What is priority scheduling?Each process is given a priority
    While high priority process is being executed, the low priority processes won't get a look in
  86. 86What is fair share scheduling?Unfair to split resources equally, so resources are divided among the processes that are able to run
  87. 87What is a virtual file system?A common interface which abstracts multiple file systems, file system differences and network file systems
  88. 88What are the ways in which we can allocate memory for files?Contiguous allocation
    Linked-list allocation
    File allocation table (FAT)
    Index allocation
  89. 89What is contiguous allocation?Allocation mechanism where each file files a set of adjacent blocks in a file-system
  90. 90Advantages/disadvantages of contiguous allocation?A;
    fast access
    D;
    need to know file size before being able to store it
    external fragmentation
  91. 91What is linked list allocation?Allocation mechanism where files are stored in blocks and point to other blocks
  92. 92Advantages/disadvantages of linked-list allocation?A;
    No external fragmentation
    D;
    Sequential access
  93. 93What is FAT?Similar to linked-list but clear distinction between the data blocks and the pointers
    the table holds block numbers
  94. 94What are the three approached of index allocation?Index-linked allocation
    Multi-level (indexed) allocation
    Combined (indexed) allocation
  95. 95What is indexed allocation?Allocation mechanism that has dedicated index blocks which allow fast access to any position/address within a file
  96. 96What is linked-indexed allocation?Single index block holds a set of (data) block addresses
  97. 97What is the multi-level allocation?Similar to index-linked BUT can be any levels deep, not just one index block
  98. 98What is combined allocation?First block is the index block similar to the other two mechanism, then the pointers of these are to data blocks, but the last block will be another index block pointing to more data blocks
  99. 99What is a symbolic link?File within a file-system which contains a path which exists somewhere
  100. 100What are the 5 scheduling criterion?CPU utilisation
    Throughput
    Turnaround time
    Waiting time
    Response time
  101. 101What is CPU utilisation?Percentage of time CPU is running the application code
  102. 102What is throughput?Number of processes completed per unit time
  103. 103What is turnaround time?Time between process submission and completion
    completion - arrival time = turnaround time
    In order to average this you would add all the wait times up and divide by amount of processes
  104. 104What is waiting time?Sum of time waiting in ready queue
    Dispatch time - arrival time = waiting time
    In order to average this you would add all the wait times up and divide by amount of processes
  105. 105What is response time?Time between submission and start of first output/interaction
  106. 106What is an interrupt gate?Tells you the address for the interrupt service routine
  107. 107What is a software interrupt?Set of instructions which force the machine into an interrupt state generating a virtual exception
  108. 108What is adjacent faulting?On a page fault, copy the adjacent pages
    If there is limited memory copy only faulted page
    If there is lots of memory, copy adjacent pages
  109. 109What is asymmetric multi-processing(ASMP)?Is where a scheduler runs on a single processor and coordinates with others
  110. 110What is symmetric multi-processing (SMP)?Processors considered equal so each processor has its own scheduler
  111. 111What is processor affinity?

Information

Description
Flashcards on SCC211 - Operating systems, created by Mac Howarth on 12/05/2017.
Created by
Mac Howarth
Views
8
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?