Operating System Questions

Valid XHTML 1.0!

OS Questions, Module 1

  1. Why was timesharing not widespread on second-generation computers?
    Timesharing is when each user has an online terminal. And the reason it was not widespread on second-generation computers is because it could only run one job at a time. Suppose that instead of one printer which printed out all data, that a batch system could be construed in which a department of 20 users could use the system simultaneously and each have there own printer which to collect the output. If this were so, each user would need to submit their cards (programs) then have it transferred to a tape. From there the tape would be fed into the computer, and as one job completed the next job would start and run until hopefully completion; and so on until finished. So in the scenario each individual would have to wait in line for his or her output. But with the third generation operating systems, multiprogramming allowed for the portioning of memory allowing the concurrent processing of multiple jobs. So as one user was waiting for the printing to end, another may have some computational work done in the CPU, and even another may simultaneously maybe ready to begin printing.
  2. Why is the process table needed in a timesharing system? Is it also needed in personal computer systems in which only one process exists, that process taking over the entire machine until it is finished?
    The process table is needed in timesharing because the process table's duty is to save information about a particular job so that it can run properly. The sort of information that is needed comprises of (Tanenbaum, 2001) the process's state, its program counter, stack pointer, memory allocation, the status of its open files, its accounting and scheduling information, and anything else about the process that must be saved when the process is switched from running to ready or blocked state so it can be restarted later as if it had never stopped. Now in a single CPU computer system where there is only one process there is no need for a process table. There should be no reason to start and stop processes, because there is only one process; so it seems to be a satisfactory solution for the computer system to operate at 100 percent of its usage.
  3. A computer has a pipeline with four stages. Each stage takes the same time to do its work, namely, 1 nsec. How many instructions per second can this machine execute?
    999,999,997 instructions for the first second and 1 billion instruction executions for each second greater than 1 in the pipeline.
  4. What is the key difference between a trap and an interrupt?
    (Tanenbaum, 2001) A trap switches the system call from the user mode to kernel mode and starts execution at a fixed address within the address. With an interrupt, (TechTarget, 2003) start down the list of computer instructions in one program (perhaps an application such as a word processor) and keep running the instructions until either (A) they can't go any further or (B) an interrupt signal is sensed. After the interrupt signal is sensed, the computer either resumes running the program it was running or begins running another program. The difference to me is that a Trap is takes away control of processes from the user, when needed. For example if the user opens the a MS Word file and begins to type, should that individual decide to save the file and type simultaneously, the kernel takes over and keyboard input is stopped until the save operation is complete. An interrupt is very similar, but here the interrupt can stop a whole program to allow another to run. They seem very similar, but multitasking is where the user to perform more than one computer task. With Trap, only program is run, so there is no multitasking by the individual. But with an Interrupt, the user can be multiply programs coincidently, though what really is happening is the user is switching back and forth between those multiply programs.
  5. To a programmer, a system call looks like any other call to a library procedure. Is it important that a programmer know which library procedures result in system calls? Under what circumstances and why?
    Yes, in the case of the Unix family of operating systems it is important because the programmer may write a program which calls a library procedure which in turn makes the system call. Reason being is that if a program is written in 'C' the program will make a system call from the library procedure because the system call is normally written in assembly and the use of the library call through 'C' makes it easier for the programmer to create the code. Though things are much different with the Windows based operating systems. In the case of (Tanenbaum, 2001) Win 32 API (the Windows operating system, Windows Program Interface) the library procedures and the system calls are highly decoupled. So it is nearly impossible to determine what a system call is and what a user-space library procedure with Windows is, hence not important. But with other operating systems, in most cases the library procedure has the same name as the system call; if they are different then the programmer should know.
  6. Is there any reason why you might want to mount a file system on a nonempty directory? If so, what is it?
    (Tanenbaum, 2001) The mount system call allows two file systems to be merged into one. A common situation is to have the root file system containing the binary (executable) versions of the common commands and other heavily used files, on a hard disk.
  7. For each of the following system calls, give a condition that causes it to fail: fork, exec, and unlink.
    Unix Man Page and (OBJS, 2003)
    fork -
      1. The system lacked the necessary resources to create another process, or the system-imposed limit on the total number of processes under execution system-wide or by a single user.
      2. Another condition which could cause it to fail is insufficient storage space is available; if the process table is full, meaning there is not enough swap space.
    exec -
      1. may fail if the swap space is exhausted
      2. the number of bytes in the new process's argument list is greater than the system-imposed limit of ARG_MAX bytes
      3. an argument points to an illegal address
      4. a signal was caught during the execution of one of the functions in the exec family
    unlink -
      1. file permissions
      2. path argument points to an illegal address
      3. the named file does not exist or is a null pathname
      4. length too long
  8. Can the "count = write (fd, buffer, nbytes);" call return any value in count other than nbytes? If so, why?
    Yes, this system call can return a value of "-1" in count instead of nbytes if there is an invalid parameter or a disk error, in those cases "-1" is returned.
  9. Figure 1-23 (in your textbook) shows that a number of UNIX system calls have no Win32 API equivalents. For each of the calls listed as having no Win32 equivalent, what are the consequences for a programmer of converting a UNIX program to run under Windows?
    It will be impossible to convert everything so similar results are accomplished in Windows. Though WIN32 has calls that supposedly support for previous editions of Windows, they are not consistently classified as system calls or user-space library calls; they tend to change with each edition. For cases where there is no equivalent call such as mount, the programmer could instead create a sub folder tree off a node in the root system. A blue print of the Unix system would be efficient to have for migrating to Windows, but the migration would end at the flowchart. So it would be best to code from scratch and work around any areas, which do not coincide with the Unix implementations.
  10. What is the essential difference between a block special file and a character special file?
    (Tanenbaum, 2001) Special files are files that are needed so input/output devices appear to be files, so they correspond to a device entity. (Tanenbaum, 2001) Block special files are used to model devices that consist of a collection of random addressable disks, such as disks. Character special files are used to model printers, modems, and other devices that accept or output a character stream. So the difference is that block special files model collections of randomly addressable blocks, such as disks, and character special blocks read input from character streams, such as printers or modems.

Bibliography

Computer Science Department, SUNY: History of Operating Systems. Retrieved September 9, 2003, from http://faculty.sunygenesee.cc.ny.us/djehrhart/cis100/history/sld023.htm
Tanenbaum, A. (2001). Modern Operating Systems. pp. 1-132. Pearson Education.
The Open Group Base Specifications (2003). Retrieved September 9, 2003 from http://www.opengroup.org/onlinepubs/007904975/functions/fork.html
TechTarget (2003). Retrieved September 9, 2003 from http://searchwebservices.techtarget.com/sDefinition/0,,sid26_gci510687,00.html
TechTarget (2003). Retrieved September 9, 2003 from http://whatis.techtarget.com/definition/0,,sid9_gci212374,00.html

Next »




Updated: September 15, 2003; Joe Gakenheimer