Josh Smallman
CS 110
Homework Assignment 1
Due Saturday, September 11, 9PM
Formatter: HTML
-
Define the essential properties of the following types of operating systems: Batch, Interactive, Time Sharing, Real Time, and Distributed.
Batch: In a batch system, you'd collect a group of jobs, have one computer (like the 1401, which is good at doing card-reading and printing) read the cards and put the jobs onto tape. Then, the tape would be put into a computer more suited for calculations, like the 7094. That computer would then run the programs, and put it's output onto tape, at which point the output tape would be taken to the 1401, which would print out the output offline.
Interactive:
Time Sharing: In a time sharing operating system, each user has a terminal, and the operating system allocates the CPU to whoever needs it, since most of the time the users only use short commands or are idle.
Real Time:
Distributed: A multi-processor system, which appears to the user as a single processor system. Distributed systems can also have programs run on more than one processor at a time.
What are the differences between a trap and an interrupt? What is the use of each function?
A trap is a protected procedure call which is used starts the operating system. An interrupt is a signal used for process to process communication, when the processes need to quickly talk to each other.
Tanenbaum #6, pg 26,
Which of the following instructions should be allowed only in kernel mode?
1. Disable all interrupts
2. Read the time-of-day clock
3. Set the time-of-day clock
4. Change the memory map
1, 3, and 4.
Tanenbaum #12, pg 26,
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 need in a timesharing system so that the multitude of processes that need to be run can be stored somewhere when they need to be taken off the processor. Then, when it's time to run the process again, it's exact state is known, so it can start back from where it left off. If, in a personal computer system, only one process exists, then there is no need for a process table, since there is only one process, and therefore there would be no reason to suspend it and store it for later retrieval.
Tanenbaum #3, pg 71,
Explain the difference between busy waiting and blocking.
Busy waiting is when a process continually tests a variable, looking for some value to appear in the variable. Blocking is sometimes done by the SLEEP call, which suspends a process, so that the CPU isn't wasted while the process is waiting for something, like busy waiting does.