UNIX Introduction
History
- written by Ken Thompson and Dennis Ritchie
- developed at Bell Laboratories, USA
- derived from multics (1969)
- Thompson developed a new programming language 'B'
- Ritchie enhanced 'B' to 'C' and helped develop 'UNIX'
- Ran on PDP-7
- Two flavours
SYSTEM V (Commercial, run by AT&T)
BSD (Educational, run by Bell Labs) - Recent developments are graphical interfaces
MOTIF
X Windows
Open View - Major suppliers today
Sun Microsystems (SPARC)
Data General (AVION)
IBM (RS6000 AIX)
Hewlett Packard
Santa Cruz Organization (SCO)
DEC
Main 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)
The UNIX Operating System
Consists of
Consists of
- kernel
schedules tasks
manages data/file access and storage
enforces security mechanisms
performs all hardware access - shell
presents each user with a prompt
interprets commands types by a user
executes user commands
supports a custom environment for each user - utilities
file management (rm, cat, ls, rmdir, mkdir)
user management (passwd, chmod, chgrp)
process management (kill, ps)
printing (lp, troff, pr)
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 programs run by each user.
Multi-Tasking Operating SystemsA 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 programs run by each user.
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 is an example of a 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 screen or keyboard). Background tasks are usually used for printing.
The UNIX File System
The file system refers to the way in which UNIX implements files and directories. In UNIX, a file system has the following features,
The file system refers to the way in which UNIX implements files and directories. In UNIX, a file system has the following features,
- hierarchical structure (support for directories)
- files are expandable (may grow as required)
- files are treated as byte streams (can contain any characters)
- security rights are associated with files and directories
(read/write/execute privledge for owner/group/others) - files may be shared (concurrent access)
- hardware devices are treated just like files
What is a file?
A file is a collection of information, which can be data, an application, documents; in fact, under UNIX, a file can contain anything. When a file is created, UNIX assigns the file a unique internal number (called an inode).
A file is a collection of information, which can be data, an application, documents; in fact, under UNIX, a file can contain anything. When a file is created, UNIX assigns the file a unique internal number (called an inode).
What is a file Link?
A file link is a directory entry which points to an original file somewhere else. A link is made to an existing file using the ln command.
A file link is a directory entry which points to an original file somewhere else. A link is made to an existing file using the ln command.
This creates a directory entry which points to the existing file (it does not make a copy of the existing file). This allows more than one reference to an exisiting file.
For instance, a person can give another access to a file and let them create a link to it. In this way they both can access and work with the same file, ensuring that the information they enter into the file is up-to-date.
Only the original owner of the file may delete the file.
What are the security rights associated with files and directories?
UNIX provides three sets of security rights for each file and directory entry. These sets are for the owner, the group to the owner belongs, and any other people on the system.
UNIX provides three sets of security rights for each file and directory entry. These sets are for the owner, the group to the owner belongs, and any other people on the system.
Each user belongs to a group (only one at a time). Group membership facilitates the sharing of common files. A user can change their membership to another group by using the newgrp command.
The security rights are
- read (read, display, copy the file contents)
- write (modify and append to the file contents)
- execute (run the file as a program)
The security bits are grouped as a series of three bits for each of the owner, group and other access rights.
Associated with each file, UNIX keeps the following information.
- location of the file (location of first 10 block numbers)
- size in bytes
- link count
- ownership
- security bits
- type (directory or file)
- creation date and time
- modification date and time
No comments:
Post a Comment