Das – Chapter 1

A computer needs an operating system (OS) to allocate memory, schedule programs, and control devices. The UNIX system also provides a host of applications for the use of programmers and users.

Multiprogramming systems like UNIX allow multiple programs to reside in memory. Even though a program may run for the duration of the time slice allocated for it, it may prematurely leave the CPU during a blocking operation (like reading a file) that keeps the CPU idle.

You enter a UNIX system by entering a user-id and a password. You can terminate a session by using the exit or logout command or pressing [Ctrl-d].

UNIX commands are generally in lowercase. date displays the system date and time. who displays the list of users logged on to the system. ps lists all processes running at a terminal. It always shows the shell process running.

You can display a tile with cat, copy it with cp, rename it with mv, and remove it with rm.

mkdir creates a directory, pwd displays the pathname of the current directory, and cd changes the current directory. rmdir removes an empty directory.

UNIX was developed at AT&T Bell Laboratories by Ken Thompson and Dennis Ritchie. It was finally written in C. Notable work was also done at Berkeley. AT&T introduced System V Release 4 (SVR4) to merge their own version, Berkeley, and other variants.

Linux is a UNIX implementation that is constantly growing with contributions from the Free Software Foundation (formerly, GNU).

Modifications to the system made by vendors led to both enhancement and fragmentation of UNIX. Two merged standards, POSIX and the Single UNIX Specification, are today used as guidance for development work on UNIX,

All work is shared by the kernel and shell. The kernel manages the hardware, and the shell interacts with the user. The shell and applications communicate with the kernel using system calls, which are special routines built into the kernel.

The file and process are the two basic entities that support the UNIX system. UNIX considers everything as a file. A process represents a program (a file) in execution.

UNIX is a multiuser and multitasking system. Several users can use the system together, and a single user can also run multiple jobs concurrently.

UNIX uses a building-block approach in the design of some of its tools and lets you develop complex command routines by connecting these tools.

The UNIX man command is the primary online help facility available.

Self-Test

  1. The ________ interacts with the hardware, and the _____________ interacts with the user.

  2. A program is synonymous with a process. True or false?

  3. Every character has a number associated with it. What is it called?

  4. If you see a prompt like mailhost login:, what do you think mailhost represents?

  5. If the system echoes Login incorrect, does it mean that your user-id is incorrect?

  6. Name the commands you used in this chapter to display (i) filenames, (ii) processes, (iii) users.

  7. Run ps and note the PID of your shell. Log out and log in again, and run ps again. What do you observe?

  8. Create two files, foo1 and foo2, with the echo command, and then use cat foo1 foo2. What do you observe?

  9. Now run the command cat foo [12], and note your observations.

  10. Enter the command echo SHELL. What mistake did you make?

  11. Create a file foo containing the words hello dolly. Now create a directory bar, and then run mv foo bar. What do you observe when you run both 1s and 1s bar?

  12. Who are the principal architects ofthe UNIX operating system?

  13. Why did AT&T virtually give away UNIX to the world?

  14. Where did BSD UNIX originate? Name some features of UNIX that were first found in BSD UNIX.

  15. Which flavor of UNIX is available for free and runs on the PC?

  16. Identify the companies associated with the following brands: (i) Solaris, (ii) AIX, (iii) Tru64 UNIX.

  17. What does X/OPEN represent? Who owns the UNIX trademark today?

  18. Who are the two brains behind Linux?

  19. What is the distinctive characteristic about the GNU General Public License?

  20. Why is UNIX more portable than other operating systems?

  21. Can you divide UNIX into two major schools? To which school does Sun's UNIX belong?

  22. Why do UNIX tools perform simple jobs rather than complex ones?

  23. What is the windowing system of UNIX known as?

  24. Name some interpretive languages available on UNIX systems.

  25. Name three notable Linux flavors.

Exercises

  1. Operating systems like UNIX provide services both for programs and users. Explain.

  2. What does a program do when it needs to read a file?

  3. Does a program always complete its time quantum before it makes way for another program?

  4. Explain the significance of the terms multiprogramming, multiuser, and multitasking.

  5. Why are UNIX commands noninteractive, and why is their output not usually preceded by header information?

  6. What are system calls, and what role do they play in the system? How is C programming so different and powerful in the UNIX environment compared to Windows?

  7. Two UNIX systems may use the same system calls. True or false?

  8. Name the three commands that you would try in sequence to log yourself out of the system. Which one of them will always work?

  9. Run the following commands, and then invoke ls. What do you conclude? echo > README[enter] echo > readme[enter]

  10. Enter the following commands, and note your observations: (i) who and tty, (ii) tput clear, (iii) id, (iv) ps and echo $$.

  11. When you log in, a program starts executing at your terminal. What is this program known as? Name four types of this program that are available on a system.

  12. What is the significance of your user-id? Where in the system is the name used?

  13. What are the two schools of UNIX that initially guided its development? Mention the outcome of the standardization efforts that are currently in force today.

  14. Create a directory, and change to that directory. Next, create another directory in the new directory, and then change to that directory too. Now, run cd without any arguments followed by pwd. What do you conclude?

  15. Why is the shell called a command interpreter?

  16. What is the one thing that is common to directories, devices, terminals, and printers?


Maintained by John Loomis, last updated 17 January 2010