Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Which subsection to read:
- 1.3 COMPUTER HARDWARE REVIEW
- 1.3.1 Processors
- 1.3.2 Memory
- 1.3.3 Disks
- 1.3.4 I/O Devices
- 1.3.5 Buses
- 1.5 OPERATING SYSTEM CONCEPTS 38
- 1.5.1 Processes
- 1.5.2 Address Spaces
- 1.5.3 Files
- 1.5.4 Input/Output
- 1.5.5 Protection
- 1.7 OPERATING SYSTEM STRUCTURE
- 1.7.1 Monolithic Systems
- 1.7.2 Layered Systems
- 1.7.3 Microkernels
- 1.7.4 Client-Server Model
- 2.1 PROCESSES
- 2.1.1 The Process Model
- 2.1.2 Process Creation
- 2.1.3 Process Termination
- 2.1.4 Process Hierarchies
- 2.1.5 Process States
- 2.1.6 Implementation of Processes
- 2.2 THREADS
- 2.2.1 Thread Usage
- 2.2.2 The Classical Thread Model
- 2.2.4 Implementing Threads in User Space
- 2.2.5 Implementing Threads in the Kernel
- 2.2.6 Hybrid Implementations
- 2.4 SCHEDULING
- 2.4.1 Introduction to Scheduling
- 2.4.2 Scheduling in Batch Systems
- 2.4.3 Scheduling in Interactive Systems
- 2.4.4 Scheduling in Real-Time Systems
- Processors:
- PC reg: next instructino address
- Stack pointer reg: top of the current stack
- Program Status Word
- TRAP: switch to kernel mode
- Three-stage pipleine: fetch u->decode u->execute u
- Superscalar cpu: 2x(fetch->decode)->(Holding buffer)->3execute u
- Mem:
- Register 1kb 1nsec<cache 4mb 2nsec<mem 10nsec<disk 10msec
- 1 Cache line = 64 bytes
- L1, L2. Intel: L2 shared across cores. AMD: not shared.
- EEPROM, FLASH - non-volatile, slow
- CMOS - long-lasting volatile
- Disk:
- circles - tracks
- circle cylinder - cylinder
- 512 bytes per sector on track
- moving to another track 1microsec
- virtual memory mapping done by memory management unit
- IO:
- controller, device
- device driver
- IO port space: collection of all device registers
- 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.
- interupt based: same, but instead of hanging the kernel returns the control to the caller and waits for the interrupt
- -interrupt vector: part of the memory with interrupt handler addresses for each device
- DMA: CPU sets up the DMA which then runs on its own, and sends an interrupt when it's done
- Buses:
- they bus. serial, parallel, whatevz
- 1.4 is described by the names
- mainframe ops: transaction processing, batch, timesharing
- Process: address space/core image + process table entry
- signals: basically software interrupts
- arocess table
- Files:
- File descriptor: int returned by system when a process opens a file, to be used in subsequent operations as a proof of permissions
- Speical files: block, character types
- rwx: (owner)(members of owner's groups)(everyone else)
- Monolithic: entire OS is a single program in kernel mode
- Procedures: main, service, utility
- Layered: OS loaded in layers, each dedicated to some functionality
- Microkernel: small kernel, modular OS parts.
- MINIX: OS (clock, sys) > (Drivers > Servers > Userland)
- mechanism, not policy in microkernel
- pseudoparallelism: making a single core act like multiple cores
- Rapid switching back and forth: multiprogramming
- Process creation reasons:
- 1. System init
- 2. Execution of process-creation syscall by a running process
- 3. User request to create a new process
- 4. Batch job init
- linux: fork, execve. windows: CreateProcess
- Termination reasons:
- Normal exit, error exit, fatal error, killed
- hierarchy:
- unix: parent and child processes
- windows: no hierarchy, but parents get a handle
- Running-> ready-(>Running)
- |->blocked -|^
- Process control block: entry in process table. contains all sorts of info about the process.
- Multiprogramming: interrupt, save PC and registers and stuff to memory, scheduling, loading the other process
- Threads: multiple pseudoprocesses running in the same address space
- Dispatcher thread: reads incoming requests
- Worker threads: process requests
- Threads, single-thread, fsm
- Per-thread items: PC, reg, stack, state
- thread_exit exits
- thread_yield yields cpu time to another thread
- User-space threads:
- Each process gets thread table, scheduler. Allows each process a custom scheduling alg.
- But blocking system calls are a problem.
- -Code placed around system call for blocking-checking: jacket/wrapper
- And threads may run forever (if a thread starts running and doesn't yield cpu to another)
- Kernel threads:
- Single thread table
- Hybrid:
- There are both.
- CPU-bound vs IO-bound processes
- When to make decision:
- New process created (run parent vs child)
- Exit (which other process to run)
- Process blocks (which other process to run)
- IO interrupt (continue current vs resume the process that was waiting for the interrupt)
- Nonpreemptive: pick a process, let it run until it blocks or releases.
- Preemptive: pick a process, let it run for some liminited amount of time, then send clock interrupt.
- Scheduling goals:
- All - fairness, policy enforcement, balance
- Batch - throughput, turnaround time, cpu util
- Interactive: response time, proportionality
- RT: meeting deadlines, predictability
- Algs:
- Batch:
- First-come, first-serve: queue. change during blocks.
- Shortest job first: minimizes turnaround time
- Shortest remaining time next: same but when a new job arrives, current job gets suspended if the new job has less time remaining
- Interactive:
- Round-robin: time
- * Time quantum is assigned
- * Process queue is processed
- * Each process stops after min(execution time, quantum), and next is loaded
- * At most (n-1)q waiting time
- Priority scheduilng:
- * Each process gets assigned priority
- * Highest/lowest priority process runs until block
- * Can suffer from indefinite blocking
- * Can be combined with RR by using RR to run same-priority processes until all but one exit
- Multilevel queue scheduling:
- * Different queue for each priority/some other criteria
- Multilevel feedback queue scheduling: process can be moved to another queue based on its burst times/some other criteria
- * number of queues
- * scheduling alg used for each queue
- * process upgrade method
- * process demotion method
- * queue-determining method for new processes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement