Hardware Reference
In-Depth Information
Logical
record
number
14
15
1 logical
record
15
16
16
17
18
19
20
21
22
23
24
25
17
18
19
20
21
22
23
24
25
26
Next logical
record to be
read
Next logical
record to be
read
Main memory
Main memory
Logical
record 18
Logical
record 19
Buffer
Buffer
(a)
(b)
Figure 6-20. Reading a file consisting of logical records.
(a) Before reading
record 19. (b) After reading record 19.
The basic virtual output instruction writes a logical record from memory onto a
file. Consecutive sequential write instructions produce consecutive logical records
on the file.
6.3.2 Implementation of OSM-Level I/O Instructions
To understand how virtual I/O instructions are implemented, we need to exam-
ine how files are organized and stored. A basic issue that must be dealt with by all
file systems is allocation of storage. The allocation unit (sometimes called a block)
can be a single disk sector, but often it consists of a block of consecutive sectors.
Another fundamental property of a file-system implementation is whether a
file is stored in consecutive allocation units or not. Figure 6-21 depicts a simple
disk with one surface consisting of five tracks of 12 sectors each. Figure 6-21(a)
shows an allocation scheme in which the sector is the basic unit of space allocation
and in which a file consists of consecutive sectors. Consecutive allocation of file
blocks is commonly used on CD-ROMs. Figure 6-21(b) shows an allocation
scheme in which the sector is the basic allocation unit but in which a file need not
occupy consecutive sectors. This scheme is the norm on hard disks (and, of
course, solid state disks).
There is a key distinction between the application programmer's and the oper-
ating system's view of a file. The programmer sees the file as a linear sequence of
 
 
Search WWH ::




Custom Search