This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

Auto boot

Making a disk bootable on the C128

Table of Contents

On the Commodore C128 it was possible to auto-boot a floppy disk that's in the drive when the system is powered up. This does NOT work on the C64.

This only works if Track 1 Sector 0 is allocated and contains a specific signature.

I don't have a C128 so I cannot confirm this, only know of this functionality as it's mentioned in some documentation about the disk format and even then they are not 100% certain if even this is accurate.

Boot sector format

Byte Content Description
00 Signature Auto-boot Signature "CBM"
01
02
03 Additional sectors Track/Sector address or 0x0000 for none
04
05 Bank Bank for additional sectors, default 0x00
06 Load count Number of sectors to load, default 0x00
07 Boot message 0x00 terminated string, can be just 0x00 for "BOOTING..."
08+b Program name 0x00 terminated string, can be just 0x00 for none
09+b+p Boot Loader Boot Loader code, padded with 0x00
 
FF

Example 1

This is from lemon64.com which has an example of a boot sector in DASM.

In this instance it autoboot's CPM:

Boot loader:
C128 boot sector. (T1, S0)
Compile without a load address. {-f3}
processor 6502
org0x0b00
byte"CBM"Auto boot signature
word0x0000Load address for additional sectors. (T1, S1)
byte0x00Bank number for additional sectors.
byte0x00Number of sectors to load.
byte"", 0x00Boot message: "BOOTING..."
byte"", 0x00Program to load on boot.
startldx#<cmd-1Address of command -1
ldy#>cmd
jmp0xafa5Execute BASIC command
cmdbyte"OPEN1,8,15,", $22
byte"CD:CPM.D64", $22
byte":CLOSE1:BOOT"
org0xbff, 0x00Fill with 0x00 to make 256 bytes
byte0x00

Example 2

This is from C128BOOT.txt which seems to be different to the above.

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00 43424D 000C 00020000 A5D7 C980 F003 20 Code
10 5FFF A9058D06D5A94E8D00FF4C000C
20 All 0x00 Blank
 
F0

The code for the above loader is:

Boot loader:
ORG0x0c00start at 0x0c00 as defined in bytes 3 & 4 of boot sector
bootloaderLDA0xD7If 0xD7 = 0x80 then do some initialisation
CMP#0x80
BEQinit
JSR0xFF5FCall unknown OS call but why JSR not JMP?
initLDA#0x05Initialise 0xD506 to 5
STA0xD506
LDA#0x4Eand 0xFF00 to 0x4e
STA0xFF00
JMPbootloaderRestart the boot loader