Lines Matching +full:block +full:- +full:number
1 .\" Copyright (C) Caldera International Inc. 2001-2002. All rights reserved.
37 .EH 'PSD:3-%''The UNIX I/O System'
38 .OH 'The UNIX I/O System''PSD:3-%'
61 in the paper ``The UNIX Time-sharing System.''
74 .I block
77 The block interface is suitable for devices
79 which work, or can work, with addressible 512-byte blocks.
83 backward spacing any block can be read, even though
85 Block devices can at least potentially contain a mounted
87 The interface to block devices is very highly structured;
91 Character-type devices have a much
99 device number.
101 with the minor device number
102 in the low-order 8 bits and the major device number
103 in the next-higher 8 bits;
109 The major device number selects which driver will deal with
110 the device; the minor device number is not used
113 Typically the minor number
118 The major device numbers for block and character devices
134 which is stored in the system's per-process
152 which is a per-system data base.
160 This table is per-system because the same instance
173 There is also a 32-bit file offset
180 which contains a copy of the file's i-node.
208 is a special file containing a currently-mounted
214 corresponding i-node as stored on the disk;
220 and the device and i-number
222 Also, the several block numbers that give addressing
224 the 3-byte, compressed format used on the disk to full
237 the data-terminal-ready lead of a modem, etc.).
243 that is, when the i-node table entry
249 implement an exclusive-use device which cannot
267 of the I/O target area, the byte-count for the transfer,
270 a character-type special file, the appropriate read
276 a logical block number in the file.
277 If the file is an ordinary file the logical block
278 number must be mapped (possibly using indirect blocks)
279 to a physical block number; a block-type
284 In any event, the resulting physical block number
295 open, close, read, write, and special-function
304 on non-exclusive devices that require no setup)
312 on read-only devices)
325 is opened with the full device number as argument.
327 non-zero only if the device is to be written upon.
337 The first argument is the device number;
338 the second is a flag which is non-zero
347 The per-user variable
350 the number of characters indicated by the user;
351 for character devices, this number may be 0
394 a probably large number of characters into an internal
412 the count is not too large and is non-zero.
427 is guaranteed to be non-zero.
445 The ``special-functions'' routine
456 is the device number,
475 Finally, each device should have appropriate interrupt-time
477 When an interrupt occurs, it is turned into a C-compatible call
479 The interrupt-catching mechanism makes
480 the low-order four bits of the ``new PS'' word in the
485 to encode the minor device number.
490 A number of subroutines are available which are useful
496 For relatively low data-rate devices, the best mechanism
522 which returns either the (non-negative) character
534 to device handlers is the sleep-wakeup mechanism.
541 at that time, the process is marked ready-to-run
555 by the sleeper and the waker-up.
566 a higher numerical value indicates a less-favored
595 (for example, a device going on-line, which does not
610 If a device needs to know about real-time intervals,
623 to provide real-time delays after function characters
624 like new-line and tab in typewriter output,
628 if there is no response within a specified number
630 Notice that the number of sixtieths of a second is limited to 32767,
632 and that only a bounded number of timeouts
636 is called at clock-interrupt time, so it should
640 The Block-device Interface
642 Handling of block devices is mediated by a collection
646 that several processes that access the same block of the same
648 view of the data in the block.
651 keeping in-core copies of blocks that are being
658 which maintain a doubly-linked list
660 block device, and a
663 which generally maintain a doubly-linked list of blocks
669 also contains the device and block number to which the
673 which is the negative of the number of words
685 Given a device and block number,
690 return a pointer to a buffer header for the block;
694 current data for the block,
698 block only if it is already in core (whether it is
703 device block, is made ``busy,''
708 when a block is about to be totally rewritten,
711 still, no other process can be allowed to refer to the block
716 routine is used to implement read-ahead.
719 but takes as an additional argument the number of
720 a block (on the same device) to be read asynchronously
721 after the specifically requested block is available.
731 There are three subtly-different write routines,
749 data from some other block, the data in it will
757 it is used, for example, when updating i-nodes.
771 block, on the assumption that
774 will be given soon which will re-use the same block.
776 as the end of a block is passed,
778 is called, since probably the block will
786 dedicate the given block exclusively to the
792 must eventually be called to free the block for use by others.
798 block I/O system, it is important to understand these flags.
813 to 0 when a block is handed to the device strategy
819 buffer actually contains the data in the requested block.
827 if it is non-zero.
834 whereby a more detailed error-reporting
848 block with this bit on, it sleeps until the bit
866 Conversely, when the block is freed and the busy bit
871 is given for the block header whenever
885 used when the caller judges that the same block will not soon be used again.
908 while searching for a free block,
910 it causes the block to be written out before reusing it.
912 Block Device Drivers
917 and that of a table for each block device.
919 Just as for character devices, block device drivers may supply
928 each block device driver has a
934 the block number, a (negative) word count,
935 and the major and minor device number.
952 is capable, under error-free operation,
954 the device's word-count register should be placed
990 except for the buffer-chain pointers.
998 in the simplest case it may be maintained as a first-in
999 first-out list.
1009 are provided which are useful to block device drivers.
1027 It may be called only in the non-interrupt
1032 Raw Block-device I/O
1034 A scheme has been set up whereby block device drivers may
1039 The method involves setting up a character-type special file
1046 non-shared buffer header with the appropriate information
1053 A special-function routine might come in handy, especially for
1068 the device number
1070 and a read-write flag