1 / 20

Lecture 35: Review for Midterm 2

Lecture 35: Review for Midterm 2. About Midterm 2. Cover scheduling, memory management, and file systems. A double-side A4 or US letter sheet of note is allowed 50 minutes. Overview. Process Scheduling Memory Management File System. Process scheduling.

phillipsb
Download Presentation

Lecture 35: Review for Midterm 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 35: Review for Midterm 2

  2. About Midterm 2 • Cover scheduling, memory management, and file systems. • A double-side A4 or US letter sheet of note is allowed • 50 minutes

  3. Overview • Process Scheduling • Memory Management • File System

  4. Process scheduling • What are the goals of process scheduling? • Scheduling Algorithms for Batch Systems • First come first serve • Shortest job first • Shortest remaining time next • Scheduling Algorithms for Interactive Systems • Round-Robin scheduling • Priority scheduling • Multiple queues • Lottery scheduling

  5. Memory management • Memory allocation • A new process comes into memory • Memory de-allocation • A process leaves memory • Address translation • Virtual address to physical address • Process isolation • One process cannot access the memory of other processes

  6. Virtual memory • Paging • Address translation via page table • MMU • Page fault • Speed up address translation • TLB • Large page tables • Multi-level page table • Inverted page table

  7. Page Replacement Algorithms • FIFO (First-In-First-Out) • NRU (Not-Recently-Used) • Second Chance • LRU (Least-Recently-Used) • Clock Algorithm(s)

  8. Belady's anomaly

  9. Files • Naming • Structure • Types • Access • Attributes • Operations

  10. Directories • Directory systems • Path names • Operations

  11. File system implmentation • Contiguous allocation • Linked list allocation • Linked list allocation with a table in memory • I-nodes

  12. UNIX V7 Directory Implementation The steps in looking up /usr/ast/mbox

  13. Hard links vs. Symbolic links Inode 134 Hard link inode 134 Symbolic link

  14. Sample Questions

  15. Sample QuestionsRR, Q = 10 0 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Which process goes next, and when? Gantt chart P1 idle P2 P3 P4 0 4 13 23 27 29

  16. Sample QuestionsMLFQ: Q0 = 8, Q1 = 16, Q2 =  40 q1 45 177 0 13 16 20 P1: 4 36 8 112 1 P2: 23 40 2 15 P3: 4 20 112 40 2 40 2 40 1 P4: 2 150 3 10 1 Gantt chart 1 idle 2 3 4 2 0 4 13 21 25 27

  17. Sample Questions Which page frame will be replaced? First-In-First-Out (FIFO) Not-Recently-Used (NRU) Second Chance Least-Recently-Used (LRU)

  18. Sample Questions Assume file “x” content is: 0123456789876543210 fdrw = open("x", O_RDWR); fdr = open("x", O_RDONLY); read(fdrw, buf, 3); read(fdr, buf2, 4);

  19. Sample Questions Assume file “x” content is: 0123456789876543210 fdrw = open("x", O_RDWR); fdrw2 = dup(fdrw); read(fdrw, buf, 3); read(fdrw2, buf2, 4);

  20. Sample Questions Assume file “x” content is: 0123456789876543210 fdrw = open("x", O_RDWR); Fork(); Parent: read(fdrw, buf, 3); Child: read(fdrw, buf2, 4);

More Related