
Process Scheduling, Memory Management, and File Systems Review for Midterm 2
Covering process scheduling goals, algorithms, memory management concepts, virtual memory, page replacement algorithms, Belady's anomaly, file systems, directories, and file system implementations for an upcoming midterm exam in a computer science course.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
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 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
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
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
Page Replacement Algorithms FIFO (First-In-First-Out) NRU (Not-Recently-Used) Second Chance LRU (Least-Recently-Used) Clock Algorithm(s)
Files Naming Structure Types Access Attributes Operations
Directories Directory systems Path names Operations
File system implmentation Contiguous allocation Linked list allocation Linked list allocation with a table in memory I-nodes
UNIX V7 Directory Implementation The steps in looking up /usr/ast/mbox
Hard links vs. Symbolic links Inode 134 links=2 . 12 14 134 134 Hard link .. f1 f2 inode 134 . 12 14 134 208 .. f1 f2 special file /home/gong/f1 Symbolic link data
Sample Questions RR, Q = 10 0 P1: 4 36 8 112 1 P2: 23 40 2 13 P3: 4 20 112 40 2 40 2 40 1 16 P4: 2 150 3 10 1 20 Which process goes next, and when? Gantt chart P1 idle P2 P3 P4 0 4 13 23 27 29
Sample Questions MLFQ: Q0 = 8, Q1 = 16, Q2 = 40 0 P1: 4 36 8 112 1 P2: 23 40 2 15 q1 13 P3: 4 20 112 40 2 40 2 40 1 45 16 P4: 2 150 3 10 1 177 20 Gantt chart 1 idle 2 3 4 2 0 4 13 21 25 27
Sample Questions Page frame Time loaded Time referenced R bit M bit Which page frame will be replaced? First-In-First-Out (FIFO) Not-Recently-Used (NRU) Second Chance Least-Recently-Used (LRU) 0 60 161 0 1 1 130 160 0 0 2 26 162 1 0 3 20 163 1 1
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);
Sample Questions Assume file x content is: 0123456789876543210 fdrw = open("x", O_RDWR); fdrw2 = dup(fdrw); read(fdrw, buf, 3); read(fdrw2, buf2, 4);
Sample Questions Assume file x content is: 0123456789876543210 fdrw = open("x", O_RDWR); Fork(); Parent: read(fdrw, buf, 3); Child: read(fdrw, buf2, 4);