Αρχική ΑΕΠΠ - Δομές Δεδομένων Λειτουργικά Συστήματα Δίκτυα Υπολογιστών ΙΙ Βάσεις Δεδομένων Παιδαγωγικά - Διδακτική
Εισαγωγή στα Λ.Σ. Βασικές Δομές Η/Υ Βασικές Δομές Λ.Σ
Διεργασίες Χρονοπρογραμματισμός Συγχρονισμός
Μονοπρογραμματισμός Εναλλαγή Εικονική Μνήμη Κατάτμηση
In Computer Systems Structure we discusses the general structure of computer systems. It may be a good idea to review the basic concepts of machine organization and assembly language programming. The students should be comfortable with the concepts of memory, CPU, registers, I/O, interrupts, instructions, and the instruction execution cycle. Since the operating system is the interface between the hardware and user programs, a good understanding of operating systems requires an understanding of both hardware and programs.
How is an interrupt executed?
The I/O driver sends a signal through a special interrupt line to the CPU when it has finished with an I/O request.
What is an interrupt vector?
A list giving the starting addresses of each interrupt service routine.
In what ways do systems treat slow and fast devices differently?
For slow devices, each character transferred causes an interrupt. For fast devices, each block of characters transferred causes an interrupt.
What is DMA?
Direct Memory Access (DMA) allows transfers of blocks of data between memory and I/O devices without intervention of the CPU, by making the transfers in between CPU instruction executions (called “interleaving”).
List some special problems a programmer must concern himself with while writing I/O routines with buffers.
Can’t allow interrupt to occur while moving a record into or out of a buffer. Can’t transfer data into a filled buffer. Can’t transfer data out of an empty buffer.
List operations that the monitor considers illegal, and describe why each must be considered illegal.
What resources must be protected by the operating system?
I/O, the monitor, memory, CPU
Describe the magnetic properties of disks.
Disks are flat circular-shaped platters with magnetic material on both surfaces. They have concentric tracks where information is stored. Each track is divided up into sectors. The disks spin to allow read/write heads to access each part, typically 5 rev/sec for coppies to 60 rev/sec for hard disks.
List kinds of disks.
What is a sector? track?
Sector — smallest block that can be read or written on a disk. Track — collection of sectors all on same circumference on a single surface.
What is a disk controller?
A separate board installed in the computer chassis to control and interact with each disk drive attached to it.
What is a drum?
Effectively, a single disk with only one cylinder. It is a cylinder-shaped box that revolves on its axis, with the read/write surface around the circumference, with many tracks all of the same radius.
How does the operating system determine what mode it is in?
One bit gives the present state — the monitor/user-mode bit.
List ways a user can take control of a system if memory is not protected.
How can we prevent users from accessing other users’ programs and data?
Introduce base and limit registers that hold the smallest legal physical memory address, and the size of the range, respectively. As a user’s job is started, the operating system loads these registers; if the program goes beyond these addresses, it is aborted. If another job starts up, these registers are reset for the new job.
How can the operating system detect an infinite loop in a program?
A timer (hardware) is added to system. Each user is allowed some predetermined time of execution (not all users are given same amount). If user exceeds these time limits, the program is aborted via an interrupt.
List some categories of privileged instructions.
Prefetching is a method of overlapping the I/O of a job with that job’s own computation. The idea is simple. After a read operation completes and the job is about to start operating on the data, the input device is instructed to begin the next read immediately. The CPU and input device are then both busy. With luck, by the time that the job is ready for the next data item, the input device will have ?nished reading that data item. The CPU can then begin processing the newly read data, while the input device starts to read the following data. A similar idea can be used for output. In this case, the job creates data that are put into a buffer until an output device can accept them. Compare the prefetching scheme with the spooling scheme, where the CPU overlaps the input of one job with the computation and output of other jobs.
Prefetching is a user-based activity, while spooling is a system-based activity. Spooling is a much more effective way of overlapping I/O and CPU operations.
How does the distinction between monitor mode and user mode function as a rudimentary form of protection (security) system?
By establishing a set of privileged instructions that can be executed only when in the monitor mode, the operating system is assured of controlling the entire system at all times.
What are the differences between a trap and an interrupt? What is the use of each function?
An interrupt is a hardware-generated change-of-?ow within the system. An interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction. A trap is a software-generated interrupt. An interrupt can be used to signal the completion of an I/O to obviate the need for device polling. A trap can be used to call operating system routines or to catch arithmetic errors.
For what types of operations is DMA useful? Explain your answer.
DMA is useful for transferring large quantities of data between memory and devices. It eliminates the need for the CPU to be involved in the transfer, allowing the transfer to complete more quickly and the CPU to perform other tasks concurrently.
Which of the following instructions should be privileged?
The following instructions should be privileged:
Some computer systems do not provide a privileged mode of operation in hardware. Consider whether it is possible to construct a secure operating system for these computers. Give arguments both that it is and that it is not possible.
An operating system for a machine of this type would need to remain in control (or monitor mode) at all times. This could be accomplished by two methods:
Some early computers protected the operating system by placing it in a memory partition that could not be modified by either the user job or the operating system itself. Describe two difficulties that you think could arise with such a scheme.
The data required by the operating system (passwords, access controls, accounting information, and so on) would have to be stored in or passed through unprotected memory and thus be accessible to unauthorized users.
Protecting the operating system is crucial to ensuring that the computer system operates correctly. Provision of this protection is the reason behind dual-mode operation, memory protection, and the timer. To allow maximum flexibility, however, we would also like to place minimal constraints on the user. The following is a list of operations that are normally protected. What is the minimal set of instructions that must be protected?
The minimal set of instructions that must be protected are:
When are caches useful? What problems do they solve? What problems do they cause? If a cache can be made as large as the device for which it is caching (for instance, a cache as large as a disk), why not make it that large and eliminate the device?
Caches are useful when two or more components need to exchange data, and the components perform transfers at differing speeds. Cahces solve the transfer problem by providing a buffer of intermediate speed between the components. If the fast device ?nds the data it needs in the cache, it need not wait for the slower device. The data in the cache must be kept consistent with the data in the components. If a component has a data value change, and the datum is also in the cache, the cache must also be updated. This is especially a problem on multiprocessor systems where more than one process may be accessing a datum. A component may be eliminated by an equal-sized cache, but only if: a) the cache and the component have equivalent state-saving capacity (that is, if the component retains its data when electricity is removed, the cache must retain data as well), and b) the cache is affordable, because faster storage tends to be more expensive.
Writing an operating system that can operate without interference from malicious or un-debugged user programs requires some hardware assistance. Name three hardware aids for writing an operating system, and describe how they could be used together to protect the operating system.
Copyright 2008 - Άρης Φεργάδης