How do you create special files like named pipes and device files?
The system call mknod creates special files in the following sequence.1. kernel assigns new inode,2. sets the file type to indicate that the file is a pipe, directory or special file,3. If it is a device file, it makes the other entries like major, minor device numbers.For example:If the device is a disk, major device number refers to the disk controller and minor devicenumber is the disk.
Discuss the mount and unmount system calls
The privileged mount system call is used to attach a file system to a directory of another filesystem; the unmount system call detaches a file system. When you mount another file system onto your directory, you are essentially splicing one directory tree onto a branch in another directory tree. The first argument to mount call is the mount point, that is , a directory in thecurrent file naming system. The second argument is the file system to mount to that point. Whenyou insert a cdrom to your unix system's drive, the file system in the cdrom automaticallymounts to /dev/cdrom in your system.
How does the inode map to data block of a file?
Inode has 13 block addresses. The first 10 are direct block addresses of the first 10 data blocks inthe file. The 11th address points to a one-level index block. The 12th address points to a two-level (double in-direction) index block. The 13th address points to a three-level(triple in-direction)index block. This provides a very large maximum file size with efficient access to largefiles, but also small files are accessed directly in one disk read.
What is a shell?
A shell is an interactive user interface to an operating system services that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them tosystem calls to the OS or forks off a process to execute the command. System call results andother information from the OS are presented to the user through an interactive interface.Commonly used shells are sh,csh,ks etc.
Brief about the initial process sequence while the system boots up.
While booting, special process called the 'swapper' or 'scheduler' is created with Process-ID 0.The swapper manages memory allocation for processes and influences CPU allocation. Theswapper inturn creates 3 children:the process dispatcher,vhand anddbflushwith IDs 1,2 and 3 respectively.This is done by executing the file /etc/init. Process dispatcher gives birth to the shell. Unix keepstrack of all the processes in an internal data structure called the Process Table (listing commandis ps -el).
What are various IDs associated with a process?
Unix identifies each process with a unique integer called ProcessID. The process that executes