(2021年整理)期末复习题_第1页
(2021年整理)期末复习题_第2页
(2021年整理)期末复习题_第3页
(2021年整理)期末复习题_第4页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、期末复习题期末复习题 编辑整理:尊敬的读者朋友们:这里是精品文档编辑中心,本文档内容是由我和我的同事精心编辑整理后发布的,发布之前我们对文中内容进行仔细校对,但是难免会有疏漏的地方,但是任然希望(期末复习题)的内容能够给您的工作和学习带来便利。同时也真诚的希望收到您的建议和反馈,这将是我们进步的源泉,前进的动力。本文可编辑可修改,如果觉得对您有帮助请收藏以便随时查阅,最后祝您生活愉快 业绩进步,以下为期末复习题的全部内容。1 processes p1, p2, and p3 ,define semaphores, and synchronize the execution of p1, p2,

2、 and p3 by wait() and signal() on these semaphores.2 draw three gantt charts,what is the turnaround time of each process for sjf, and rrwhat are the average waiting time and the average turnaround time3 consider the following pagereference string:(1) lru page replacement(2) optimal page replacement

3、(3) fifo replacement algorithmpage fault times,page faults rate4 (1) is the system in a safe or unsafe state? why?(2) if pi request resource of (0, 1, 0, 0), can resources be allocated to it? why?in a demand paging system, the page size is 1k bytes, and the page table is as follows(assuming use deci

4、mal values), translate a logical address 10 into its corresponding physical address, and why? frame21 6 a8202 b4106 c2058 d1034in a demand paging system, the page size is 1024 bytes, and the page table is as follows, would the following virtual addresses (assuming use decimal values) result in a pag

5、e fault? and why? valid/invalid# framei20v15v20v29i80i53(1) 2500(2) 5100 page table(1) 2500=2*1024+452 page 2 is valid, so no page fault(2) 5100=41024+1004 page 4 is invalid, a page fault occursconsider a simple paging system with a page table containing 1024 entries of 14 bits (including one valid/

6、invalid bit) each, and a page size of 1024 bytes (5 points)(a) how many bits are in the logical address?(b) how many bits are in the physical address?(c) what is the size of the logical address space?(d) how many bits in the logical address specify the page number?(e) how many bits in the physical a

7、ddress specify the offset within the frame?1) 202) 233) 220b4) 105) 10(a) there are 10+10=20 bits in the logical address (b) there are 13+10=23 bits in the physical address(c) the size of the logical address space is 220 bytes(d) there are 10 bits in the logical address specifying the page number(e)

8、 there are 10 bits in the physical address specifying the offset within the frameconsider a system using segmentation with paging management scheme, whose physical memory is of 235 bytes. the logical address space consists of up to 8 segments。 each segment can be up to 213 pages, and page size of 51

9、2 bytes, (1) how many bits in the logical address specify the page number?(2) how many bits are there in the entire logical address? (3) what is the size of a frame? (4) how many bits in the physical address specify the frame number?(5) how many bits in the physical address specify the frame offset?

10、(6) how many entries are there in the page table for each segmentation, i。e。 how long is the page table for each segmentation?(1) each segment consists of up to 213 pages, so log2(213) = 13 bits in the logical address specify the page number(2) the entire logical address consists of segmentation and

11、 offset in segmentation, and offset in segmentation is divided into page number and page offset, so entire logical address has log2 (8) + log2(213) + log2 (512) = 3 + 13 +9 =25 bits(3) the size of a frame is equal to that of a page, i。e., 512 bytes(4) the total size of physical memory is 235 bytes,

12、and each frame is 29 = 512 bytes, so there are 26 = (35 9) bits in the physical address specify the frame number(5) the number of bits in the physical address specifying the frame offset depends on the size of the frame, so log2 (29) = 9 bits in the physical address specify the frame offset(6) each

13、entry in the page table corresponds to a page in the segment, each segment can be up to 213 pages, so there are 213 entries in the page table for each segment. a file system uses 256byte physical blocks。 each file has a directory entry giving the file name, location of the first block, length of fil

14、e, and last block position. assuming the last physical block read is 100, block 100 and the directory entry are already in main memory。 for the following two file allocation algorithms, how many physical blocks must be read to access the specific block 600 (including the reading of block 600 itself)

15、, and why? (1) contiguous allocation(2) linked allocation(1) 1 contiguous allocation supports direct access on arbitrtary physical blocks in a file。 to access physical block 600, the bolck 600 can be directory read into memory。(2) 500linked allocation is used only for sequentialaccess files, file sy

16、stem can only read blocks one by one, directed by file pointers。to find the phyical block 600 in the file, file system locates on the 101th block following the 100th block just read, and reads block 101, block 102, , until block 600。consider a file system in which a directory entry can store up to 3

17、2 disk block addresses。 for the files that is not larger than 32 blocks, the 32 addresses in the entry serves as the files index table。 for the files that is larger than 32 blocks, each of the 32 addresses points to an indirect block that in turn points to 512 file blocks on the disk, and the size o

18、f a block is 512bytes. what is the largest size of a file? 32 x 512 =16384 file blocks 16384 x 512 = 8388608 bytesor 25 x 29 x 29 = 223 bytes in the file system on a disk with physical block sizes of 512 bytes, a file is made up of 128byte logical records, and each logical record cannot be separatel

19、y stored in two different blocks。 the disk space of the file is organized on the basis of indexed allocation, and a block address is stored in 4 bytes。 suppose that 2-level index blocks be used to manage the data blocks of the file, answer the following questions:1) what is the largest size of the f

20、ile? 2) given 2000, the number of a logical record in the file, how to find out the physical address of the record 2000 in accordance with the 2level index blocks.1)512/4=128128*128*512=12864 kb=8192kbor =223 bytes = 8 mb or = 83886802)512/128=42000/4=500in 3 block in the first level index blockin 1

21、16 block in the secondlevel index blocka file is made up of 128-byte fix-sized logical records and stored on the disk in the unit of the block that is of 1024 bytes。 the size of the file is 10240 bytes。 physical i/o operations transfer data on the disk into an os buffer in main memory, in terms of 1024-byte block. if a process issues read requests to read the files records in the sequent

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论