Computer Science 330
Operating Systems
Fall 2025, Siena University
Lecture 0x0f: Exam 2 Info; Virtual Memory; Lab/Project Time
Date: Friday, November 7, 2025
Agenda
- Announcements
- The next readings/activities from OS zyBook
- Chapter 16, Sections 4-5, due Monday before class
- Programming Project 4: Basic Shell [HTML] [PDF] due Monday night
- FreeBSD changes to readline
- Lab 7: Interprocess Communication [HTML] [PDF] due Wednesday night
- Programming Project 5: Roger Bacon Shell with Pipes and
Redirection [HTML] [PDF] parsing functionality due in 2 weeks
- Exam 2 information
- In class, Monday, November 17
- Same ground rules as Exam 1
- Accounts for 10% of course grade
- Topics are from Chapters 9, 12, 14 and 16 of OS zyBook, Labs 3, 4,
5, 6, Programming Projects 3 and 4
- Practice problems out, we can spend some time on these in
class next Friday, please look at them by then
- Demand paging
- only bring in pages that are actually requested
- when a page is referenced that is not in memory -
generate a page fault
- page fault traps to OS, bring in the page
- allows a mechanism for virtual memory
- if a page fault occurs and no free frame is available, we
need to make one - send a frame (the victim) back to disk
- performance will depend on the page fault rate
- low page fault rate results in reasonably low effective
access times, high page fault rates will make effective access
times very high
- locality of reference will make for a reasonably good
effective access time in most circumstances
- Page replacement algorithms
- Least Recently Used (LRU)
- select the page that we have not used for the
longest time
- actually used in practice
- direct implementation may involve timestamps or a
stack of page references
- may be too expensive to implement directly
- LRU approximation algorithms
- Second-chance or Clock Algorithm uses one reference
bit and a clock pointer, treating the frames of memory as
a circular array
- Gold's Clock Algorithm/third-chance also considers a
"dirty" bit to try to avoid selecing pages that need to be
written back to disk because they are more expensive
- Counting algorithms
- Least-frequently used (LFU)
- Most-frequently used (MFU)
- not obvious why or when these are useful - something
to think about
- direct implementations may suffer from same overhead
costs as a direct implementation of LRU
- Looking at the exercises for OS zyBook Chapter 16, Sections 1-3
- 16.1.1, 16.1.2, 16.1.3, 16.1.4, 16.1.5
- 16.2.1, 16.2.2, 16.2.3, 16.2.4
- 16.3.1, 16.3.2
- Lab/Project time
Terminology
- virtual memory
- demand paging
- present bit
- page fault
- page replacement
- modified bit
- reference string
- optimal page replacement
- FIFO page replacement
- LRU page replacement
- referenced bit
- aging register
- aging page replacement
- second chance page replacement
- third chance/not recently used page replacement