Editing the CBIOS
The cbios is used to tell the CP/M operating system about your hardware. It contains routines (i.e. drivers) for your hardware. In my case I have software serial I/O and FRAM (i.e. flash) disks.
The only thing I have to change for the serial I/O is the interrupt vector (from RST6.5 to RST7.5).
The flash disk configurations and the read/write drivers.
The Disk Parameters
Using the CPM_2_0_System_Alteration_Guide,pdf as a guide I have recalculated the "standard floppy" for CP/M machines:
CP/M Disk Parameter Calcs | |||||||||
|
Standard |
|
|||||||
Bytes/Sector | 128 | Record size | |||||||
Sectors/Track | 26 |
|
|||||||
Tracks | 77 | Tracks | |||||||
|
|
|
|||||||
Disk Capacity | 250.25 | Disk Capacity kb | |||||||
SYS | 2 | System Tracks | |||||||
TRK | 75 | User Tracks | |||||||
CAP | 243.75 | Storage Capacity kb | |||||||
n | 10 | n = 10 to 14 | |||||||
BLS | 1,024 | BLS = 2**n | |||||||
|
|
|
|||||||
SPT | 26 | Sectors | |||||||
BSH | 3 | BSH = n-7 | |||||||
BLM | 7 | BLM = 2**BSH - 1 | |||||||
EXM | 0 | EXM = 2**(BSH-3) - 1 if DSM<256 | |||||||
|
|
EXM = 2**(BSH-4) - 1 if DSM>=256 | |||||||
DSM | 242 | DSM = maximum data block number | |||||||
DRM | 63 | Directory Mask: DRM=BLS/16 | |||||||
BLOCKS | 32 |
|
|||||||
AL0 | 192 |
|
|||||||
AL1 | 0 |
|
|||||||
|
|
|
|||||||
|
Standard Floppy |
DISK PARAMETER BLOCK: | |||||||
SPT | 26 | SECTORS PER TRACK | |||||||
BSH | 3 | BLOCK SHIFT FACTOR | |||||||
BLM | 7 | BLOCK MASK | |||||||
EXM | 0 | EXTENDED BLOCK MASK | |||||||
DSM | 242 | DISK SIZE-1 | |||||||
DRM | 63 | DIRECTORY SIZE-1 | |||||||
AL0 | 192 | ALLOC 0 | |||||||
AL1 | 0 | ALLOC 1 | |||||||
CKS | 16 | CHECK SIZE | |||||||
OFS | 2 | SYSTEM TRACK OFFSET |
For the 8*256kb Flash I want 128 directory entries. Therefore I need a BLOCK size of 2048 bytes. Here are the parameters for the system disk A:
CP/M Disk Parameter Calcs | |||||||||
|
256k System |
|
|||||||
Bytes/Sector | 128 | Record size | |||||||
Sectors/Track | 16 |
|
|||||||
Tracks | 128 | Tracks | |||||||
|
|
|
|||||||
Disk Capacity | 256 | Capacity kb | |||||||
SYS | 4 | System Tracks | |||||||
TRK | 124 | User Tracks | |||||||
CAP | 248.00 | Capacity kb | |||||||
n | 11 | n = 10 to 14 | |||||||
BLS | 2,048 | BLS = 2**n | |||||||
|
|
|
|||||||
SPT | 16 | Sectors | |||||||
BSH | 4 | BSH = n-7 | |||||||
BLM | 15 | BLM = 2**BSH - 1 | |||||||
EXM | 1 | EXM = 2**(BSH-3) - 1 if DSM<256 | |||||||
|
|
EXM = 2**(BSH-4) - 1 if DSM>=256 | |||||||
DSM | 247 | DSM = maximum data block number | |||||||
DRM | 127 | Directory Mask: DRM=BLS/16 | |||||||
BLOCKS | 32 |
|
|||||||
AL0 | 240 |
|
|||||||
AL1 | 0 |
|
|||||||
|
|
|
|||||||
|
256k System | DISK PARAMETER BLOCK: | |||||||
SPT | 16 | SECTORS PER TRACK | |||||||
BSH | 4 | BLOCK SHIFT FACTOR | |||||||
BLM | 15 | BLOCK MASK | |||||||
EXM | 1 | EXTENDED BLOCK MASK | |||||||
DSM | 247 | DISK SIZE-1 | |||||||
DRM | 127 | DIRECTORY SIZE-1 | |||||||
AL0 | 240 | ALLOC 0 | |||||||
AL1 | 0 | ALLOC 1 | |||||||
CKS | 0 | NOT REMOVEABLE | |||||||
OFS | 4 | SYSTEM TRACK OFFSET |
And the same for the data disk (B):
|
256k Data | DISK PARAMETER BLOCK: |
SPT | 16 | SECTORS PER TRACK |
BSH | 4 | BLOCK SHIFT FACTOR |
BLM | 15 | BLOCK MASK |
EXM | 1 | EXTENDED BLOCK MASK |
DSM | 255 | DISK SIZE-1 |
DRM | 127 | DIRECTORY SIZE-1 |
AL0 | 240 | ALLOC 0 |
AL1 | 0 | ALLOC 1 |
CKS | 0 | NOT REMOVEABLE |
OFS | 0 | SYSTEM TRACK OFFSET |
Note: CP/M does not need to check the disks are the media (Flash) cannot be removed while the power is on.
Edits done, files compile, so next is make a disk image and to load the image onto the Flash chips.
AlanX
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.