1.3 Bootable (512k)

This guide lets to create a bootable SCSI 1.3 ROM just using Capitoline.

Cap does not contain any C=/Amiga code, so will need need

  1. A 256k Kickstart 1.3 ROM (the size is important, an “overburnt” 512k ROM will not work)
  2. A scsi.library which you an extract from the 3.1 library of your choice, I used the one from the A1200 ROM. 

Note, if you haven’t extracted the library from the ROM, but you have the a 3.1 ROM, you can add it directly from the ROM without extracting;

i.e. instead of;

add Components/os-source/v40/0x75094a7b.scsidisk_40.12_(21.12.93)

You can;

add "/location/of/3.1 Kickstart" scsi.device
e.g. add "ROMs/TOSEC.Firmware/Kickstart v3.1 r40.068 (1993-12)(Commodore)(A1200)[!].rom" scsi.device

Part 1 – Create the “lower” 0xF8000 ROM for SCSI

Create an empty ROM with a 0xF80000 ROMBASE, add the 0xFC0000 ROMHEADER (or it won’t boot)

Add the scsidisk library (in this case from the A1200 40.68 KS3.1)

Add the extra code which creates a “boot node” to allow the disk to boot

newrom 256k 255 
rombase 0xf80000 
add Components/BinaryChunks/ROMHeader_FC.bin 
add Components/os-source/v40/0x75094a7b.scsidisk_40.12_(21.12.93) 
add Components/BinaryChunks/add_boot_node.bin

Patch the SCSI library so that it calls the new code – there’s two locations to patch.

findopcode $0x75094a7b.scsidisk_40.12_(21.12.93) "JSR FCD6(A6)"
alias OPCODE $add_boot_node.bin.(START) 
alias OPCODE subtract $FIND 
alias OPCODE subtract 2 
alias OPCODE add 0x61000000 
patch $FIND $OPCODE 
findopcode $0x75094a7b.scsidisk_40.12_(21.12.93) "JSR FFDC(A6)" 
alias OPCODE $add_boot_node.bin.(START) 
alias OPCODE subtract $FIND 
alias OPCODE add 26 
alias OPCODE add 0x61000000 
patch $FIND $OPCODE

Next add the code to initialise Gayle (assuming you have a Gayle or emulate Gayle)

add Components/BinaryChunks/init_gayle.bin

Patch the scsi.library INIT (ROMTAG.INIT) call to jump into the new code

alias SCSIINIT romdata $0x75094a7b.scsidisk_40.12_(21.12.93).(ROMTAG.INIT) 4
alias GAYLE $init_gayle.bin.(START) 
alias GAYLE add $ROMBASE 
patch $0x75094a7b.scsidisk_40.12_(21.12.93).(ROMTAG.INIT) $GAYLE

Patch the Gayle init code to jump to the original address of the scsi.library INIT which we saved in SCSIINIT

alias GAYLE $init_gayle.bin.(END) 
alias GAYLE subtract 4 
patch $GAYLE $SCSIINIT

Finally, add the standard ROM components, and checksum it – then we’re all done for $F80000

add checksum
add size
add vectors
checksum

Part 2 – Patch the original 1.3 ROM the “upper” $FC0000 ROM

Next we need to load the original KS1.3 and patch its library scan table to look at $F80000-$FC0000 as it normally doesn’t – luckily, for 1.3 it seems to scan $FC0000-$10000000 twice, so we can overwrite the second one (makes the patch simple), analyserom is used to find exec, in case you don’t have the full kickstart definition file, don’t forget to checksum.

loadrom "ROMs/TOSEC.Firmware/Kickstart v1.3 r34.005 (1987-12)(Commodore)(A500-A1000-A2000-CDTV)[!].rom
analyserom
find $exec.library 0x00FC00000100000000FC00000100000000F0000000F80000FFFFFFFF
patch $FIND        0x00FC00000100000000F8000000FC000000F0000000F80000FFFFFFFF
checksum

Part 3 – Save your work!

Join the two ROMs together and save the file, you might want to use “saveprofile test_ks1.3scsi.rom byteswap” if you’re buring a real ROM

romprofile 0 1
saveprofile test_ks1.3scsi.rom

Acknowledgements

I didn’t develop the code that creates the boot node, I found it in the Commodore docs when it talked about manually creating a boot node, this and the code for checking the version of expansion.library was in the GetSCSI11 code developed by Torbjörn Andersson which you can find Here on Aminet.

The code to initialise Gayle was found Here and written by user A10001986 (who I think is still active on Aminet) the thread was started by dJOS (offering a bounty to fix the issue) and kipper2k matched the bounty. 

Scroll to Top