cs240 computer science ii introduction to unix based on “unix for programmers and users” by...
TRANSCRIPT
![Page 1: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/1.jpg)
CS240 Computer Science II
Introduction to
UnixBased on “UNIX for Programmers and Users” by G.Class and K. Ables
![Page 2: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/2.jpg)
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.
![Page 3: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/3.jpg)
Hardware resources
• CPU• RAM, ROM• Disk, CD-ROM drive, tape• Monitor, printer• Graphics card• Keyboard, mouse• Modem• Ethernet interface• Other peripherals
![Page 4: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/4.jpg)
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
![Page 5: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/5.jpg)
A typical Unix Files System(Sun Microsystems Solaris)
![Page 6: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/6.jpg)
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
![Page 7: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/7.jpg)
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).
![Page 8: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/8.jpg)
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.
![Page 9: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/9.jpg)
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)
![Page 10: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/10.jpg)
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.
![Page 11: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/11.jpg)
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.
![Page 12: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/12.jpg)
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
![Page 13: CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables](https://reader036.vdocument.in/reader036/viewer/2022081008/56649e525503460f94b47ff7/html5/thumbnails/13.jpg)
Evolution of UNIX
• p11