Hardware Reference
In-Depth Information
6.3 OSM-LEVEL I/O INSTRUCTIONS
The ISA-level instruction set is completely different from the microarchitec-
ture instruction set. Both the operations that can be performed and the formats for
the instructions are quite different at the two levels. The occasional existence of a
few instructions that are the same at both levels is essentially accidental.
In contrast, the OSM-level instruction set contains most of the ISA-level in-
structions, with a few new, but important, instructions added and a few potentially
damaging instructions removed. Input/output is one of the areas where the two
levels differ considerably. The reason is simple: a user who could execute the real
ISA-level I/O instructions could read confidential data stored anywhere in the sys-
tem, write in other users' directories, and, in general, make a big nuisance of him-
self or herself and even threaten the security of the system itself. Second, normal,
sane programmers do not want to do I/O at the ISA level themselves because doing
so is extremely tedious and complex. It is done by setting fields and bits in a num-
ber of device registers, waiting until the operation is completed, and then checking
to see what happened. As an example of the latter, disks typically have device-reg-
ister bits to detect the following errors, among many others:
1. Disk arm failed to seek properly.
2. Nonexistent memory specified as buffer.
3. Disk I/O started before previous one finished.
4. Read timing error.
5. Nonexistent disk addressed.
6. Nonexistent cylinder addressed.
7. Nonexistent sector addressed.
8. Checksum error on read.
9. Write-check error after write operation.
When one of these errors occurs, the corresponding bit in a device register is
set. Few users want to be bothered keeping track of all these error bits and a great
deal of additional status information.
6.3.1 Files
One way of organizing the virtual I/O is to use an abstraction called a file .In
its simplest form, a file consists of a sequence of bytes written to an I/O device. If
the I/O device is a storage device, such as a disk, the file can be read back later; if
the device is not a storage device (e.g., a printer), it cannot be read back, of course.
 
 
 
Search WWH ::




Custom Search