Disk Device Specification

Memory Layout

Byte Mode Name Description
00-03 R Status Status register, is negativ if an error occured, 0 if idle, 1 if bussy.
04-07RWControl Controll register, write to initiate disk operations
08-0F R Capacity Total number of sectors of the disk
10-17 RW Sector sector number of the first sector to be transferred in the next command
18-1FRW Count number of disk sectors to be transferred in the next command.
20-27RW DMA0.addressphysical address of first buffer where the next transfer takes place
28-2F RW DMA0.size size of first buffer where the next transfer takes place
... RW DMA1-14 more DMA address and size registers
110-117 RW DMAf.address physical address of 16th and last buffer where the next transfer takes place
118-11F RW DMAf.size size of 16th and last buffer where the next transfer takes place

Operation

The program will contact the motherboard at [host:]port and register itself with the given address and interrupt.

The disk simulates a disk controller and the disk proper by using a file of an appropriate size and organization on the host system. The file is read into memory and reread after a RESET or a Power ON. It is considered as a disk immage, that is organizes as a sequence of 512 byte blocks. Disk images can be modified by mounting them as loopback filesystems under Unix with the mount command, or by using the ImDisk Tool under windows.

The disk understands two commands:

The amount of data transferred is specified as an integral number of sectors. The size of a sector size is fixed at 512 bytes. The number of sectors to read or write is given to the controller in the count register. The position of the starting sector on the disk is given to the controller in the sector register. The disk sectors are numbered starting at 0 through (and including) the capacity of the disk minus one. The number of sectors on the disk can be read by software from the capacity register.

The memory buffers from where data is read in a write operation or to where data is written in a read operation is determined by the contents of the 16 DMA register. Each DMA register consists of an address and a size register. It holds the physical address of the buffer and its size. Several buffers can be used in a scatter or gather IO operation. This means that the IO operations view the content of the 16 DMA buffers as one consecutive data area, as if the buffers would have been concatenated. For example a write operation with gather its data first from buffer number one then from buffer number two, and so forth until the number of sectors requested are written or the buffers are all written. A read operation will scatter the sectors read from disk by filling the first buffer and then the second, until all disk sectors are written to memory or the bufferes are all filled.

The 3 low order bits of the control register are used to control the disk. These bits are from low order to high order:

The status register is read only. Only two bit are significant, the first and the last.

Tesing the status register, there are three typical values: negative means error, 1 meand bussy, 0 means idle.

Configuration

The disk has the following configurable parameters:
host localhost the host where the bus is located
port 9002 the port where the bus is located
address default address where the resource is located
interrupt not set interrupt sent when character is ready
file not set Name of the file containing the disk image
x 0the x position of the window
y 0the y position of the window
minimized falsestart with a minimized window
debug falseto generate debug output
debugmask 0xFFF0 set mask to hide debug output
verbose falsemake debugging verbose, sets debug mask to zero
define not setto define a name for conditionals
config not setfilename for a configuration file
help falseto print information

These can be set in default.vmb