haker
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Disk

Device Type: 0x0004

Disk is a persistent storage device. A disk is divided into data sectors, each of identical size and individually addressable.

Sector size can be 0-65535. While the sector size can be arbitrary, it should be practical as well, because any read or write operation will require at least one sector size of memory for a buffer. So for example, sector size of 32768 would require half of WOPR memory. The most common sector size is 256.

Number of sectors can also be 0-65535. Size 0 is reserved. Note that when addressing sectors, sector number is zero based, meaning the first sector is 0.

GETINFO 0x100

GETINFO command has no parameters. It returns two values: P1 - sector count P0 - sector size

READ 0x101

READ will read a single sector of data from the disk and store it into specified memory location.

Parameter Meaning
P1 buffer address
P0 sector number; zero based
Result Meaning
P0 result code; 0 on success

WRITE 0x102

WRITE will write a single sector of data to the disk from the specified memory location.

Parameter Meaning
P1 buffer address
P0 sector number; zero based
Result Meaning
P0 result code; 0 means success

Result Codes

Code Description
0 OK, success
1 invalid sector number; disk does not have the as many sectors as requested
2 hardware error; there is a physical problem with the disk