The pa2-diskio.dsk batch disk is only 20 disk-blocks long, but the program it contains reads and writes disk block 511. Shouldn't those reads and writes fail with a bad block-number error? No, and the reason depends the difference between a disk block not presently existing and a disk block not ever possibly existing. A disk block with a negative number or a number at least the maximum number of blocks on the disk (Hardware.Disk.blockCount) can't ever exist. Attempts to access such a block should cause a bad block-number error. A disk block with a number at least zero but less than the maximum number of blocks on the disk could exist, even if it isn't actually on the disk at the time the block is accessed. In particular, a disk block with a number at least the number of blocks on the disk and less than the maximum possible number of blocks on the disk could exist, even if it doesn't actually appear on the disk. Accessing such a phantom disk block shouldn't cause a bad block-number error. There is no difficulty if the first access to a phantom disk block is a write, and a read is only slightly trickier: if the first access to a phantom disk block is a read, the disk block read contains undefined values, although the simulator returns a block of zeros.Received on Sun Mar 11 2012 - 12:29:05 EDT
This archive was generated by hypermail 2.2.0 : Sun Mar 11 2012 - 15:35:56 EDT