CoBra - CP/M Operating System with 80 text columns visible
|
|
|
|
|
CP/M Loader - disassembled code |
Boot Sector - disassembled code |
> wine SAMdisk.exe view UTILS1.TD0 -c0 > UTILS1_systrk_hexdump.txt > wine SAMdisk.exe view UTILS1.TD0 -c1 >> UTILS1_systrk_hexdump.txt > wine SAMdisk.exe view UTILS2.TD0 -c0 > UTILS2_systrk_hexdump.txt > wine SAMdisk.exe view UTILS2.TD0 -c1 >> UTILS2_systrk_hexdump.txt > wine SAMdisk.exe view UTILS3.TD0 -c0 > UTILS3_systrk_hexdump.txt > wine SAMdisk.exe view UTILS3.TD0 -c1 >> UTILS3_systrk_hexdump.txt > wine SAMdisk.exe view UTILS4.TD0 -c0 > UTILS4_systrk_hexdump.txt > wine SAMdisk.exe view UTILS4.TD0 -c1 >> UTILS4_systrk_hexdump.txt > wine SAMdisk.exe view UTILS5.TD0 -c0 > UTILS5_systrk_hexdump.txt > wine SAMdisk.exe view UTILS5.TD0 -c1 >> UTILS5_systrk_hexdump.txt |
845e8f608cd9c609cc5ad8164c5a203a UTILS1_systrk_hexdump.txt 6d46d60edf4e075ce11d67faa4e1d664 UTILS2_systrk_hexdump.txt 845e8f608cd9c609cc5ad8164c5a203a UTILS3_systrk_hexdump.txt 845e8f608cd9c609cc5ad8164c5a203a UTILS4_systrk_hexdump.txt 845e8f608cd9c609cc5ad8164c5a203a UTILS5_systrk_hexdump.txt |
> wine SAMdisk.exe scan UTILS2.TD0 [UTILS2.TD0] 80 Cyls, 2 Heads: 250Kbps MFM, 6 sectors, 512 bytes/sector: 0.0 1[r] 1[r] 6 7 8 9 250Kbps MFM, 9 sectors, 512 bytes/sector: 1.0 1 2 3 4 5 6 7 8 9 2.0 1 2 3 4 5 6 7 8 9 3.0 1 2 3 4 5 6 7 8 9 . . . 79.0 1 2 3 4 5 6 7 8 9 250Kbps MFM, 9 sectors, 512 bytes/sector: 0.1 1 2 3 4 5 6 7 8 9 1.1 1 2 3 4 5 6 7 8 9 2.1 1 2 3 4 5 6 7 8 9 3.1 1 2 3 4 5 6 7 8 9 . . . 79.1 1 2 3 4 5 6 7 8 9 |
UTILS1_systrk_hexdump.txt | snapshot 0100-FFFF.hexdump |
0000: C3 03 DF 80 00 C3 06 D1 00 00 00 00 00 00 00 00 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0050: 00 00 00 00 00 00 00 00 00 00 00 00 01 3F 3F 3F 0060: 3F 3F 3F 3F 3F 3F 3F 3F 00 00 00 74 00 20 20 20 0070: 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 0080: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 0090: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 00A0: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 00B0: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 00C0: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 00D0: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 00E0: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 00F0: E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 |
Initial location | Final location | Location within system tracks | Size | |
BOOT SECTOR | 0000-01FF | - - - | cyl00_side0_sec1 | 1sec x 200h = 200h (0.5K) |
CCP | 0200-09FF | C900-D0FF | cyl00_side0_sec2-5 | 4sec x 200h = 800h (2K) |
BDOS | 0A00-17FF | D100-DEFF | cyl00_side0_sec6-9 plus cyl00_side1_sec1-3 | 7sec x 200h = E00h (3.5K) |
BIOS-1 | 1800-24FF | DF00-EBFF | cyl00_side1_sec4-9 plus cyl01_side0_1/2 sec1 | 6.5sec x 200h = D00h (3.25K) (ultimii 170h octeți sînt de fapt "00", nefolosiți) |
BIOS-2 | 2500-36FF | EC00-FDFF | cyl01_side0_2/2 sec1 pînă la cyl01_side1_1/2 sec1 | 9sec x 200h = 1200h zonă goală, cu excepția ultimului sect și jumătate care conține zona DPH + 3 șiruri de date |
BLOCK#1 | 3700-3B75 | 5B00-5F75(VRAM) | cyl01_side1_100 sec1 pina la cyl01_side1_175 sec3 | 476h |
BLOCK#2 | 3B76-4074 | 7B00-7FFE(VRAM) | cyl01_side1_176 sec3 pina la cyl01_side1_074 sec6 | 4FFh |
UNKNOWN | 3FF9-47FF | 3FF9-47FF | cyl01_side1_sec6-9 | 4sec x 200h = 800h (2K) |
CCP (C900-D0FF) - disassembled code |
BDOS (D100-DEFF) - disassembled code |
BIOS (DF00-FDFF) - disassembled code |
Boot Sector modified for CP/M system loading from ROM |
; ######### CP/M ROM LOADING #########
CPM0 LD A,$00 ; default drive 0
JR CPM
CPM1 LD A,$01 ; default drive 1
JR CPM
CPM2 LD A,$02 ; default drive 2
JR CPM
CPM3 LD A,$03 ; default drive 3
CPM LD HL,$4000
LD DE,$8000
LD BC,$3200
LDIR
LD HL,$8004 ; DSK Byte, location used as mailbox from BOOT to CP/M for user choice of default drive
LD (HL),A ; set default CP/M logical drive
LD HL,$0000 ; jump address in upcoming CP/M config
LD A,$40
OUT ($FE),A ; set O6=1 for CP/M config
XOR A
LD R,A
JP (HL)
|
|
POWER.COM 3.03 - code disassembled and (partially) commented |
dd if=/dev/zero bs=1k count=720 | tr '\000' '\345' > TEST_KRYS80.img
|
|
head -c 18K TEST_KRYS80.img > KRYS80_SYS_Tracks_full.bin
The original CP/M Loader version for this system, CBOT.SYS - disassembly |
Personalized CP/M Loader (with a logo) - Assembler source | |
CP/M Loader from the original CoBra CP/M, LK.SYS - disassembly |
This is the original version of the CP/M Loader used in the first CP/M system ever on CoBra. It is designed to work with system tracks having one single sector per track side, having 4096 bytes/sector. Right after this listing I will show a table containing modifications which, when applied to this CP/M Loader, will make it work with system tracks having a standard format. By performing these modifications directly on the binary file LK.SYS (using a hex editor), we get very easily a CP/M Loader for the CP/M version in our case (displaying 80 visible text columns). NOTE:
|
MODIFICATION FOR LK.SYS TO MAKE IT WORK WITH 9 SECTORS/TRACK, 512 BYTES/SECTOR |
Location | Modification | Comment |
---|---|---|
$0097 | $20 -> $24 | $24 x $100 = $2400 = 9 KB = 1 track both sides |
$0098 | $FF -> $00 | start address for saving will be $0000 |
$0099 | $3F -> $00 | |
$00AD | $00 -> $01 | The 8272 MT Read Data command must start at sector 1 |
$00AE | $00 -> $02 | 512 bytes/sector |
$00AF | $00 -> $09 | EOT, last sector number on a track |
$00B0 | $00 -> $50 | The value of GAP3 for 9 sect/track, 512 bytes/sector |
$01AD | $04 -> $01 | One single byte to copy by LDIR, which is the track number |
$01B1 | $2B -> $06 | Replacing DEC HL and LD B,(HL) by LD B,$02 in order to specify 512 bytes/sector |
$01B2 | $46 -> $02 | |
$01B3 | $2B -> $3E | Replacing DEC HL and LD A,(HL) by LD A,$01 in order to specify sector number 1 |
$01B4 | $7E -> $01 | |
$01B5 | $12 -> $00 | Deleting the LD (DE),A instruction |
$01C2 | $CB -> $00 | Deleting instruction which was replacing opcode of INI by opcode of IND |
$01C3 | $DE -> $00 | |
$01FC | $23 -> $21 | Replacing instructions INC HL and RET by LD HL,$0000 and RET so that JP (HL) would jump to $0000 after both system tracks are read |
$01FD | $C9 -> $00 | |
$01FE | $00 -> $00 | |
$01FF | $00 -> $C9 |
byte 0: | $00 (User Number) |
bytes 1-8: | $4C $4B $20 $20 $20 $20 $20 $20 (File name, 'LK ') |
bytes 9-11: | $53 $59 $53 (Filename extension, 'SYS') |
byte 12: | $00 (Xl, number of the 16KB logical extension, lower byte of the 16 bit value) |
byte 13: | $00 (Byte Count, number of bytes used in the last record of the file (1 record = 128 bytes). CP/M 2.2 does not support this byte, which is left as 0) |
byte 14: | $00 (Xh, number of the 16KB logical extension, upper byte of the 16 bit value) |
byte 15: | $04 (Record Count, number of 128-byte records used in the last extension of the file) |
byte 16: | $02 (lower byte of the 16-bit number ($0002) of the first block allocated on disk - blocks 0 and 1 are taken up by the CP/M disk directory) |
byte 17: | $00 (upper byte of the 16-bit number ($0002) of the first block allocated on disk) |
bytes 18-31: | $00 (LK.SYS takes up one single 2KB block, so the rest of 7 block numbers possibly adressable by this directory entry will have the value of $0000) |
dd if=/dev/zero bs=1 count=3552 | tr '\000' '\345' > E5dirfill_1.bin
dd if=/dev/zero bs=512 count=1396 | tr '\000' '\345' > E5dirfill_2.bin
cat KRYS80_SYS_Tracks_full_modified.bin LK_direntry.bin E5dirfill_1.bin CPM_KRYSS_Loader.bin E5dirfill_2.bin > KRYS80_KR_SYSDISK.img
cat KRYS80_SYS_Tracks_full_modified.bin LK_direntry.bin E5dirfill_1.bin CPM_80c_Loader.bin E5dirfill_2.bin > KRYS80_CL_SYSDISK.img
cat KRYS80_SYS_Tracks_full_modified.bin LK_direntry.bin E5dirfill_1.bin LK_modified.bin E5dirfill_2.bin > KRYS80_LK_SYSDISK.img
IMPORTANT:The "Unified CoBra Boot", written by me and presented in the "Software / BOOT ROM" section, IS NOT NEEDED in order to boot the CP/M system from the floppy images shown below. These floppy images can very well be booted from using one of the original 2KB BOOT codes (like in the old times). Actually, even when using the "Unified CoBra Boot", in order to boot any CP/M system from a floppy, from its start menu, one of the old BOOT codes will have to be launched first, and then from that BOOT code, using the D key, the CP/M system will be launched from floppy. |
BOOTABLE SYSTEM DISK IMAGES - CP/M with 80 text columns displayed (using standard format system tracks, 9 sect/track) with system bootable off any physical drive (0, 1, 2 or 3) |
Type of CP/M Loader | RAW format | HFE format | Screenshot |
Modified LK.SYS | KRYS80_LK_SYSDISK.img | KRYS80_LK_SYSDISK.hfe | |
CP/M 80 text columns | KRYS80_KR_SYSDISK.img | KRYS80_KR_SYSDISK.hfe | |
Personalized (logo) | KRYS80_CL_SYSDISK.img | KRYS80_CL_SYSDISK.hfe |