《unix操作系统设计》英文版习题答案1
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
S.1
Uni x Internals (Apri l/May-2012, Set-1) JNTU-Anantapur
B.T ech. III-Year II-Sem.( JNTU-Anantapur)
Code No.: 9A05602/R09
B.Tech. III Year II Semester Regular Examinations
April/May - 2012UNIX INTERNALS
( Computer Science and Engineering )
Time: 3 Hours
Max. Marks: 70
Answer any FIVE Questions All Questions carry equal marks
- - -1.
(a)Draw and explain the architecture of UNIX systems. (Unit-I, Topic No. 1.5.1)(b)Discuss in detail the sleep and wakeup procedures. (Unit-V, Topic No. 5.6)
2.
(a)
If several processes contend for a buffer, the kernel guarantees that none of them sleep forever, but it does not guarantee that a process will not be starved out from use of a buffer. Redesign getblk so that a process is guaranteed eventual use of a buffer. (Unit-II, Topic No. 2.2)(b)What are the advantages of buffer cache? (Unit-II, Topic No. 2.5)
3.
(a)Give brief description about the accessing of inodes. (Unit-III, Topic No. 3.1)(b)Explain in detail the continuous file allocation system. (Unit-III, Topic No. 3.7)
4.
(a)What is the purpose of link system call? Write and explain the algorithm for the same. (Unit-IV, Topic No. 4.12)(b)Write short notes on maintenance of the file system. (Unit-IV, Topic No. 4.15)5.
(a)What are regions? Explain their role in the creation of processes. (Unit-V, Topic No. 5.2)(b)Describe in detail about the context of a process. (Unit-V, Topic No. 5.3)
6.
(a)Explain the security problems that exists if a setuid program is not write protected. (Unit-VI, Topic No. 6.6)(b)Write a program that a parent and child shares a file access. (Unit-VI, Topic No. 6.1)7.
(a)Discuss in detail about the scheduling parameters. (Unit-VII, Topic No. 7.1)(b)What is profiling? Explain it in detail. (Unit-VII, Topic No. 7.3)8.
(a)Explain clists in detail. (Unit-VIII, Topic No. 8.3)
(b)
Write a program for reading data from risk by using block and raw interfaces.
(Unit-VIII, Topic No. 8.3)
S.2
Spectrum ALL-IN-ONE Journal for Engineering Students, 2013
B.T ech. III-Year II-Sem.( JNTU-Anantapur)
(a)
Draw and explain the architecture of UNIX systems.
Answer :April/May-12, Set-1, Q1(a)
For answer refer Unit-I, Q10.
(b)Discuss in detail the sleep and wakeup
procedures.
Answer :April/May-12, Set-1, Q1(b)
For answer refer Unit-V , Q17.
(a)If several processes contend for a buffer,
the kernel guarantees that none of them sleep forever, but it does not guarantee that a process will not be starved out from use of a buffer. Redesign getblk so that a process is guaranteed eventual use of a buffer.
Answer :April/May-12, Set-1, Q2(a)
Algorithm getblk
Input: file system number
block number
Output: locked buffer that can now be used for block {
While (buffer not found)
{
If (block is not in hash queue)
If (there are no buffers on free list){
sleep (event any buffer becomes free);continue;
}}}}
(b)What are the advantages of buffer
cache?
Answer :April/May-12, Set-1, Q2(b)
For answer refer Unit-II, Q12, Topic: Advantages of Buffer Cache.
(b)Explain in detail the continuous file allocation system.
Answer :
April/May-12, Set-1, Q3(b)
Note: In given question, the word contiguous is misprinted as continous.
In a contiguous allocation method all the files are arranged in a sequential blocks of memory. Therefore,according to this technique, if a file size is k blocks and it starts from a block s then it spans till stk-1 block numbers.With this approach file access is much faster as all files occupy contiguous blocks. For sequential access of files the physical address of the last referred block is noted, so that file access can start from the next block to avoid repeated accesse of the previous blocks. Direct access is also supported since only the starting address and the block numbers are required.
Though access time is minimal, contiguous allocation does not make efficient use of the disk space. This means that the allocation of space for a new file should be efficient enough so that disk space is not wasted.
0123456
7
891011IMP 121314
15
16171819USER 2021222324252627CHAT
28293031DISK
FOO Directory
Filename Starting location
Size Foo Imp User Chat
0614263764