[Coco] The cobbler "problem"

Allen Huffman alsplace at pobox.com
Sun Jan 25 01:26:17 EST 2015


I have been going through the source code for cobbler to see why it won't work for my hard drive image on the CoCoSDC.

As the .dsk images show, it is totally possible to have a "DOS" booted .DSK image, but you can't make one using "cobbler". You have to make it using toolshed tools, or manually copy over the kernel track and set the bitmap accordingly to flag those sectors unavailable. I did this and it works fine -- I have a "DOS" booting 128MB .DSK hard drive image.

Cobbler was designed specifically for placing the boot on track 34 of a CoCo disk drive. It is smart enough to place it on the right spot in the case of a double sided floppy disk (where tracks are alternated between sides). This is the key to why it does not work on a large CoCoSDC disk image.

Disk images with 2880 sectors or less are handled by CoCoSDC as floppy drives. Using the example of standard double sided 360K drive, the firmware may store all of side one (sectors 1-720) in the file, followed by all of side two (sectors 721-1440), and honor the side select to know where in the file to return sectors. It is transparent to the CoCo so it doesn't really matter how it's being done internally.

Cobbler, on the other hand, ONLY knows about floppy drives. It uses the disk geometry loaded in from LSN0 to know sectors per track and if the device is single or double sided. If it is single sided, it can multiple track 34 (where boot is loaded) by sectors-per-track to get the logical sector number to write boot out using the I$Write system call. If it's double sided, it multiplies by 2 since logical sectors 1-18 would be on top side track 1, then logical sectors 19-36 on bottom side of track one... To get to top side track four, it's now twice as many logical sectors than with a single sided drive.

Herein lies the problem. No disk system before CoCoSDC allowed us to do what we can do today. With HDB-DOS, you got a 35 track single sided disk and could load boot, then OS-9 took over and jumped to a partition to deal with the rest. There was no cobbling the OS-9 section. In theory, though, what I am about to describe I can even make work using the KenTon SCSI (or T^3 SCSI, or SuperIDE, or anything else using modern drives that respond based on sectors instead of physical heads/sides/etc.) but it's trickier.

My cobbles fail because my drive geometry with FFFF cylinders and 8 sides gets flagged as a double sided disk. Cobbler then does bad math, and instead of writing out to LSN $264 it's trying to write somewhere else and failing. My hack to cobbler overrides the disk drive math so it just writes out to the proper LSN. Ultimately, I might add it as an option to specify the LSN to place the boot track, but for now I'm just hacking away.

In the meantime, I will whip up a tiny BASIC09 program one can run and it will cobble your SDC hard drive images so they DOS boot and run.

More to come...

		-- Allen



More information about the Coco mailing list