babu madhav institute of information technology,...

28
Page 1 of 28 Mr. Hardik Vyas, Mr. Krunal Sukhwani Babu Madhav Institute of Information Technology, UTU - 2016 5 Years Integrated M.Sc.(IT) Semester 6 Question Bank 060010601 UNIX Internals Unit 1: Introduction and Overview of UNIX Answer following in short 1. What is system call? 2. Who are principal designer of UNIX operating system? 3. Write any two points to differentiate between multitasking & multiprogramming. 4. What is kernel in UNIX operating system? 5. List any four features of UNIX system. 6. List the four major system calls used for file system management. 7. Name the data structures used for file system management. 8. Name the data structures used for process management. 9. Write one difference between system call and library function. 10. Write one difference between system call and API. 11. Draw architecture diagram of UNIX operating system. 12. Give any four characteristics of UNIX file system. 13. List any two services of operating system. 14. Draw block diagram of system kernel. 15. What are the responsibilities of file subsystem of UNIX kernel? 16. Justify: "Using large logical blocks increases the effective data transfer rate between disk and memory" 17. State the purpose of boot block. 18. What were the goals of Multics System? 19. List out the levels in which UNIX system architecture is divided. 20. Which system calls are used by the process to interact with file subsystem? 21. What are device drivers? 22. What are Block I/O devices and Raw I/O devices? 23. What is process? 24. What are the responsibilities of process control subsystem of UNIX operating system? 25. List out the system calls used for controlling the processes. 26. What is swapper process? 27. What is the significance of inode? 28. What are file table and user file descriptor table? 29. What is logical device number? 30. List out various structures of file system. 31. What is the importance of Boot block structure of file system? 32. What does the super block describes? 33. What is the use of root inode of file system? 34. What is PID? 35. What is the Process 0? 36. When does Process 0 become swapper process? 37. List out the regions of the process loaded in the memory by the kernel. Also provide their significance. 38. What is u area? 39. What is context of a process? 40. When does a process put itself in sleeping state? 41. When the kernel allows context switching? 42. What is the significance of Kernel Data Structures? Long Questions

Upload: doanngoc

Post on 21-May-2018

346 views

Category:

Documents


3 download

TRANSCRIPT

Page 1 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

5 Years Integrated M.Sc.(IT) – Semester 6 Question Bank

060010601 – UNIX Internals Unit 1: Introduction and Overview of UNIX

Answer following in short

1. What is system call?

2. Who are principal designer of UNIX operating system?

3. Write any two points to differentiate between multitasking & multiprogramming.

4. What is kernel in UNIX operating system?

5. List any four features of UNIX system.

6. List the four major system calls used for file system management.

7. Name the data structures used for file system management.

8. Name the data structures used for process management.

9. Write one difference between system call and library function.

10. Write one difference between system call and API.

11. Draw architecture diagram of UNIX operating system.

12. Give any four characteristics of UNIX file system.

13. List any two services of operating system.

14. Draw block diagram of system kernel.

15. What are the responsibilities of file subsystem of UNIX kernel?

16. Justify: "Using large logical blocks increases the effective data transfer rate between disk and memory"

17. State the purpose of boot block.

18. What were the goals of Multics System?

19. List out the levels in which UNIX system architecture is divided.

20. Which system calls are used by the process to interact with file subsystem?

21. What are device drivers?

22. What are Block I/O devices and Raw I/O devices?

23. What is process?

24. What are the responsibilities of process control subsystem of UNIX operating system?

25. List out the system calls used for controlling the processes.

26. What is swapper process?

27. What is the significance of inode?

28. What are file table and user file descriptor table?

29. What is logical device number?

30. List out various structures of file system.

31. What is the importance of Boot block structure of file system?

32. What does the super block describes?

33. What is the use of root inode of file system?

34. What is PID?

35. What is the Process 0?

36. When does Process 0 become swapper process?

37. List out the regions of the process loaded in the memory by the kernel. Also provide their significance.

38. What is u area?

39. What is context of a process?

40. When does a process put itself in sleeping state?

41. When the kernel allows context switching?

42. What is the significance of Kernel Data Structures?

Long Questions

Page 2 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

1. Explain features of UNIX system.

2. Operating systems like UNIX provides services both for program and user. Explain.

3. Explain in detail about UNIX system architecture.

4. Describe the block diagram of system kernel.

5. Write a note on UNIX phenomena the file system has "places" and that processes have "life."

6. Why there are two different mechanisms for accessing hardware control and file subsystem?

7. Describe fie system structure in UNIX operating system.

Multiple Choice Questions

1. Which of the following is known as the core component of the UNIX operating system?

a. System call

b. Editor

c. Hardware

d. Kernel

2. Which of the following system call change the permission of the file?

a. Chown

b. Chmod

c. Stat

d. Exec

3. Fork system call is used for

a. To divide the process.

b. To execute the process

c. To create the process.

d. To finish execution of process.

4. Which of the following allocates CPU to the process?

a. Scheduler module

b. Fork system call

c. Swapper process

d. Exec system call

5. Which of the following can directly interact with the hardware?

a. User

b. Shell

c. kernel

d. System call

6. Kernel data structure which is allocated per process is

a. Inode table

b. File table

c. Index node

d. User file descriptor table

7. Which block of file system starts at the end of inode list and contains file data and administrative data?

a. Data block

b. Boot block

c. Super block

d. Inode list

8. Which of the following process data structure contains a per process region table, whose entries point to

entries in a region table?

a. User area

b. Process table

c. Region table

d. u area

Page 3 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

9. Which one among the below translate UNIX commands into action?

a) Shell b) Kernel c) Command Interpreter d) System call

10. Which one among the below interacts between user and kernel?

a) Shell b) Kernel c) Both a) and b) d) System call

11. Which one among below directly interacts with the hardware?

a) Shell b) Kernel c) Compiler d) Both b) and c)

12. Which one among below is false with respect to UNIX operating system?

a) UNIX considered each and every thing as a file.

b) Kernel deals directly with user.

c) File and process are two basic entities that support UNIX system.

d) Several user can use the system simultaneously.

13. Majority part of UNIX operating system is written using

a) Assembly language b) C language c) Java language d) C++ language

14. Who is main contributor for development of Linux?

a) Ken Thomson b) Linux Smith c) Linus Torvalds d) Dennis Richi

15. Which among the below given is not the reason for success of the UNIX system?

a) System is written in high –level language

b) It does not use hierarchical file system.

c) It has not a complex user interface.

d) It is a multiuser, multiprocessing system

16. What among the below can be considered as core of the system?

a) Kernel b) Shell c) Operating system d) None of the given

17. Which component among the below translate commands into action in UNIX operating system?

a) Shell b) Kernel c) Command Interpreter d) System call

18. Which component interacts between user and kernel?

a) Shell b) Kernel c) Command Interpreter d) System call

19. Under what circumstances the kernel provide context switch?

a) When a process puts itself to sleep.

b) When it exits.

c) When it returns from a system call user mode but not a eligible process to run.

d) All of the above.

20. Choose the correct one for the statement: All UNIX flavours have one thing in common.

a) They uses the same system call

b) They share the same kernel

c) All UNIX flavour must use same shell

d) All system call are based on underlying hardware structure.

21. Where does the system call build up?

a) Kernel b) Shell c) Command interpreter d) Application program

22. What are ed and vi?

a. Editor

b. Kernel

c. System Call

d. none

Fill in the blanks:

1. ________ & __________ have developed UNIX operating system at AT&T Bell laboratory.

2. The set of ___________ and the internal algorithms form the body of the kernel.

3. The execution of user process on UNIX systems is divided into ________ and ________ levels.

4. _________ System call is use to change the owner of the file.

5. Raw I/O devices are also called _________ I/O devices.

Page 4 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

6. ________ System call overlay the image of program onto the running process.

7. Internally files are represented with the help of ________.

8. ________ is the global kernel data structure of file system.

9. The conversion between file system address and disk address is done by ______________.

10. The process that invoked the fork system call is the __________, and the newly created process is the __________

11. Process 1 is also known as _________

12. A special register called ________ indicates the current stack depth.

13. _________ is a directed graph whose nodes represent the states a process can enter and whose edges

represent the events that cause a process to move from one state to another.

Unit 2: Buffer Cache

Answer following in short

1. What do you mean by throughput of the system?

2. What do you mean by block in UNIX operating system?

3. What is the purpose of buffer cache?

4. Which are two parts of buffer?

5. Justify “The buffer is the in-memory copy of the disk block”.

6. Why a disk block can never map into more than one buffer at a time?

7. How does kernel searches for buffer in the buffer cache?

8. What are the values for the status of buffer?

9. What do you mean by delayed write?

10. What do you mean by buffer status busy?

11. Name the mechanism used for managing free list of buffers.

12. To search effectively, how kernel manages buffers? (which data structure used to manage buffers so that

search become effective?)

13. Name algorithm used for buffer allocation.

14. What is the purpose of brelse algorithm?

15. Give one point of difference between bread and breada algorithm.

16. List any two advantages of buffer cache.

17. List any one disadvantages of buffer cache.

18. Why kernel always allocate buffers from the head of the list?

19. What is Buffer?

20. What is Buffer cache?

21. Why does kernel need the buffer cache?

22. What is buffer header contains?

23. When the kernel loses control over a buffer?

24. What is the difference between delayed write and asynchronous write?

25. During which of the asynchronous I/O operations the kernel can invoke block release algorithm from an

interrupt handler.

Long Questions

1. Explain conditions that describe status of the buffer.

2. Explain the structure of Buffer pool.

3. Describes the scenarios followed by kernel in getblk to allocate a buffer for disk block.

4. Explain getblk algorithm.

5. Explain algorithm for releasing a buffer.

6. Write a note of algorithm for reading from the disk block.

Page 5 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

7. Explain algorithm for writing a disk block.

8. Write a note on pros and cons of buffer cache.

9. Describe the structure of buffer pool.

10. How does free buffers are maintained by kernel in buffer cache?

11. Explain the scenarios of buffer retrieval in case of buffer found on the hash queue.

12. Explain the buffer retrieval scenarios in case of buffer not in hash.

13. Explain race condition in buffer retrieval.

14. Write a note on advantage and disadvantages of buffer cache.

15. Why size of buffer’s data area must be at-least as big as size of disk block?

16. What is delayed write? Explain in detail.

17. Explain algorithm to release a buffer.

18. Explain breada algorithm. How it is differs from bread.

Multiple Choice Questions

1. Which of the following list of buffers is maintained by the kernel to preserve least recently used order

of buffers?

a. Busy list

b. Locked list

c. Free list

d. Delay list

2. The free list is maintain as

a. Doubly Linked List

b. Circular Linked List

c. Doubly linked circular list

d. Singly linked list

3. During which of the write operation, kernel starts the disk operation immediately but does not wait for

its completion.

a. Delayed write

b. Synchronous write

c. Asynchronous write

d. None

4. To increase the response time and throughput, the kernel minimizes the frequency of disk access by

keeping a pool of internal data buffer called

a. Pooling

b. Spooling

c. Buffer cache

d. Swapping

5. Buffer cache helps to

a. Store data

b. Improved read/write performance

c. Allocate memory

d. None of the above

6. Which of the following is not the field of buffer header?

a. device number

b. block number

c. status

d. size

7. How does free list of buffers are maintained?

a. Using link list

b. maintaining free list of array

Page 6 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

c. doubly link list

d. doubly link list with least recently used mechanism

8. Which of the following is used to search buffer of disk block in buffer pool?

a. device number and inode number

b. block number and inode number

c. device number and status

d. device number and block number

9. When kernel retrieves block, its buffer is found in hash queue and is free, which of the following

sequence occurs (multiple choice)

a. the buffer removed from hash queue

b. the buffer marked as busy

c. the buffer removed from the free list

d. the buffer added into hash queue

10. When kernel retrieves block, its buffer is not available in hash queue, which of the following sequence

occurred

a. Process waits for buffer is available in hash queue

b. A free block is allocated from the head of free list

c. A free block is allocated from the tail of free list

d. None of above

Fill in the Blanks

1. A buffer consists of ________ and __________.

2. The kernel must write the buffer contents to disk before reassigning the buffer; this condition is

known as _________.

3. ________ System call allocates the buffer until the umount system call is called.

4. When doing ___________ write, the kernel starts the disk operation immediately but does not wait for its

completion.

5. ___________ Function is used by the kernel at the time of search block in the queue.

Unit 3: File Systems

Short Questions

1. Which information is obtained by using inbuilt macros S_ISREG of stat data structure?

2. Which kernel data structure stores the information about permissions to access a file?

3. Define inode.

4. List the data structures and their relationship when a regular file is opened.

5. What is remember inode? Where does it located?

6. List the fields of super block.

7. How current byte offset is maintained by the file table?

8. What is the purpose of lseek() system call?

9. What is the return value of lseek() system call

10. How a user can move from beginning to end or in the middle of the file?

11. What is file descriptor?

12. What is the difference between user file descriptor table and file table?

13. Does each entry in the user file descriptor table have a separate file table associated with it?

14. List the information stored in inode block.

15. Why ialloc algorithm is required while creating a new file?

16. Which algorithm is used to free the inode used by the file?

Page 7 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

17. Which fields are additional in in-core inode than (disk) inode?

18. Why does inode number start from 1 not from 0?

19. What is the purpose of link system call? Give syntax with parameter description.

20. What does directory entry consists of?

21. How kernel searches for free inodes?

22. Give any one situation for buffer status contains invalid data.

23. What do you mean by delay-write status of buffer?

24. Give one difference and one similarity between algorithm bread and breada.

25. What happens when inode is released and free list of inode in super block is full?

26. What do you mean by system call? How it is differs from C library function?

27. What is the return value and type of creat() system call?

28. Where does file name stored?

29. List out various Buffer allocation algorithms.

30. Which algorithm converts a user-level path name to an inode?

31. List out various lower level file system algorithms.

32. What is inodes?

33. List out fields of disk inodes.

34. What is the significance of Number of link field of disk inode?

35. List out various file types supported by the UNIX file system.

36. When the contents of an inode changes?

37. What is the difference between in-core inode and buffer header?

38. Give the formula to compute the byte offset of the inode in the block.

39. Why the process that goes to sleep waiting for a free inode never wake up?

40. Which are the two extensions to the classic inode structure?

41. What are directories in UNIX operating system?

42. What is the significance of ‘.’ (dot) and ‘..’ (dot dot) file names in the directory?

43. What mkfs program does?

44. What is the meaning of read permission on directory?

45. What do write permission on directory signify?

46. Which permission the user must have to search the directory?

47. List out the fields of super block.

48. Give the syntax for open system call.

49. Which are the first three user file descriptors?

50. What is the significance of count parameter in read system call?

51. What is the use of lseek system call?

52. What is the significance of modes parameter of Creat system call?

53. What is the difference between chdir and chroot?

54. What is the significance of stat and fstat system call?

55. Which information is returned by stat system call?

56. What is the use of dup system call?

57. What is the importance of options parameter in mount system call?

58. Which system call removes a directory entry for a file?

Long Questions

1. Explain various fields of disk inodes.

2. Write a note on fields of in-core copy of an inode.

3. Explain an algorithm for allocation of In-core inodes.

4. Explain an algorithm for releasing an inode.

5. Write an algorithm to convert Byte Offset to Block Number in File System.

6. Explain in detail structure of regular file.

Page 8 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

7. Explain an algorithm to Conversion of a Path Name to an inode.

8. Write a note on super block.

9. Explain ialloc algorithm to assign new inodes.

10. Explain algorithm to free an inode.

11. Explain Race Condition in Assigning inodes.

12. Write a note on algorithm for allocating disk block.

13. Explain open and close system call in detail.

14. Explain read and write system call.

15. Write a program for reader and a writer process.

16. Explain system call used for adjusting the position of file I/O.

17. Explain the system call used for creating a file.

18. Write a note on the system call that is used to create special file.

19. Write a note on pipes.

20. Write a note on mounting and unmounting file systems.

21. Explain in detail the field in entry of the mount table.

22. Explain link and unlink system call.

23. Explain file system consistency and race conditions during the use of unlink system call.

24. Write a note on file system abstraction and file maintenance.

25. Explain in detail about the structure of regular file.

26. State the importance of file table in UNIX system. What information is stored in it?

27. Explain the system call used for creating the special files.

28. Draw a diagram representing kernel data structures after executing open().

29. Write an algorithm for demonstration lseek().

30. Differentiate between open() and creat() system call with example.

31. Demonstrate usage of read () & write() system call for copying content of file1 to file2.

32. Briefly explain file creation concept.

33. State the purpose of in-core inode entries in detail which are not available in (disk) inode.

34. Which system call is used to read inode entries? Explain in detail with example.

35. Explain algorithm for converting the path name to inode.

36. Specify how the open () system call is used to emulate the function performed by the shell’s

(i)> (ii)>> symbols?

37. Describe any one algorithm from following in detail.

ialloc, iput, bmap, ifree, alloc, iget

Multiple Choice Questions

1. What system call read a byte at a time from the standard input? a. read(0,buff,0); b. read(1,buff,1); c. read(2,buff,1); d. read(0,buff,1);

2. Which of the following information does not stored in inode? a. File size b. File name c. File owner d. File group

3. Directory entry consist of________. a. File type, file name and file size b. File type, file name and i-node c. File type and i-node d. File name and i-node

4. Which of the following file descriptor represent standard output?

Page 9 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

a. 0 b. 1 c. 2 d. None of above

5. Which system call is used to read content of the file? a. get b. fread c. getch() d. read()

6. When kernel retrieves block, its buffer is found in hash queue and is free, which of the following sequence occurs? (multiple choice)

a. the buffer removed from hash queue b. the buffer marked as busy c. the buffer removed from the free list d. the buffer added into hash queue

7. When kernel retrieves block, its buffer is not available in hash queue, which of the following sequence occurred?

a. Process waits for buffer is available in hash queue b. A free block is allocated from the head of free list c. A free block is allocated from the tail of free list d. None of above

8. UNIX stores list of free blocks in ________. a. I-node block b. Super block c. Data block d. Both b and c

List of free inodes are maintained in ________. a. Boot block b. Super block c. I-node block d. Data block

10. Type field of i-node stored zero means ________. a. i-node is allocated b. i-node is free c. i-node is locked d. i-node is corrupted

11. Which of the following information is not stored in superblock? a. Size of filesystem b. Size of i-node table c. List of free blocks d. List of allocated i-nodes

12. Which of the following is stored in in-core inode but not in disk i-node? a. File size b. File permission and type c. Link cout d. Reference count

13. Which of the following is maintained by file table? a. a pointer to in-core inode table b. the offset of next read or write in the file c. access rights (r/w) allowed to the opening process. d. reference count e. all of above

14. Use of dup(intfd) system call is ________ . a. Create duplicate file b. Copy a file descriptor into the first free slot of the user file descriptor table c. Copy a file content d. Copy a file table entry in file table maintained by kernel

15. Which of the following system call is used to creat a new file? a. open()

Page 10 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

b. creat() c. both open() and creat() can be used d. none of above

16. Which of the following system call is used to delete a file? a. delete() b. close() c. unlink() d. link()

17. A process may query status of a file by using _________ system call. a. open() b. read() c. status() d. stat()/fstat()

18.Which of the following is not buffer allocation algorithm? a. Alloc

b. Brelse

c. Getblk

d. Breada

19. Which of the following is buffer allocation algorithm?

a. Alloc

b. Free

c. Ialloc

d. Breada

20. Which of the following is lower level file system algorithm?

a. Bread

b. Bwrite

c. Breada

d. Free

21. An inode is on the free list only if its reference count is

a. -1

b. 0

c. 1

d. 2

22. Except which of the following system call, an inode is allocated and released.

a. Open

b. Close

c. Alloc

d. Free

23. The file name ‘.’ (dot) in the directory gives the inode for

a. Current directory

b. Parent directory

c. Root directory

d. Child directory

24. Write permission allows a process to create new directory entries or remove old ones with the help of

system call except which of the following.

a. Creat

b. Mknod

c. Link

d. Open

25. Which of the following algorithm parses the path name one component at a time, converting each

component into an inode?

a. Bmap

Page 11 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

b. Namei

c. Iget

d. iput

26. To change the directory which of the following system call is used?

a. Chgdir

b. Chdir

c. Cd

d. cddir

27. Which of the following utility program organizes the data blocks of a file system in linked list?

a. Md

b. Mkdir

c. Mkfs

d. mdfs

28. Which of the following system call manipulate an inode?

a. Open

b. Close

c. Write

d. stat

29. Which of the following system call does not manipulate an inode?

a. Chdir

b. Chroot

c. write

d. chown,

30. Which of the following file operation does not use the file descriptor returned by open system call?

a. Reading

b. Writing

c. Creating

d. seeking

31. The user file descriptor standard error is indicated by

a. -1

b. 0

c. 1

d. 2

32. The reference parameter value 2 of lseek system call indicates

a. Beginning of file

b. End of file

c. Beyond the end of file

d. At current position

33. Which of the following system call creates special files?

a. Mknod

b. Creat

c. Open

d. mkdir

34. Which of the following system call is used to change the owner of the file?

a. Chmod

b. Chroot

c. Chown

d. chgrp

35. Which of the following system call copies the file descriptor into the first free slot of the user file descriptor

table?

a. Copy

Page 12 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

b. Fcopy

c. Fdup

d. dup

36. Which of the following system call removes the directory entry of the file?

a. Rm

b. Rmdir

c. Unlink

d. unlnk

Fill in the blanks

1. _________ & _________ algorithm assign and free inodes for the files respectively.

2. _________ & _________ algorithm allocate and free disk blocks for files respectively.

3. ________ defines the set of users who have access rights to a file.

4. A _________ field of in-core copy of an inode, indicating the number of instances of the file that are active.

5. An inode is active when a process allocates it, such as when ________ a file.

6. The _________ is set during execution of a system call to prevent other processes from accessing the

mode while it is in use.

7. In _____ algorithm is the kernel attempts to take an inode from the free list but finds the free list empty,

it reports an error.

8. When the kernel releases an inode, it _________ its in-core reference count.

9. _______ Algorithm converts a file byte offset into physical disk block.

10. _______ is a file whose data is a sequence of entries, each consisting of an inode number and the name of

a file contained in the directory.

11. _______ is a null terminated character string divided into separate components by the slash ("/")

character.

12. The file name ‘..’ (dot dot) in the directory gives the inode for _________.

13. The algorithm _______ parses the path name one component at a time, converting each component into

an inode based on its name and the directory being searched, and eventually returns the mode of the

input path name.

14. The current directory of the first process in the system, process 0, is the _______ directory.

15. The current directory is stored in the process _________, and the system root mode is stored in a ________.

16. A process can execute the ________ system call to change its notion of the file system root.

17. An inode is free if its type field is ______.

18. A ________ file type field indicates that the disk mode is assigned.

19. The file system ________ contains an array that is used to cache the numbers of free disk blocks in the

file system.

20. The utility program _________ organizes the data blocks of a file system in a linked list, such that each

link of the list is a disk block that contains an array of free disk block numbers, and one array entry is

the number of the next block of the linked list.

21. The open system call returns an integer' called the _________.

22. ________ System call is used to change the directory.

23. ___________System call is used to change the access permission of the file.

24. The _______ system call connects the file system in a specified section of a disk to the existing file system

hierarchy.

25. The _________ system call disconnects a file system from the hierarchy.

26. The system call that links a file to a new name in the file system directory structure, creating a new

directory entry for an existing inode is _________.

Page 13 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

Unit 4: Process Management

Short Questions

1. Give significance of PID & PPID.

2. Mention the use of the fork().

3. How do you display all processes running on your system?

4. Name five important process attributes that are inherited by the child from its parent.

5. Kernel said to be non-preemptive. Note your comments on previous statement.

6. Define swapping & paging.

7. List any two advantages and disadvantages of kernel data structure.

8. Define pathname component.

9. Differentiate between user mode & kernel mode.

10. What are the 3 levels of UNIX operating system?

11. Define system call interface.

12. How will you kill the last background job without knowing its PID?

13. Define zombie state of process transition.

14. In which situation mode is used in open()?

15. Define signal.

16. What is context of process?

17. How you can avoid creating a process for command execution when it is to be executed from shell prompt?

18. Which programs are executed by spawning a shell? What does the second shell do?

19. Mention the use of lseeksystem call.

20. Write the I/O parameters saved in the U area.

21. Define init process.

22. What is the life time of the process?

23. What is Zombie state?

24. List out various states of the process.

25. What is user mode and kernel mode?

26. Which are the kernel data structures that describe process states?

27. What is the significance of UID field in process table data structure of kernel?

28. What is the use of PID field of process table?

29. What is the importance of Limit Field of u area data structure?

30. What is shared memory?

31. What is virtual address space?

32. What is region?

33. What is pregion for process?

34. Which is the value that permission field of pregion contains?

35. What are pages?

36. What is the significance of page table?

37. What does context of the process contains?

38. What is the importance of system-level context of the process?

39. What is the use of PS register in register context of the process?

40. What is program counter?

41. What does stack pointer contains?

42. What is the use of general-purpose register?

43. What is the significance of kernel stack of system-level context of process?

44. List out various system calls used to manage process.

45. What is the significance of exit system call?

Page 14 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

46. What does kernel do for creating user-level context for child process?

47. What is the significance of exec system call?

48. What does magic number contains?

49. What is sticky bit?

50. What is shell?

51. Which operation is performed by shell for executing any command?

52. What is bootstrap?

53. What is init process?

54. What is the PID of init process?

55. What is the significance of daemons process?

Long Questions

1. Explain various process states with diagram.

2. Write a note on Process states and transitions.

3. Write a note on State transition model of the process.

4. Explain various fields that are present in process table data structure of kernel.

5. Explain in details fields of u area data structure of kernel.

6. Write a note on Processes and regions.

7. Explain Mapping of Logical to Physical Page Numbers.

8. Write a note on layout of the kernel.

9. Write a note on u area.

10. Explain the components contained by register context of process.

11. Write a note on components of system-level context of process.

12. Write a note on Components of the Context of a Process.

13. Write a note on process creation.

14. Explain the sequence of operations performed by kernel for the fork system call.

15. Explain fork algorithm.

16. Explain algorithm for exit system call.

17. Explain the system call used to invoke other programs in UNIX.

18. Explain the logical format of executable file generated by assembler or loader.

19. Explain the cases when kernel removes the entries for sticky bit text regions.

20. Write a note on shell.

21. What operations does shell perform to execute ls —1 I wc.

22. Write a note on bootstrap sequence.

23. Explain an algorithm for booting the system.

24. Explain an algorithm for init.

25. Describe the state transition that a process undergoes during its lifetime .

26. Which memory structures are responsible for storing the data related to process which are only accessible

to the running process itself? Give your explanation by making use of diagram.

27. Why kernel does not prempt process running in kernel mode in UNIX system?

28. List internal steps after execution of fork().

29. Discuss what happens to open files on creation of child process. Illustrate using program and by drawing.

30. State the purpose of using Wait(). Explain wait() with different example of getting status of child.

31. List steps performed after executing exit().

32. Which steps are performed in UNIX operating system after occurrence of interrupt while executing a

process in kernel mode?

33. In user mode, a process can directly access hardware? If not, why? If yes, how?

34. Discuss booting sequence.

35. Differentiate between exceptions & interrupts.

36. Explain usage of exec() in detail.

Page 15 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

37. What are signals? Name a way of generating a signal from the keyboard. Why should we use kill with signal

names rather than their numbers?

38. Is there any process in the system whose PID is 0 (i.e. Zero)? Give significance of it.

39. Explain in detail about context of the process in UNIX system.

Multiple Choice Questions

1. What is a context switch? a. Kernel switches from executing one process to another. b. Process switches from kernel mode to user mode. c. Process switches from user mode to kernel mode. d. None of the above

2. Pid of init process is ________. a. 0 b. 1 c. 32767 d. None of the above.

3. What is the default maximum number of processes that can exist in Linux? a. 32768 b. 1024 c. 4096 d. Unlimited

4. How do you get parent process identification number? a. Waitpid b. getpid() c. getppid() d. parentid()

5. The process which terminates before the parent process exits becomes________.. a. Zombie b. Orphan c. Child d. None of the above

6. If fork() system call returns -1, then it means________. a. No new child process is created b. The child process is an orphan c. The child process is in Zombie d. None of the above.

7. Fork returns _____ to parent process on success. a. 0 b. child process id c. parent process id d. none

8. How many times printf() will be executed in the below mentioned program? main() { int i; for (i = 0; i < 4; i++) fork(); printf(“my pid = %d\n”, getpid()); } a. 4 b. 8 c. 16 d. 32

9. What is the output of the below code? void exit_handler1(); void exit_handler2(); int main() { intpid;

Page 16 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

atexit(exit_handler1); atexit(exit_handler2); pid = fork(); if(pid == 0) { _exit(0); } else { sleep(2); exit(0); } return 0; } a. Only child executes the exit_handler 1 and 2. b. Only parent executes the exit_handler 1 and 2. c. Both parent and child executes the exit_handler 1 and 2. d. Neither parent nor child executes the exit_handler 1 and 2.

10. What is output of the following program? int main() { fork(); fork(); fork(); if (wait(0) == -1) printf(“leaf child\n”); } a. “leaf child” will be printed 1 times b. “leaf child” will be printed 3 times c. “leaf child” will be printed 4 times d. “leaf child” will be printed 8 times

11. Which niceness value among the following indicates most favourable scheduling? a. 0 b. 20 c. 5 d. -19

12. Nice can be used by an ordinary process to________. a. increase the priority of a process b. decrease the priority of a process c. increase or decrease the priority of a process d. None of the above.

13. State of a process changes from “run” to “blocked/wait” when________.: a. Waiting for disk read occurs b. Time slice expires c. Waiting for CPU occurs d. All of the above

14. Which statements concerning process IDs are valid? a. Process IDs are stored in the respective i-nodes. b. It is assured that no two concurrently running processes have the same process ID. c. The process IDs are only unique with respect to each user. d. The process ID of the interactive shell may be returned with the command echo $?

15. Which statements concerning process IDs are valid? a. Shell and Subshell have the same process ID. b. The init process is always assigned process ID 1. c. Following a fork system call, father and son have the same process ID. d. None of above is true

16. init run-level for system shutdown is________. a. 3 b. 2 c. 1 d. 0

17.When process executed exit system call then it comes to a. Zombie state

Page 17 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

b. Ready state

c. Sleeping state

d. Wakeup state

14. When parent process execute the fork system call, the process comes to

a. Ready state

b. Zombie state

c. Created state

d. Running state

15. When the system clock interrupts the process, it comes to

a. User running state

b. Kernel running state

c. Ready state

d. Running state

16. Which of the following u area field record the time the process (and its descendants) spent executing in

user mode and in kernel mode?

a. Pointer

b. Terminal

c. Error

d. Timer

17. Data address is used for access to

a. Global data variable

b. instructions or subroutine calls

c. data structures local to a subroutine

d. Virtual address

18. Which of the following kernel data structure contains information about the regions allocated to the

process?

a. Process table

b. U area

c. User descriptor table

d. Region table

19. Which of the following is not the value of permission field of pregion?

a. Read-only

b. Read-write

c. Read-execute

d. Write-only

20. Which of the following is not present in user-level context of process?

a. Process text

b. Process data

c. User stack

d. permission

21. Which of the following system call allows a process to allocate more memory dynamically?

a. Creat

b. Brk

c. New

d. fork

22. Which of the following system call is used to invoke other programs?

a. Exec

b. Creat

c. Fork

d. new

23. Which of the following is not the system call to manage the process?

Page 18 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

a. Fork

b. Exec

c. Creat

d. open

24. Which of the following are the tasks that are performed by daemon process?

a. administration and control of networks

b. Execution of time-dependent activities

c. line printer spooling

d. All of the above.

Fill in the blanks

1. The process executed the exit system call and is in the __________ state.

2. The process enters the state model in the _________ state when the parent process executes the fork

system call and eventually moves into a state where it is ready to run.

3. When the process scheduler picks the process to execute, then the process enters the ________state,

where it executes fork system call. When the process completes the system call, it may move to

_________ state, where it executes in user mode.

4. The __________ field of process table data structure of kernel identifies the process state.

5. The process table contains fields that must always be accessible to the ___________, but the u area

contains fields that need to be accessible only to the _________ process.

6. The ___________ table records the files the process has open.

7. A _______ field of u area data structure masks mode settings on files the process creats.

8. A ________ field of u area restricts the size of a process and the size of a file it can write.

9. A ________ is a contiguous area of the virtual address space of a process that can be treated as a distinct

object to be shared or protected.

10. The System V kernel divides the virtual address space of a process into logical ________.

11. _______ Entries may exist in the process table, the u area, or in a separately allocated area of memory,

dependent on the implementation.

12. The memory management hardware divides physical memory into a set of equal-sized blocks called

______.

13. The region table entry contains a pointer to a table of physical page numbers called a___________.

14. The system allows address references via the kernel register triples only when in ________ mode.

15. A process can access its u area when it executes in _______ mode but not when it executes in ________

mode.

16. The only way for a user to create a new process in the UNIX operating system is to invoke the _______

system call.

17. After the fork system call is executed, the two processes have identical copies of their user-level

context except for the return value ______.

18. Processes on a UNIX system terminate by executing the _______ system call.

19. Processes ________ and ___________exist throughout the lifetime of a system.

20. The _______ process is a process dispatcher, spawning processes that allow users to log in to the system,

among others.

21. The init process spawns ________ processes to monitor the terminal lines configured on a system.

Unit 5: Inter-process Communication

Short Questions

1. What is signal? How it can be sent to other process?

Page 19 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

2. What happens to process on the receipt of the signal?

3. What do you mean by anonymous pipe?

4. Why pipe used only for half duplex communication?

5. What is return value of pipe() system call on success?

6. Why does pipe is available to use in related process?

7. Give name of any two signal which cannot be ignored or catch by a process.

8. What do you mean by installing signal handler?

9. What do you mean by re-installing signal handler?

10. When does process checks for arrival of signal?

11. What do you mean by transient pipe?

12. What is named pipe?

13. List System V IPC mechanism?

14. Which command is used to query status of System V IPC?

15. Which system call is used to remove message queue?

16. Which system call is used to access semaphore?

17. What will be return value of getshm() system call?

18. What is the significant of ftalk() call?

19. What if reader process closes the (all)read end of the pipe?

20. What is the drawback on pipe?

21. List out various types of pipes?

22. What is the use of pipe?

23. What is signal?

24. List out cases for handles the signals.

25. What is the significance of function parameter in signal system call?

26. What is the use of setpgrp system call?

27. What is the purpose of kill system call?

28. Give the formula to find index into the table of data structures from the descriptor for IPC mechanism.

29. List out the system calls that are used for messages.

30. What is the purpose of msgsnd system call?

31. What is the significance of msgget system call?

32. List out system call used to manage shared memory.

33. What is semaphore?

34. Which are the elements that a semaphore consists of in UNIX System V?

35. Which system call of semaphore is used to create and gain access to a set of semaphores?

36. What is the purpose of IPC_NOWAIT flag in semop system call?

37. What is the significance of SEM_UNDO flag in semop system call?

38. What is socket?

39. List out the parts of kernel structure.

40. What is the importance of protocol layer of kernel structure?

41. What is device layer of kernel structure?

42. What is the use of socket system call?

43. What is the purpose of connect and listen system call?

44. What is shutdown system call?

45. What is return by getsockname system call?

Long Questions

1. Write a note of signals in System V UNIX.

2. Explain an algorithm for recognizing signals.

3. Explain Signal system call.

Page 20 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

4. Write a note on anomaly with signals.

5. Write a note on common properties of System V IPC mechanism.

6. Explain message queue in detail.

7. Explain message system call used to send and receive messages.

8. Write a note on msgget and msgctl system calls.

9. Explain an algorithm for msgsnd.

10. Explain an algorithm for receiving a message.

11. Write a note on shared memory.

12. Explain the system calls used to attach and detach the region to the virtual address space.

13. Explain algorithm for attaching shared memory.

14. Explain semaphore in detail.

15. Explain various system calls of semaphore.

16. Explain an algorithm for semaphore operations.

17. Explain Socket model.

18. Explain Socket and Bind system call.

19. Which system call is used to send a signal? Give its syntax and parameter description. What if signal not

sent?

20. What happens to process on the receipt of the signal? Explain.

21. Why does process will not react to signal on receipt of signal in case when it occurs more than one time?

Discuss its solution.

22. How signal mechanism is used as communication mechanism between processes? Explain.

23. Which signal is sent to the parent process on child termination? Illustrate by giving example.

24. What do you mean by anonymous pipe? Why it called anonymous?

25. Why unnamed pipe used only in related processes?

26. Why pipe is used in half duplex communication? Explain by giving example.

27. What is FIFO? How it is differs from pipe (unnamed pipe)? How it can be created and accessed?

28. Write programs to demonstrate communication between two arbitrary process using FIFO.

29. Explain different scenario in case of inter processes communication done using FIFO.

30. How a parent process can wait for termination of its child process? Explain with an example.

31. How a child process can pass exit status to its parent process? Illustrate using program.

32. Explain system call wait(), waitpid().

33. Explain internal working of exit() system call.

34. Explain block and non block operation in msgrcv() and msgsnd() system call.

35. Describe the common characteristics of System V IPC mechanism.

36. How process can obtain shared memory region for communication? Also explain reading and writing into

shared memory with example.

37. What operation can be performed on semaphore? Explain each with example.

38. How semaphore can be used to solve critical section problem?

Multiple Choice Questions

1. Which of the following system call is used to create named pipe?

a. pipe

b. open

c. mknod

d. fifo

2. Which system call is used by the process to send a signal to other process(es).

a. signal

b. msgsnd

c. kill

d. sndsignal

Page 21 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

3. The kernel handles a signal only when process is in:

a. User mode

b. Kernel mode

c. Both

d. Sleeping mode

4. Process can ignore signal using:

a. signal system call

b. kill system call

c. trap system call

d. handle system call

5. Which is true regarding pipes?

a. half duplex

b. full duplex

c. message boundaries are preserved

d. Unordered data

6. On receipt of signal process can do which of the following action. (Tick all answer)

a. Exits

b. Ignore

c. Executes function

d. Sends signal

7. Which system call is used to get process id of last process which sends last message on message queue?

a. msgsnd

b. msgrcv

c. msgget

d. msgctl

8. Which system call is used to remove message queue structure from the kernel?

a. msgsnd

b. msgrcv

c. msgget

d. msgctl

9. Which system call is used to read data from the shared memory?

a. read

b. shmat

c. shmdt

d. None of these

10. What information is stored in semaphore structure for each semaphore?

a. The PID of process that performed last operation

b. The current value of semaphore

c. Number of process waiting for resource to become available

d. All of above

11. Which of the following is not an element of sembuf structure?

a. The number of the semaphore you wish to deal with

b. Process Id of current process

c. The operation to perform (positive, negative, or zero)

d. Operational flags

12. The system call semctl() can be used to do following

a. To retrieve shared memory structure

b. To perform various command on shared memory

c. To create semaphore

d. To remove semaphore set from the system

13. The persistency of a FIFO is

Page 22 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

a. process

b. kernel

c. file system

d. none

14. Advantage of FIFO over pipe is

a. related processes can communicate

b. unrelated processes can communicate

c. none

15. What mkfifo() creats?

a. pipe

b. unnamed pipe

c. named pipe

d. msg queue

16. System V IPC common attributes are

a. key

b. id

c. owner

d. all the above

17. Which one of the following is not system V IPC ?

a. Shared Memory

b. Semaphores

c. FIFO

d. Message Queues

18. Which system call is used to create Sys V message Queue.

a. msgget

b. shemget

c. semget

d. msgctl

19. Which is not the correct option for removing a message queue

a. ipcrm -Q

b. ipcrm -q

c. ipcrm -m

d. None

20. Message queues are created in

a. userspace

b. kernelspace

c. both

d. none

21. Command used to check shared memory is

a. ipcs

b. ipcs -m

c. ipcs -s

d. ipcs -q

22. Which is Fastest IPC?

a. Message Queue

b. shared memory

c. Socket

d. all

23. What is the persistancy level of Shared memory segments?

a. signal

b. process

Page 23 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

c. file system

d. kernel

24. The structure which keeps the information about shared memory in the kernel is

a. struct ipc_perm

b. struct semid_ds

c. struct shmid_ds

d. struct msgid_ds

25. One process requires M resource to complete a job. What should be the minimum number of resources

available for N processes so that at least one process can continue to execute without blocking/waiting?

a. M * N

b. M * N – 1

c. M * N + 1

d. M

26. Semaphore P( ) operation usually does the following:

a. descrements the semaphore count and the process sleeps if needed

b. increments the semaphore count

c. wakes up a sleeping process

27. Which call to use to set the resource count of semaphore?

a. semget( )

b. semctl( )

c. sem_setcount( )

d. sem_set_count( )

28. Which of the following IPC is fastest amongst all?

a. Message queue

b. Semaphore

c. Shared memory

d. All are equal

29. Which of the following inform processes of the occurrence of asynchronous events?

a. Signals

b. Pipe

c. Semaphore

d. message

30. Which of the following system call is used to initializes process group number?

a. Setgroup

b. Setpgrp

c. setprocgrp

d. Setpgrp

31. Which of the following system call is used to send signal to the process?

a. Send

b. SendSignal

c. Kill

d. KillSignal

32. Which of the following value of pid signify that the kernel has send the signal to all the processes with

process ID pid?

a. Negative

b. Zero

c. Positive

d. Non-zero

33. Which of the following value of pid signify that the kernel has send the signal to all the processes whose

real user ID equals the effective user ID of the sender?

Page 24 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

e. -ve

f. 0

g. +ve

a. -1

34. Which of the following system call is used to receive the message?

a. Msgget

b. Msgctl

c. Msgsnd

d. msgrcv

35. Which of the following parameter of msgsnd system call specifies the action the kernel should take if it

runs out of internal buffer space?

a. Msgqid

b. Msg

c. Count

d. flag

36. Which of the following parameter of msgrcv system call specifies the size of the data array in msg?

a. Msg

b. Maxcount

c. Type

d. flag

37. Which of the following system call of shared memory, create a new region of shared memory?

a. Shmget

b. Shmcreat

c. Shmat

d. shmdt

38. Which if the following parameter of shmctl system call is the address of a user-level data structure that

contains the status information of the shared memory table entry when querying or setting its status?

a. Id

b. Cmd

c. Shmstatbuf

d. statbuf

39. Which of the following system call allow processes to synchronize execution by doing a set of operations

atomically on a set of semaphores?

a. Creat

b. Semaphore

c. Message

d. shmat

40. Which of the following system calls is used to manipulate the values of semaphore?

a. Semget

b. Semctl

c. Semop

d. semval

41. Which of the following is not the layer of kernel structure?

a. Socket

b. Protocol

c. Device

d. hardware

42. Which of the following system call is used to requests that the kernel make a connection to an existing

socket?

a. Listen

b. Socket

Page 25 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

c. Bind

d. connect

43. Which of the following system call return the name of the socket?

a. Getsockname

b. Getsckname

c. RetSckName

d. None

Fill in the blanks

1. ___________ Mechanisms allow arbitrary processes to exchange data and synchronize execution.

2. ________ Signals inform processes of the occurrence of asynchronous events.

3. The kernel uses the process ________ to identify groups of related processes that should receive a

common signal for certain events.

4. The ________ system call initializes the process group number of a process and sets it equal to the value

of its process ID.

5. The _________ system call is use to send signals to the process.

6. If pid is a ________ integer, the kernel sends the signal to the process with process ID pid.

7. If pid is __________, the kernel sends the signal to all processes in the sender's process group.

8. If pid is __________, the kernel sends the signal to all processes whose real user ID equals the effective

user ID of the sender.

9. If pid is a _________ integer but not —1, the kernel sends the signal to all processes in the process group

equal to the absolute value of pid.

10. __________ System call returns a message descriptor that designates a message queue for use in other

system calls.

11. ____________ System call has options to set and return parameters associated with a message.

12. _________ System call sends the message.

13. ___________ System call is used to receive the message.

14. In msgsnd system call, ____________ is the descriptor of a message queue typically returned by a msgget

call.

15. Processes can communicate directly with each other by sharing parts of their virtual address space

and then reading and writing the data stored in the ___________.

16. The _________ system call creates a new region of shared memory or returns an existing one.

17. The _________ system call logically attaches a region to the virtual address space of a process.

18. The _________ system call detaches a region from the virtual address space of a process.

19. The _________ system call manipulates various parameters associated with shared memory.

20. The ________ parameter of shmctl system call is the address of a user-level data structure that contains

the status information of the shared memory table entry when querying or setting its status.

21. The _________ system calls allow processes to synchronize execution by doing a set of operations

atomically on a set of semaphores.

22. The _________ system call of semaphore is used to create and gain access to a set of semaphores.

23. The _____ layer of kernel structure provides the interface between the system calls and the lower

layers.

24. The _______ system call receives incoming requests for a connection to a server process.

25. ________ & __________ system calls transmit data over a connected socket.

Unit 6: Input /Output Management

Short Questions

Page 26 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

1. What is a device file?

2. What do you mean by device driver?

3. What do you mean by major number?

4. What do you mean by minor number?

5. What are software devices? Give one example.

6. Which are two types of devices in UNIX system? Give two examples of each.

7. Which are two modes of line discipline?

8. What do you mean by canonical mode of line discipline module?

9. What is Cblock?

10. What is device driver?

11. What is stream?

12. What is the significance of device interface?

13. Which are the types of devices supported by UNIX system?

14. What is major and minor number?

15. What is the difference between system calls for devices and regular files?

16. Which information is maintained by the data structures of the driver?

17. What does ‘c’ specifies in ‘CTW-W--W--‘?

18. What is the purpose of control and status register?

19. What is DMA?

20. What is strategy interface?

21. What is the significance of command parameter in ioctl system call?

22. What does ‘b’ indicates in ‘br--------‘?

23. What is the function of terminal driver?

24. What is clist?

25. Which mode is important for screen oriented applications?

Long Questions 1. Write a note on device interface.

2. Explain stages at which device configuration can be specified.

3. Explain an algorithm for opening a device.

4. Explain an algorithm for closing a device.

5. Write a note on ioctl system call.

6. Write a note on interrupt handlers.

7. Explain device driver in detail.

8. Explain various functions of line discipline module.

9. Write a note on the operations performed by kernel on linked list.

10. Explain an algorithm for writing data to a terminal.

11. Write a note on terminal driver.

12. Explain an algorithm for reading a terminal.

13. Explain select system call.

14. Explain an algorithm for Logging In.

15. List three stages of device configuration.

16. Write a note on terminal driver.

17. What are the functions of line discipline?

18. What is Clists? What are its functions?

19. Write note on Cblock/Clist.

20. Write a note on terminal driver in raw mode and terminal driver in canonical mode.

21. Explain system call ioctl().

Multiple Choice Questions

Page 27 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

1. Which system call is used to create device file?

a. creat

b. open

c. mknod

d. pipe

2. Which of the following is used to represent device driver or device type?

a. No of link

b. Major number

c. Minor number

d. None of above

3. Which of the following device parameter represent instances of device?

a. Number of link

b. Major number

c. Minor number

d. None of above

4. Which of the following is function of line discipline:

a. To parse input strings into lines.

b. To process erase characters.

c. To echo received characters to the terminal.

d. All of above.

5. Which of the following system call provides an interface that allows processes to control character device,

but it is not applicable to regular files?

a. Ioctl

b. Open

c. Close

d. read

6. Which of the following is not the system calls of character special files that pass through the respective

procedures in the character device switch table?

a. Read

b. Open

c. Write

d. ioctl

7. Which of the following is a command used by administrator to set up device special files?

a. Mknod

b. Dev

c. MakDev

d. None

8. Which of the following is the system call is a generalization of the terminal-specific stty and gtty system

calls available in earlier versions of the UNIX system?

a. Open

b. Close

c. Ioctl

d. setterm

9. Which of the following is screen oriented applications?

a. Vi

b. Dw

c. Bash

d. None

Page 28 of 28

Mr. Hardik Vyas, Mr. Krunal Sukhwani

Babu Madhav Institute of Information Technology, UTU - 2016

Fill in the blanks

1. The ______ command, for instance, reads kernel data structures from physical memory to report

process statistics.

2. __________ & ____________ types of devices are supported by UNIX system.

3. The ___________ system call provides an interface that allows processes to control character devices.

4. __________ is the procedure by which administrators specify parameters that are installation dependent.

5. The __________ & _____________ system calls of a device file funnel through the two device switch tables,

according to the file type.

6. Administrators set up device special files with the _____ command.

7. The ___________ number indicates a device type that corresponds to the appropriate entry in the block or

character device switch tables.

8. The ___________ number indicates a unit of the device.

9. ________ Special files do not have to be created every time the system is booted; they need be changed

only if the configuration changes, such as when adding devices to an installation.

10. The kernel saves the process context using __________ algorithm before entering the device-specific open

routine.

11. The kernel uses the __________ to transmit data between the buffer cache and a device.

12. A _______ & _________ program directly deals with the disk.

13. In _______ mode, the line discipline converts raw data sequences typed at the keyboard to a canonical

form before sending the data to a receiving process.

14. In _________ mode, the line discipline passes data between processes and the terminal without such

conversions.

15. The command _______ deletes the word at the current cursor position.

16. The BSD system has a _______ system call that allows device polling.

17. The ________ terminal is the terminal on which a user logs into the system, and it controls processes that

the user initiates from the terminal.