重庆大学操作系统复习提纲
回答下面问题:
a)虚拟地址158进行物理地址转换后是多少? b)虚拟地址53进行物理地址转换后是多少? c)虚拟地址195进行物理地址转换后是多少?
答案:
a)(158)10=(10011110)2 ,虚页号为100=4,通过 查页表可知有效位为0不在内存中,所以页面失效。
b)(53)10=(00110101)2,虚页号为001=1,通过查 页表可知页号为7,物理地址为(11110101)2 =245
Improve I/O performance
Buffering (缓冲机制) Caching Spooling Hardware technology
后面的内容仅作为能力测试, 与考试内容没有必然联系,请
不要过度解读。
考虑这样一个系统,该系统用3位表示页面编号,用5位表示 偏移量。在该系统中内存以字节为单位进行存取。现在假设 一个进程有6页,其页表如下:
occurs.
Exit: A process that has been released from the pool of
executable processes by the OS.
Processor management
Modes of Process Execution
User mode System mode process switching——When to Switch Process
File Attributes File Operations Access Methods
Sequential Access Direct Access Indexed Access
Directory Structures
Single-level directory (单层目录) Two-level directory (双层目录) Tree-structured directory (树型结构目录) ……
复习提纲
Processor management Memory management I/O and File system
Processor management
Program execution Modal
Serial execution Concurrent execution
been admitted to the pool of executable processes by the OS.
Ready: A process that is prepared to execute when given the
opportunity.
Running: The process that is currently being executed. Waiting : A process that cannot execute until some event
Device-driver
File system and I/O
I/O scheduling
Improve overall system performance Share device access fairly among processes Reduce the average waiting time for I/O to complete
设某文件为链接文件,由5个逻辑记录组成, 每个逻辑记录的大小与磁盘块大小相等,
均为512字节,并以ቤተ መጻሕፍቲ ባይዱ存放在50、121、75、 80、63号磁盘块上。若要存取文件的第 1569逻辑字节处的信息,请问要访问哪一 个磁盘块?
因为1569=512*3+33,所以要访问的字节为第4 个逻辑记录,对应的物理磁盘块号为80。故应访 问第80个磁盘块。
Real-Time Scheduling
Processor management
Mutual Exclusion and Synchronization
critical resource(临界资源): nonsharable resource. Critical section(临界区): program to access critical
Peterson’s Solution LOCK LOCK
disable interrupt enable interrupt
Semaphores
Wait Signal
Monitors Message Passing
Processor management
Deadlock
Optimal policy (OPT) Least Recently Used (LRU) First-in, first-out (FIFO) Least frequently used (LFU) Most frequently used (MFU)
Memory management
Conditions for Deadlock Resource-Allocation Graph Deadlock Prevention Deadlock Avoidance
safe state, unsafe state Banker’s algorithm
Deadlock Detection
Relocation Protection Sharing Address Mapping
Memory management
Memory Partitioning
Fixed Partitioning
Placement Algorithm
Dynamic Partitioning
…… Free Space Management
Bit vector Linked list ……
File system and I/O
Disk Structure
Disk Performance Parameters
Disk Scheduling
First Come First Served(FIFO) Shortest Seek Time First(SSTF) SCAN C-SCAN Look C-Look ……
Placement Algorithm
Best-fit algorithm First-fit algorithm Next-fit
Buddy System
Memory management
Paging
Frames, Pages Page Table, Free Frame Table TLB, multi-level page tables, Hashed Page Tables Inverted Page Table Effective Access Time (有效访问时间) Segmentation
Segment Tables
Combine segmentation and paging Address Translation
Memory management
Fetch Policy
Demand paging Prepaging Copy-on-Write
Replacement Algorithms
File system and I/O
Logical block, Physical block File control block (FCB) Layered File System
I/O control Basic file system File-organization module Logical file system
File system and I/O
I/O Design Objectives
Efficiency Generality
I / O controller
Polling (轮询方式) Interrupts (中断方式) Direct Memory Access (DMA方式)
resource Critical-Section Problem
Mutual Exclusion (互斥) Progress (空闲让进) Bounded Waiting (有限等待)
Processor management
Mutual Exclusion and Synchronization
其次,寻找指令中虚地址2500的内存地址。将2500转化 为页号p和页内相对地址w。因为页面长度为1K, 2500=1024*2+452,所以p=2,w=452。由查页表可知, 第2页对应的页面号为4。因此2500的内存地址为 4*1024+452=4548。 最后CPU从4548中取数据放入1号寄 存器。
Allocation of Frames
fixed allocation priority allocation Frame Locking
Thrashing
Resident Set
Working Set
Belady's anomaly (Belady的异常)
File system and I/O
Deadlock Detection Algorithm
Starvation
Memory management
Main Memory Management
Memory Partitioning Partition Management
Virtual Memory
Locality and Virtual Memory Used Policy