Overview of the Unix OS Operating Systems An

  • Slides: 29
Download presentation
Overview of the Unix OS

Overview of the Unix OS

Operating Systems An Operating System controls (manages) hardware and software. provides support for peripherals

Operating Systems An Operating System controls (manages) hardware and software. provides support for peripherals such as keyboard, mouse, screen, disk drives, … software applications use the OS to communicate with peripherals. The OS typically manages (starts, stops, pauses, etc) applications.

The UNIX Operating System • • Some computers have a single-user OS, which means

The UNIX Operating System • • Some computers have a single-user OS, which means only one person can use the computer at a time. They can also do only one job at a time. But if it has a multiuser, multitasking operating system like UNIX. Then these powerful OSes can let many people use the computer at the same time and let each user run several jobs at once.

UNIX • • • UNIX is multi-user and multi-tasking operating system. Multi-tasking: Multiple processes

UNIX • • • UNIX is multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Example, different users can read mails, copy files, and print all at once. 4

Unix and Users Most flavors of Unix (there are many) provide the same set

Unix and Users Most flavors of Unix (there are many) provide the same set of applications to support humans (commands and shells). Although these user interface programs are not part of the OS directly, they are standardized enough that learning your way around one flavor of Unix is enough.

Versions of UNIX • • Now there are many different versions of UNIX. At

Versions of UNIX • • Now there are many different versions of UNIX. At first there were two main versions: – – The line of UNIX releases that started at AT&T (the latest is System V Release 4), And from the University of California at Berkeley (the latest version is BSD 4. 4).

Versions of UNIX • • Now commercial versions include Sun. OS, Solaris, SCO UNIX,

Versions of UNIX • • Now commercial versions include Sun. OS, Solaris, SCO UNIX, SG IRIX, AIX, HP/UX The freely available versions include Linux and Free. BSD 5. 2 (based on 4. 4 BSD) – • Many Versions of Linux - Redhat, Fedroa, Debian, Su. SE and Mandrake. Soft Apple Mac OS X (Free. BSD 5. 2)

The power of Unix Open source, portability You can extend the basic functionality of

The power of Unix Open source, portability You can extend the basic functionality of Unix: customize the shell and user interface. string together a series of Unix commands to create new functionality. create custom commands that do exactly what we want.

Why do you need to care ? Good question! It is Windows’ world anyway.

Why do you need to care ? Good question! It is Windows’ world anyway. WRONG! A lot of servers are Unix-based. • Unix is older than Windows but yet it still has the old basic concepts. • Unix is considered to be “cleaner” than Windows in term of coding. • Unix is still more secured than Windows. • Most of network devices are Unix-based (e. g. routers, caches, mail servers, security servers). • You can find a job with good pay with Unix. •

Unix Features • Why is it so popular ? – Multitasking. – Multiuser. –

Unix Features • Why is it so popular ? – Multitasking. – Multiuser. – Portability. – Network applications. Natawut Nupairoj Assembly Language 10

Structure of the UNIX system

Structure of the UNIX system

Kernel (OS) Interacts directly with the hardware through device drivers Provides sets of services

Kernel (OS) Interacts directly with the hardware through device drivers Provides sets of services to programs, insulating these programs from the underlying hardware Manages memory, controls access, maintains file system, handles interrupts, allocates resources of the computer Programs interact with the kernel through system calls

Cont… • • • The interface to the kernel is a layer of software

Cont… • • • The interface to the kernel is a layer of software called the system calls. Libraries of common functions are built on top of the system call interface, but applications are free to use both. The shell is a special application that provides an interface for running other applications.

 • an operating system is the kernel and all the other software (applications,

• an operating system is the kernel and all the other software (applications, shells, libraries of common functions, and so on. ) that makes a computer useful and gives the computer its personality.

Files and Directories • File System : - The UNIX file system is a

Files and Directories • File System : - The UNIX file system is a hierarchical arrangement of directories and files. Everything starts in the directory called root whose name is the single character /.

Why File Systems • • • File system is a service which supports an

Why File Systems • • • File system is a service which supports an abstract representation of the secondary storage to the OS A file system organizes data logically for random access by the OS. A virtual file system provides the interface between the data representation by the kernel to the user process and the data

Cont. . • • • A directory is a file that contains directory entries.

Cont. . • • • A directory is a file that contains directory entries. Logically, we can think of each directory entry as containing a filename along with a structure of information describing the attributes of the file. The attributes of a file are such things as type of file regular , file directory, the size of the file, the owner of the file, permissions for the

19

19

Filenames • • The names in a directory are called filenames. The only two

Filenames • • The names in a directory are called filenames. The only two characters that cannot appear in a filename are the slash character (/) and the null character. The slash separates the filenames that form a pathname (described next) and the null character terminates a pathname.

Cont… • • • Two filenames are automatically created whenever a new directory is

Cont… • • • Two filenames are automatically created whenever a new directory is created: . (called dot) and. . (called dot-dot). Dot refers to the current directory, and dotdot refers to the parent directory. In the root directory, dot-dot is the same as dot.

Pathname • • • A sequence of one or more filenames, separated by slashes

Pathname • • • A sequence of one or more filenames, separated by slashes and optionally starting with a slash, forms a pathname. A pathname that begins with a slash is called an absolute pathname. Otherwise , it's called a relative pathname. Relative pathnames refer to files relative to the current directory.

Input and Output • • File Descriptors are normally small nonnegative integers that the

Input and Output • • File Descriptors are normally small nonnegative integers that the kernel uses to identify the files being accessed by a particular process. Whenever it opens an existing file or creates a new file, the kernel returns a file descriptor that we use when we want to read or write the file.

Standard Input, Standard Output, and Standard Error • • By convention, all shells open

Standard Input, Standard Output, and Standard Error • • By convention, all shells open three descriptors whenever a new program is run: standard input, standard output, and standard error. If nothing special is done, as in the simple command (LS).

Programs and Processes • • A program is an executable file residing on disk

Programs and Processes • • A program is an executable file residing on disk in a directory. A program is read into memory and is executed by the kernel as a result of one of the six exec functions. Processes An executing instance of a program is called a process. Process ID The UNIX System guarantees that every process has a unique numeric identifier

Signals • • Signals are a technique used to notify a process that some

Signals • • Signals are a technique used to notify a process that some condition has occurred. For example, if a process divides by zero, the signal whose name is SIGFPE (floating-point exception) is sent to the process.

 • 1. 2. The process has three choices for dealing with the signal.

• 1. 2. The process has three choices for dealing with the signal. Ignore the signal. This option isn't recommended for signals that denote a hardware exception, such as dividing by zero or referencing memory outside the address space of the process, as the results are undefined. Let the default action occur. For a divide-by-

 • • • Many conditions generate signals. Two terminal keys, called the interrupt

• • • Many conditions generate signals. Two terminal keys, called the interrupt key often the DELETE key or Control-C and the quit key often Controlback slash are used to interrupt the currently running process. Another way to generate a signal is by calling the kill function.

Programming Tools and Utilities Available under Linux • Text Editors Debuggers Click to edit

Programming Tools and Utilities Available under Linux • Text Editors Debuggers Click to edit the outline text C / format C++ debugger - gdb – Xemacs – Emacs – Pico – - Third Perl perl vi – Tcl/Tk - tcl & wish – • • Compilers – C compiler - gcc – C++ compiler - g++ – Java compiler & Java Virtual Machine - javac & java – • Second Outline Level Interpreters Level Fourth Outline Miscellaneous Level Web Browsers - Mozilla, Fifth Netscape, Firefox, and Lynx Outline (lynx is text based) Level Instant Messengers - Gaim Sixth • Outline – –

END • See next lectuer Click to edit the outline text format Second Outline

END • See next lectuer Click to edit the outline text format Second Outline Level Third Outline Level Fourth Outline Level Fifth Outline Level Sixth