ROEVER ENGINEERING COLLEGE Elambalur,Perambalur-621212 DEPARTMENT OF CSE UI UNIT-I 1. What are the different parts of UNIX system? The different parts of UNIX system are i. Programs and services that have made the UNIX system environment. ii. Operating system that supports those programs and services. 2. What are the reasons for popularity of UNIX operating system? The reasons for popularity of UNIX operating system are i. The system is written in high level language, make it easy to read, understand, change, and move to other machines. ii. It has a simple user interface that has the power to provide the services that users want. iii. It provides primitives that permit complex programs to be built from simpler programs. iv. It uses a hierarchical file system, consistent format for files, byte stream, making application programs easier to write. v. It provide simple and consistent interface to peripheral devices. vi. It is a multi user multi process system; it hides the machine architecture from user. 3. Define program and process. A program is an executable file. A process is the execution of the program and consists of the pattern of bytes that the CPU interrupts as machine instructions, data, and stack a process is an instance of the program in execution.
24
Embed
ROEVER ENGINEERING COLLEGE Elambalur,Perambalur-621212 ... 2MARK.pdf · ROEVER ENGINEERING COLLEGE Elambalur,Perambalur-621212 DEPARTMENT OF CSE UI UNIT-I 1. What are the different
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
ROEVER ENGINEERING COLLEGE
Elambalur,Perambalur-621212
DEPARTMENT OF CSE
UI
UNIT-I
1. What are the different parts of UNIX system?
The different parts of UNIX system are
i. Programs and services that have made the UNIX system environment.
ii. Operating system that supports those programs and services.
2. What are the reasons for popularity of UNIX operating system?
The reasons for popularity of UNIX operating system are
i. The system is written in high level language, make it easy to read, understand, change, and
move to other machines.
ii. It has a simple user interface that has the power to provide the services that users want.
iii. It provides primitives that permit complex programs to be built from simpler programs.
iv. It uses a hierarchical file system, consistent format for files, byte stream, making application
programs easier to write.
v. It provide simple and consistent interface to peripheral devices.
vi. It is a multi user multi process system; it hides the machine architecture from user.
3. Define program and process.
A program is an executable file. A process is the execution of the program and consists of the
pattern of bytes that the CPU interrupts as machine instructions, data, and stack a process is an instance of
the program in execution.
4. Write down the characteristics of UNIX file system?
The characteristics of UNIX file system are
• A hierarchical structure.
• Consistent treatment of file data.
• The ability to create and delete files.
• Dynamic growth of files.
• The protection of file data.
• The treatment of peripheral devices as files
5. What is the purpose of system calls?
The system calls instructs the kernel to do various operations for the calling program and
exchange data between the kernel and the program.
6. What is the purpose of building block primitives?
Building block primitives enable users to write small, modular programs that can be used as
building blocks to build complex programs. Example for primitives is capability to redirect I/O.
7. What are the services provided by the kernel?
The services provided by the kernel are
i. Controlling the execution of processes by allowing their creation, termination or suspension and
communication.
ii. Scheduling processes for execution on the CPU.
iii. Allocating main memory for an executing process.
iv. Allocating secondary memory for efficient storage and retrieval of user data.
v. Allowing processes controlled access to peripheral devices.
8. What are the execution modes of the user process? Define that.
There are two levels of user process i.e., user and kernel. When a process executes a system call
the execution mode of the process changes from user mode to kernel mode.
9. What is the difference between user mode and kernel mode?
Processes in user mode can access their own instructions and data but not kernel instructions and
data. Processes in kernel mode can access kernel and user addresses. Some machine instructions are only
privileged to kernel mode.
10. Define interrupts.
Interrupts are caused by events that are external to process. Interrupts are considered to happen
between the execution of two instructions, and the system continues with the next instruction after
servicing the interrupt.
11. Define exception.
Exception refers to unexpected events caused by a process such as addressing illegal memory,
executing privileged instructions, dividing by zero and so on. Exception happen in the middle of the
execution of an instruction and the system attempts to restart the instruction after handling the exception.
12. Write some sample processor execution levels?
Sample processor execution levels are
Machine errors
Clock
Disk
Network devices
Terminals
Software interrupts
13. What is the purpose of file sub system?
The file sub system accesses file data using a buffering mechanism that regulates data flow
between the kernel and secondary storage device.
14. What are the central concepts of UNIX system?
The central concepts of UNIX are.
The entities files
processes
15. What are the different levels of operation in UNIX kernel?
The different levels of operation in UNIX kernel are
User Level: The user programs and the libraries are available here.
Kernel level: This is the heart of UNIX operating system. All the operations related to file system, process
control sub system, hardware control, and device drivers are available in this level.
Hardware level: The physical components of the system are available here.
16. What are the goals of Multics system?
The goals of Multics system are
To provide simultaneous access to a large community of users,
To supply ample computation power and data storage,
To allow users to share their data easily, if desired.
17. What do you mean by access permissions?
Access permissions are set of bits associated with each file. Access permissions can be se t
independently to control read, write, and execute permission for three classes of users: the file owner, a
file group and every one else.
18. What are the important fields of u area?
The important fields of u area are
A pointer to the process table slot of the currently executing process
Parameters of the current system call, return values and error codes
File descriptors for all open files
Internal I/O parameters
Current directory and current root
Process and file size limits
19. Describe all process states?
The process states are
The process is currently executing in user mode
The process is currently executing in kernel mode
The process is not executing, but it is ready to run as soon as the scheduler chooses it.
The process is sleeping
20. Define context switch.
When the kernel decides to execute another process the kernel saves the necessary information so
that it can later switch back to the first process and resume its execution
21. Define state transition diagram.
State transition diagram 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. State
transitions are legal between two states if there exist an edge from the first state to the second.
UNIT-II
1. Write down the purpose of buffering mechanism?
Buffering mechanism interacts with block I/O device drivers to initiate data transfer to and from
the kernel.
2. What are the data structures used for file processing?
The data structures used for file processing are
File table: It is a global data structure
User file descriptor table: It is allocated per process. When a process opens or creats a file the kernel
allocates an entry from each table corresponds to the file inode.
Inode: Internal representation of file is given by an inode, which contains a description of the disk layout
of the file data and other information related to permission, access time, owner etc.
3. Write about file system layout
File system layout include
Boot block: This occupies the beginning of a file system, typically first sector, and may contain the
bootstrap code
Super block: describes the state of the file system.
Inode list: A list of inodes that follows the super block in the file system.
Data blocks: Contain file data and administrative data.
4. What is the information available in inode?
The information’s available in inode are
A descriptor of the disk layout of the file data
Other information such as the file owner, file access permissions and access times.
5. Describe the contents in buffer cache.
The buffer consists of two parts: a memory array that contains data from the disk and a buffer
header that identifies the buffer. The data in buffer corresponds to the data in a logical disk block and
kernel identifies the buffer contents by examining identifier fields in the buffer header.
6. How will you identify the status of the buffer?
The status of the buffer is
1. The buffer is currently locked.
2. The buffer contains valid data.
3. The kernel must write buffer contents to disk before reassigning the buffer
4. The kernel is currently reading or writing the contents of the buffer to disk.
5. A process is currently waiting for the buffer to become free.
7. What are the different scenarios to allocate a buffer for a disk block?
The different scenarios to allocate a buffer for a disk block are
i. The kernel finds the block on its hash queue and its buffer cache.
ii. The kernel cannot find the block o the hash queue, so it allocates a buffer from the free list.
iii. The kernel cannot find the block o the hash queue and in attempting to allocate buffer from the free
list, find a buffer on a free list that has been marked “delayed write”. The kernel must write the “delayed
write” buffer to disk and allocate another buffer.
iv. The kernel cannot find the block o the hash queue, and the free list of buffers is empty.
v. The kernel finds the block on the hash queue but its buffer is currently busy.
8. What is the information available in buffer header?
The buffer header contains a device number field and block number fields that specify the file
system and block number of the data on disk and uniquely identify the buffer. It also contains a pointer to
a data array, status field.
9. Define Inode
Inodes exist in static form on disk, and the kernel reads them into an in – core inode to manipulate
them. The inode contains the information necessary for a process to access a file ownership, access rights,
file size, and the location of the file’s data in the file system.
10. Define Buffer cache
The kernel attempts to minimize the frequency of disk access by keeping a pool of internal data
buffers, called the buffer cache, which contains the data in recently used data blocks.
11. What are the fields of Disk Inodes?
The fields of Disk Inodes are
File owner identifier.
File type
File access permissions
File access times
Number of links to the file
Table of contents for the disk addresses of data in a file
File size
12. Define Directories
Directories are the files that give the file system its hierarchical structure; they play an important
role in conversion of a file name to an inode number. A directory is a file whose data is a sequence of
entries, each consisting of an inode number and the name of a file contained in directory.
13. Define path name and component
A path name is a sequence of component names separated by slash characters; a component is a
sequence of characters that designates a file name that is uniquely contained in the previous component.
14. What are the fields of in–core?
The fields of in – core are
The status of the in-core inode
The logical device number of the file system that contains the file.
The inode number
Pointers to other in-core inodes
A reference count
Disk inode
15. What are the fields in Super Block?
The fields in Super Block are
The size of the file system
The number of free blocks
A list of free blocks available on the file system
The index of the next free block in the free block list
The size of the inode list
The number of free inodes in the file system
A list of free inodes in the file system
The index of the next free inode in the free inode list
Lock fields for the free block and free inode lists
A flag indicating that the super block has been modified
16. Define major & minor number
The major number indicates a device type such as terminal or disk. The minor number indicates
the unit number of the device.
17. Define Inode cache
If the inode is in the cache, the process (A) would find it on its hash queue and check if
the inode was currently locked by another process (B). If the inode is locked, process A sleeps,
setting a flag in the in-core inode to indicate that it is waiting for the inode to become free. When
process B later unlocks the inode, it awakens all processes (including process A) waiting for the
inode to become free. When process A is finally able to use the inode, it locks the inode so that
other processes cannot allocate it. If the reference count was previously 0, the inode also appears
on the free list, so the kernel removes it from there: the inode is no longer free. The kernel
increments the inode reference count and returns a locked inode.
18. Explain free list of buffers
The kernel maintains a free list in buffer that preserves the least recently used order. The free list
is a doubly linked circular list of buffers with a dummy buffer header that marks its beginning and end.
19. What are the advantages and disadvantages of Buffer cache?
The advantages and disadvantages of Buffer cache are
Use of buffers allows uniform disk access, (data is part of a file, an inode, or a super block)
(simpler system design).
System places no data alignment restrictions on user processes doing I/O (because the kernel
aligns data internally).
Use of buffer cache can reduce the amount of disk traffic (increasing throughput and decreasing
response time)("delayed write" avoids unnecessary disk writes) (amount of memory available for
buffers).
Buffer algorithms help insure file system integrity (serialize process access - preventing data
corruption).- reduction of disk traffic (vulnerable to crashes that leave disk in an incorrect state).
use of buffer cache requires an extra data copy when reading and writing to and from user
processes (for large amounts of data - slows down performance) (small amounts - improves
performance - cache, delayed write)
20. List down the types of file
The types of file are
Regular file, Directory file, FIFO files, Character special file, Block special file, socket file,
symbolic file.
UNIT-III
1. What is the purpose of dup and mount system call?
The dup system call copies a file descriptor into the first free slot of the user file descriptor table,
returning new file descriptor to the user.
The mount system call connects the file system in a specified section of a disk to the existing file system
hierarchy.
2. What are the different types of pipes?
The different types of pipes are
Unnamed pipe
named pipe(FIFO)
3. Define open system call and their syntax
Open:
• The open system call is the first step a process must take to access the file
• open(pathname, flags, modes)
pathname – file name
flags – indicating type of open
modes – give file permission if the file is being created
4. Define write system call and their syntax
The syntax for the write system call is
write (fd,buffer,count)
fd- file descriptor
buffer – address of a data structure in the user process that will contain a read
data on successful completion of the cal.
Count – no of bytes the user wants to read.
5. Define read system call and their syntax
The syntax of the read system call is
read (fd,buffer,count)
fd- file descriptor
buffer – address of a data structure in the user process that will contain a read