Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.15 KB | None | 0 0
  1. Which subsection to read:
  2.  
  3. 1.3 COMPUTER HARDWARE REVIEW
  4. 1.3.1 Processors
  5. 1.3.2 Memory
  6. 1.3.3 Disks
  7. 1.3.4 I/O Devices
  8. 1.3.5 Buses
  9.  
  10. 1.5 OPERATING SYSTEM CONCEPTS 38
  11. 1.5.1 Processes
  12. 1.5.2 Address Spaces
  13. 1.5.3 Files
  14. 1.5.4 Input/Output
  15. 1.5.5 Protection
  16.  
  17. 1.7 OPERATING SYSTEM STRUCTURE
  18. 1.7.1 Monolithic Systems
  19. 1.7.2 Layered Systems
  20. 1.7.3 Microkernels
  21. 1.7.4 Client-Server Model
  22.  
  23. 2.1 PROCESSES
  24. 2.1.1 The Process Model
  25. 2.1.2 Process Creation
  26. 2.1.3 Process Termination
  27. 2.1.4 Process Hierarchies
  28. 2.1.5 Process States
  29. 2.1.6 Implementation of Processes
  30.  
  31. 2.2 THREADS
  32. 2.2.1 Thread Usage
  33. 2.2.2 The Classical Thread Model
  34. 2.2.4 Implementing Threads in User Space
  35. 2.2.5 Implementing Threads in the Kernel
  36. 2.2.6 Hybrid Implementations
  37.  
  38. 2.4 SCHEDULING
  39. 2.4.1 Introduction to Scheduling
  40. 2.4.2 Scheduling in Batch Systems
  41. 2.4.3 Scheduling in Interactive Systems
  42. 2.4.4 Scheduling in Real-Time Systems
  43.  
  44.  
  45.  
  46. Processors:
  47. PC reg: next instructino address
  48. Stack pointer reg: top of the current stack
  49. Program Status Word
  50. TRAP: switch to kernel mode
  51. Three-stage pipleine: fetch u->decode u->execute u
  52. Superscalar cpu: 2x(fetch->decode)->(Holding buffer)->3execute u
  53. Mem:
  54. Register 1kb 1nsec<cache 4mb 2nsec<mem 10nsec<disk 10msec
  55. 1 Cache line = 64 bytes
  56. L1, L2. Intel: L2 shared across cores. AMD: not shared.
  57. EEPROM, FLASH - non-volatile, slow
  58. CMOS - long-lasting volatile
  59. Disk:
  60. circles - tracks
  61. circle cylinder - cylinder
  62. 512 bytes per sector on track
  63. moving to another track 1microsec
  64. virtual memory mapping done by memory management unit
  65. IO:
  66. controller, device
  67. device driver
  68. IO port space: collection of all device registers
  69. Busy waiting: syscall, kernel translate into procedure ccall to the appropriate driver, driver starts IO and continuouslsy polls device if it's done, returns the data, kernel returns control to caller.
  70. interupt based: same, but instead of hanging the kernel returns the control to the caller and waits for the interrupt
  71. -interrupt vector: part of the memory with interrupt handler addresses for each device
  72. DMA: CPU sets up the DMA which then runs on its own, and sends an interrupt when it's done
  73. Buses:
  74. they bus. serial, parallel, whatevz
  75.  
  76.  
  77. 1.4 is described by the names
  78. mainframe ops: transaction processing, batch, timesharing
  79.  
  80. Process: address space/core image + process table entry
  81. signals: basically software interrupts
  82. arocess table
  83.  
  84. Files:
  85. File descriptor: int returned by system when a process opens a file, to be used in subsequent operations as a proof of permissions
  86. Speical files: block, character types
  87. rwx: (owner)(members of owner's groups)(everyone else)
  88.  
  89.  
  90.  
  91. Monolithic: entire OS is a single program in kernel mode
  92. Procedures: main, service, utility
  93. Layered: OS loaded in layers, each dedicated to some functionality
  94. Microkernel: small kernel, modular OS parts.
  95. MINIX: OS (clock, sys) > (Drivers > Servers > Userland)
  96. mechanism, not policy in microkernel
  97.  
  98.  
  99. pseudoparallelism: making a single core act like multiple cores
  100. Rapid switching back and forth: multiprogramming
  101.  
  102.  
  103. Process creation reasons:
  104. 1. System init
  105. 2. Execution of process-creation syscall by a running process
  106. 3. User request to create a new process
  107. 4. Batch job init
  108.  
  109. linux: fork, execve. windows: CreateProcess
  110.  
  111.  
  112. Termination reasons:
  113. Normal exit, error exit, fatal error, killed
  114.  
  115. hierarchy:
  116. unix: parent and child processes
  117. windows: no hierarchy, but parents get a handle
  118.  
  119.  
  120. Running-> ready-(>Running)
  121. |->blocked -|^
  122.  
  123. Process control block: entry in process table. contains all sorts of info about the process.
  124. Multiprogramming: interrupt, save PC and registers and stuff to memory, scheduling, loading the other process
  125.  
  126. Threads: multiple pseudoprocesses running in the same address space
  127.  
  128. Dispatcher thread: reads incoming requests
  129. Worker threads: process requests
  130.  
  131. Threads, single-thread, fsm
  132.  
  133. Per-thread items: PC, reg, stack, state
  134. thread_exit exits
  135. thread_yield yields cpu time to another thread
  136.  
  137. User-space threads:
  138. Each process gets thread table, scheduler. Allows each process a custom scheduling alg.
  139. But blocking system calls are a problem.
  140. -Code placed around system call for blocking-checking: jacket/wrapper
  141. And threads may run forever (if a thread starts running and doesn't yield cpu to another)
  142.  
  143. Kernel threads:
  144. Single thread table
  145.  
  146. Hybrid:
  147. There are both.
  148.  
  149.  
  150.  
  151. CPU-bound vs IO-bound processes
  152.  
  153. When to make decision:
  154. New process created (run parent vs child)
  155. Exit (which other process to run)
  156. Process blocks (which other process to run)
  157. IO interrupt (continue current vs resume the process that was waiting for the interrupt)
  158.  
  159. Nonpreemptive: pick a process, let it run until it blocks or releases.
  160. Preemptive: pick a process, let it run for some liminited amount of time, then send clock interrupt.
  161.  
  162. Scheduling goals:
  163. All - fairness, policy enforcement, balance
  164. Batch - throughput, turnaround time, cpu util
  165. Interactive: response time, proportionality
  166. RT: meeting deadlines, predictability
  167.  
  168. Algs:
  169. Batch:
  170. First-come, first-serve: queue. change during blocks.
  171. Shortest job first: minimizes turnaround time
  172. Shortest remaining time next: same but when a new job arrives, current job gets suspended if the new job has less time remaining
  173. Interactive:
  174. Round-robin: time
  175. * Time quantum is assigned
  176. * Process queue is processed
  177. * Each process stops after min(execution time, quantum), and next is loaded
  178. * At most (n-1)q waiting time
  179. Priority scheduilng:
  180. * Each process gets assigned priority
  181. * Highest/lowest priority process runs until block
  182. * Can suffer from indefinite blocking
  183. * Can be combined with RR by using RR to run same-priority processes until all but one exit
  184. Multilevel queue scheduling:
  185. * Different queue for each priority/some other criteria
  186. Multilevel feedback queue scheduling: process can be moved to another queue based on its burst times/some other criteria
  187. * number of queues
  188. * scheduling alg used for each queue
  189. * process upgrade method
  190. * process demotion method
  191. * queue-determining method for new processes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement