2019-10-27 18:06:31 +01:00
|
|
|
## Components
|
|
|
|
|
|
|
|
The BIOS is in the uppermost 2K of the memory area - it provides basic character and disk I/O functions.
|
|
|
|
It it expected to stay static and not be unloaded by the user program.
|
|
|
|
The BIOS may hook into interrupts if necessary to provide its functionality.
|
|
|
|
Depending on your hardware, a different BIOS binary may be used.
|
|
|
|
|
|
|
|
The BDOS is in the 2K below the BIOS, it provides a filesystem driver to work atop of the BIOS.
|
2019-10-27 18:07:41 +01:00
|
|
|
It is agnostic to the underlaying hardware configuration, but different depending on the instruction set.
|
2019-10-27 18:06:31 +01:00
|
|
|
A user program might overwrite memory up to the end of the BDOS.
|
|
|
|
Upon program exit, the BIOS will reload the BDOS from disk.
|
|
|
|
|
2019-10-08 12:22:31 +02:00
|
|
|
## Memory Layout
|
|
|
|
|
|
|
|
On a 8080, there are no segments, the addresses are as displayed.
|
|
|
|
|
|
|
|
On on the 8086, a single segment with a value of 0x0100 is assumed.
|
|
|
|
This implies that the first 4k of memory are not used.
|
|
|
|
|
2019-10-27 18:06:31 +01:00
|
|
|
The BIOS and FDOS may be recompiled for starting at a lower address, in this case,
|
2019-10-08 12:22:31 +02:00
|
|
|
the minimum memory requirement may be less than 64k.
|
|
|
|
|
|
|
|
|Start|Size|Function|
|
2019-10-08 12:23:28 +02:00
|
|
|
|--|--|--|
|
2019-10-27 18:06:31 +01:00
|
|
|
|0xF800|2k|BIOS / hw drivers|
|
|
|
|
|0xF000|2k|BDOS|
|
|
|
|
|...|...|BDOS data area, disk deblocking buffers|
|
2019-10-08 12:22:31 +02:00
|
|
|
|SP|var|Stack, growing down|
|
2019-10-27 18:06:31 +01:00
|
|
|
|...|...|Free memory|
|
|
|
|
|...|var|Heap, growing up|
|
|
|
|
|0x0100|var|Transient Program Area|
|
2019-10-08 12:24:36 +02:00
|
|
|
|0x0080|128 bytes|Command line and disk buffer|
|
2019-10-27 18:06:31 +01:00
|
|
|
|0x0008|120 bytes|BIOS data area|
|
|
|
|
|0x0000|8 bytes|BDOS data area|
|
2019-10-08 12:22:31 +02:00
|
|
|
|
|
|
|
## Application program interface
|
|
|
|
|
|
|
|
It is using the `call 5` convention with CP/M compatible syscall numbers.
|
|
|
|
|
|
|
|
File I/O is done via FCB blocks.
|
2019-10-20 21:57:10 +02:00
|
|
|
|
|
|
|
## Zero page
|
|
|
|
|
|
|
|
|Offset|Size|Usage|
|
|
|
|
|--|--|--|
|
2019-10-27 18:06:31 +01:00
|
|
|
|0x00|3 bytes|warm reboot/program exit jump instruction|
|
2019-10-20 21:57:10 +02:00
|
|
|
|0x03|byte|unused (would be iobyte)|
|
|
|
|
|0x04|byte|default drive|
|
|
|
|
|0x05|3 bytes|syscall jump instruction|
|
2019-10-27 18:06:31 +01:00
|
|
|
|0x08|120 bytes|interrupts and work area for BIOS|
|
2019-10-20 21:57:10 +02:00
|
|
|
|0x80|byte|length of command line|
|
|
|
|
|0x81|127 bytes|command line with $length bytes plus a trailing 0x0D|
|