Sie sind auf Seite 1von 9

Ques1. Explain UNIX system architecture.

Ans. At the center of the UNIX onion is program called the kernel. It is absolutely crucial to the operation of the UNIX system. The kernel provides the essential services that make up the heart of UNIX system; it allocates memory, keeps track of the physical location of files on the computers hard disks, loads, and executes binary programs such as shells, and schedules the task swapping without which UNIX systems would be incapable of doing more than one thing at a time. Architecture of the UNIX operating system

The kernel accomplishes all these tasks by providing an interface between the other programs running under its control and the physical hardware of the computer; this interface, the system call interface, effectively insulates the other programs on the UNIX system from the complexities of the computer. For example, when a running program needs access to file, it cannot simply open the file. The kernel takes over and handles the request, then notifies the program whether the request succeeded or failed. The kernel determines whether or not the request is valid, and if it is, the kernel reads the required block

of data and passes it back to the programs do not have access to the physical hardware of the computer. All they see are the kernel services, provided by the system call interface. Although there is a well-defined, technical and commercial standard for what constitutes Unix, in common usage, Unix refers to a set of operating systems, from private vendors and in various openlicensed versions, that act similarly from the view of users and administrators. Within any Unix version, there are several different shells which affect how commands are interpreted. Your default is that you are using Solaris (developed by Sun Microsystems primarily for use on hardware sold by Sun) within the c-shell. Most of the basic commands here will work the same in other UNIX variants and shells, including Linux and the Mac OS X command-line environment. A standard Unix system provides command for username, password, chsh and additional option on codger to change username, passwords, default group, and shell environments. Wildcard: * is a wildcard character that can refer to any character string and? Is a wildcard character that can refer to any single character. For example, mv *.95 code would move every Fortran 95 program file on the current directory into a subdirectory called code. Filenames: Filenames may be upto 255 characters, and they may include any character except the regular slash /.(Avoid using backslashes, blank spaces, or nonprinting characters in filenames they are allowed but will cause problems for you.)A pathnames beginning with / is an absolute path from the top of the system tree. A pathname not beginning with / is a relative path down from the current working directory .Directory shortcuts include: as a replacement for your home directory, username as a shorthand for usernameshome directory, .. (two periods) for the subdirectory on level up from the current directory, and . (one period)for the current directory.

Ques2. What are the various standards in UNIX? Discuss various features of UNIX
Ans. Because of the multiple versions of UNIX and frequent cross-pollination between variants, many features have diverged in the different version of UNIX. With the increasing popularity of UNIX in the commercial and government sector, came the desire to standardize of UNIX so that a user or developer using UNIX could depend on those features .The institute of Electrical and Electronic Engineers created a series of standards committees to create standards for An industry-Recognized Operating Systems Interface Standard based on the UNIX Operating System .The results of two of the committees are important for the general user and developer. The POSIX.1 committee standardizes the C library interface used to write programs for UNIX. In Europe, the X/Open Consortium brings together various UNIX-related standards, including the current attempt at a Common Open System Environment (COSE) specification. X/Open publishes a series of specifications called the X/Open Portability Guide, Currently at version 4.XPG4 is a popular specification in Europe, and many companies in the United States supply version of UNIX that meet XPG .The United States government has specified a series of standards based on XPG and POSIX. Currently FIPS151-2 specifies the open system requirements for purchases. Various Features of UNIX: Multi-user : more than one user can use the machine at a time supported via terminals (serial or network connection)

Multi-tasking : more than one program can be run at a time


Hierarchical directory structure : to support the organization and maintenance of files

Portability : only the kernel ( <10%) written in assembler tools for program development a wide range of support tools (debuggers, compilers)

Multi-User Operating Systems A multi-user operating system allows more than one user to share the same computer system at the same time. It does this by time-slicing the computer processor at regular intervals between the various users

. In the above example, There are five users which share the processor hardware and main memory on a time basis. Multi-Tasking Operating Systems:Multi-tasking operating systems permit the use of more than one program to run at once. It does this in the same way as a multi-user system, by rapidly switching the processor between the various programs. OS/2 and Windows 95 are examples of multi-tasking single-user operating system. UNIX is an example of a
multi-tasking multi-user operating system.

A multi-user system is also a multi-tasking system. This means that a user can run more than one program at once, using key selection to switch between them.Multi-tasking

systems support foreground and background tasks. A foreground task is one that the user interacts directly with using the keyboard and screen. A background task is one that runs in the background (it does not have access to the keyboard). Background tasks are usually used for printing or backups.The role of the operating system is to keep track of all the programs, allocating resources like disks, memory and printer queues as required.

Ques3. What are various File Systems supported in UNIX? Discuss any three of them.
Ans. Root This file system must be present in every UNIX system. It contains the barebones UNIX-the root directory, /bin/usr/bin,/etc,/sbin,/usr/sbin,/dev and /lib directories all the tools and utilities that are just adequate to keep the system is booted in single-user mode, this is the only file system going .When the system is booted in single-user mode, this is the only file system available to the system administrator. Swap Every system should have a swap file system which is used by the kernel to movement of processes. When the system memory is heavily loaded, the kernel has to move process. When the system memory is heavily loaded, the kernel has to move process out of memory to this file system. When these swapped processes are ready to run, they are loaded back to memory. Users cant access data in this file system directly .A UNIX system contains many more file systems. System files should be kept separate from data files created by users, and hence a separate file system is usually made for them. Linux and SVR4 create users home directories in/home, but older systems use/usr./home is often maintained as a separate file system. If theres no space left on/home, the administrator uses other file systems like/user2 or /u. You can have additional file systems for /tmp and /var/tmp so that temporary and log files cant grow indefinitely. File System Types

Initially, there were only two types of file systems-the ones from AT&T and Berkeley. Following are some file systems types: s5 Before SVR4, this was the only file system used by System V, but today it is offered by SVR4 by this name for backward compatibility only. This file system uses a logical block size of 512 or 1024 bytes and a single super block. It also cant handle filenames longer than 14 characters. ufs This is how the Berkeley fast file systems is known to SVR4 and adopted by most UNIX systems. Because the block size here can go up to 64 KB, performance of this file system is considerably better than s5. It uses multiple super blocks with each cylinder group storing a superblock. Unlike s5, ufs supports 255character filenames, symbolic links and disk quotas. Fdisk Creating Partitions Both Linux and SCO UNIX allow a user to have multiple operating systems on Intel Machines. Its no wonder then that both offer the Windows-type fdisk command to create, delete and activate partitions. fdisk in Linux ,however, operates differently from windows. The fdisk m command shows you all its internal commands of which the following subset should serve our purpose: Command Action A toggle a bootable flag N add a new partition D delete a partition P Print partition table L list known partition types Q Quit without saving M print this menu W Write table to disk & exit. Mkfs : creating file systems

Now that you have created a partition, you need to create a file system on this partition to make it usable. Mkfs is used to build a Linux file system on a device, usually a hard disk partition. The exit code returned by mkfs is 0 on success and 1 on failure. The file system-specific builder is searched for in a number of directories like perhaps /sbin, / sbin /fs , /sbin/fs.d, /etc/fs, /etc (the precise list is defined at compile time but at least contains /sbin and /sbin/fs), and finally in the directories listed in the PATH environment variable.

Ques4. What do you mean by a Process? What are the various possible states of Process? Discuss.
Ans. A process under Unix consists of an address space and a set of data structures in the kernel to keep track of that process. The address space is a section of memory that contains the code to execute as well as the process stack. The kernel must keep track of the following data for each process on the system: The address space map, The current status of the process ,The execution priority of the process ,The resource usage of the process ,The current signal mask ,The owner of the process ,A process has certain attributes that directly affect execution, these include:PID The PID stands for the process identification. This is a unique number that defines the process with in the kernel. PPID This is the processes Parent PID, the creator of the process. UID This User ID number of the user that owns this process. EUID The effective User ID of the process.

GID The Group ID of the user that owns this process. EGID The effective Group User id that owns this process. Priority The priority that this process runs at. To view a process you use the ps command. # Ps l
F S UID PID PPID C PRI NI P SZ: RSS WCHAN TTY TIME COMD 30 S 0 11660 145 1 26 20 * 66:20 88249f10 ttyq 6 0:00 rlogind

The F field: This is the flag field. It uses hexadecimal values which are added to show the value of the flag bits for the process. For a normal user process this will 30, meaning it is loaded into memory. The S field: The S field is the state of the process, the two most common values are S for Sleeping and R for Running. An important value to look for is X which means the process is waiting for memory to become available. PID Field: The PID shows the process ID of each process. This Value should be Unique. Generally PID are allocated lowest to highest, but wrap at some point. This value is necessary for you to send a signal to a process such as the kill signal. PRI field: This stand for priority field. The process with the lowest value in the PRI field which has the highest priority. The lower the value, the higher the value. This refer to the process NICE value. It will range form 0 to39. The default is 20, as a process uses the CPU the system will raise the nice value. P flag: this is the processor flag. On the SGI this refers to the processor the process is running on.

SZ field: This refers to the SIZE field. This is the total number of pages in the process. Each page is 4096 bytes. TTY field: this the terminal assigned to your process. Time field: the Cumulative execution time of the process in minutes and seconds. COMD field: the command that want executed.

Das könnte Ihnen auch gefallen