cs240 computer science ii introduction to unix based on “unix for programmers and users” by...

Post on 28-Dec-2015

213 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CS240 Computer Science II

Introduction to

UnixBased on “UNIX for Programmers and Users” by G.Class and K. Ables

What is Unix

• Unix is an operating system

• An operating system controls and manages all hardware and software resources of a computer system; it also coordinates the operation of the entire computer system.

Hardware resources

• CPU• RAM, ROM• Disk, CD-ROM drive, tape• Monitor, printer• Graphics card• Keyboard, mouse• Modem• Ethernet interface• Other peripherals

Software resources

Unix provides services for the creation, modification, and destruction of programs, files, and processes.

• File: have a owner; stores in directory or subdirectory organized in a hierarchical or tree structure

• Program: an executable file• Process: a program that is running

– Most processes read data from and write data to files

A typical Unix Files System(Sun Microsystems Solaris)

Sharing Resources

• UNIX facilities sharing resources– CPU: through “time slicing” (typically 1/10

sec)– RAM: through “paging” to run concurrently

multiple processes– Disk space: by dividing disk space into

numerous equal-sized “blocks”; a file is stored on one or more blocks

Communication

Components of a computer system communication among themselves, e.g.,

• a process may talk to – A graphics card to display data– A keyboard to get input

• A mail system may talk to other computers to send/receive mail

• Two processes need to talk to each other in order to collaborate on a single problem (known as inter-process communication).

Inter-process Communication

Some typical inter-process Communication mechanisms

• Pipe: a one-way medium speed data channel that allows two processes on the same machine to talk.

• Socket: a two-way high-speed channel that allows two processes on different machines to talk.

Utilities

• Standard Unix comes with at least 200 utility programs including– Compilers

– Text processing tools

– Spreadsheets

– Desk-top publishing

– Sorting utility

– Some shells programs

– Graphical user interface (GUI)

Programmer Support

• Internal software architecture is well documented

• Source code is open and available from the internet free of charge

• Programming languages such as C/C++, and program development tools such as debugger are within the reach of programmers.

UNIX is Standardized

Two main versions• System V Unix: Solaris• BSD (Berkeley Standard Distribution): HP-

UX, AIX (IBM)

Both groups tried to comply with a set of standards set by POSIX (Portable Operating System Interface) committee.

Philosophies of UNIX

• Written in C, highly portable

• Lean and mean: original UNIX was based on a small number of utilities; each utility does one thing and does it well.

• Utilities can be easily combined through “pipes” to perform more complex tasks

Evolution of UNIX

• p11

top related