This preview shows page 1. Sign up to view the full content.
Unformatted text preview: has space for more data. An interrupt from the serial line hardware device returns control to the operating system, which refills the transmit buffer before returning control to the interrupted process. Further interrupts result in further transfers until the whole buffer has been sent. It may be the case that the process which requested the serial line activity runs out of useful work, or an interrupt from a timer or another source causes a different process to become active. The operating system must be careful, when modifying the translation tables, to ensure that it does not make the data buffer inaccessible to itself. It must also treat any requests from the second process to output data down the serial line with caution; they must not interfere with the ongoing transfer from the first process. Resource allocation is used to ensure that there are no conflicts in the use of shared resources. A process may request an output function and then go inactive until the output has completed, or it may go inactive until a particular input arrives. It can lodge a request with the operating system to be reactivated when the input/output event occurs. 316 Architectural Support for Operating Systems 11.10 Example and exercises
Why, on the ARM, can user-level code not disable interrupts? To allow a user to disable interrupts would make building a protected operating system impossible. The following code illustrates how a malicious user could destroy all the currently active programs:
HERE MSR B CPSR_f, #&cO HERE Example 11.1 ; disable IRQ and FIQ ; loop forever Once interrupts are disabled there is no way for the operating system to regain control, so the program will loop forever. The only way out is a hard reset, which will destroy all currently active programs. If the user cannot disable interrupts the operating system can establish a regular periodic interrupt from a timer, so the infinite loop will be interrupted and the operating system can schedule other programs. This program will either time-out, if the operating system has an upper limit on the amount of CPU time it is allowed to consume, or it will continue to loop whenever it gets swit...
View Full Document
This document was uploaded on 10/30/2011 for the course CSE 378 380 at SUNY Buffalo.
- Spring '09