Você está na página 1de 6

ASSINGMENT BC0056 REGISTRATION NUMBER:NAME

1. 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 .

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 open-licensed 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, passed, cash and additional option on cud grip 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, m v *.95 code would move every Fortran 95 program file on the current directory into a subdirectory called code. Filenames: Filenames may be up to 255 characters, and they may include any character except the regular slash /.(Avoid using backslashes, blank spaces, or non printing 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 user names home directory, .. (two periods) for the subdirectory on level up from the current directory, and . (one period)for the current directory.

2. What are the various standards in UNIX? Discuss various features of UNIX ? ANS:--- Because of the multiple version 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 developments 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.

QUE3. What are various File Systems supported in UNIX? Discuss any three of them. ANS:---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:

1 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. 2 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 255-character filenames, symbolic links and disk quotas. 3 Ext2 :---This is the standard file system of Linux, It uses a block size of 1024 bytes and, like ufs, uses multiple superblocks and symbolic links. 4 Iso9660 or hsfs :---This is the standard file system used by CD-ROMs and uses DOSstyle 8+3 filenames, Since UNIX uses longer filenames, hsfs also provides Rock Ridge extensions to accommodate them. 5 msdos or pcfs :--- Most UNIX systems also support DOS file systems. You can create this file system on a floppy diskette and transfer files to it for use on a windows system. Linux and Solaris can also directly access a DOS file system in the hard disk. 6. bfs :--- The boot file systemThis is used by SVR4 to host the boot programs and the UNIX kernel. Users are not meant to use this file system.

7. proc or procfs :---This can be considered a pseudo-file system maintained in memory. It stores data of each running process and appears to contain files. But actually contains none. Users can obtain most process information including their PIDs. directly from here. 8 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 Windowstype 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:

QUE4. 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 within 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.

Rlo gind 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 thePRi 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 wat executed.

QUE5. With proper syntax to explain the use of chmod command. ANS:-- File and directory permissions can only be modified by their owners, or by the super
user (root),by using the chmod system utility. chmod (change [file or directory] mode) $ chmod options files chmod accepts options in two forms. Firstly, permissions may be specified as a sequence of 3 octal digits (octal is like decimal except that the digit range is 0 to 7 instead of 0 to 9). Each octal digit represents the access permissions for the user/owner, group and others respectively. The mappings of permissions onto their corresponding octal digits is as follows:

For example the command: $ chmod 600 private.txt sets the permissions on private.txt to rw------- (i.e. only the owner can read and write to the file). Permissions may be specified symbolically, using the symbols u (user), g (group), o (other), a (all), r (read), w (write), x (execute), + (addpermission), (take away permission) and = (assign permission). For example, the command: $ chmod ug=rw,o-rw,a-x *.txt sets the permissions on all files ending in *.txt to rw-rw---- (i.e. the owner and users in the file's group can read and write to the file, while the general public do not have any sort of access).chmod also supports a -R option which can be used to recursively modify file permissions, e.g. $ chmod -R go+r play will grant group and other read rights to the directory play and all of the files and directories within play. chgrp (change group) $ chgrp group files can be used to change the group that a file or directory belongs to. It also supports a -R option.

Você também pode gostar