| Home | cripple | x86test | boot stuff | ASCII converter | links | ||||||||||||||||
Bootable StuffHere are a few things to be used as or with a floppy disk bootsector for PCs.
fatload - simple floppy bootloaderfatload is a bootsector to be used on a FAT12 formatted floppy disk to load a file and jump to it. Whilst there are a number of possible problems with it, it has worked fine on every machine I have tried it on. As it uses the BIOS to load sectors from the disk, it may not work with some buggy BIOSes, but I haven't had a problem yet. fatload uses multi-sector reads (which is where most problems may lie), so it is fast. fatload was primarily intended to be used with x86test, but it is simple to change the boot filename and the load address. The source comes with a small program (bootfname.c) to set the boot filename fatload is released under the GNU General Public License.
BoobBoot - the bootable booby timerboobboot is a novelty bootsector that prompts for a number of seconds and then counts down until it displays some beautiful ascii art! Far more exciting than "Invalid system disk" or whatever. There is space to preserve FAT12/16 data structures, so you won't even know its there until you accidentally leave it in your floppy drive when you boot up!
insbootinsboot is a small program to insert a bootsector file into a floppy disk's bootsector, preserving FAT12/16 data structures. This means that installing a bootsector should not affect the useability of the filesystem on the disk. It can also print out the contents of the fs data in a FAT bootsector.
insboot_dos is a fairly retarded version of insboot for DOS that works under windoze.
Installing a bootsectorIn the simplest case you can just copy the bootsector file directly to a floppy disk (e.g. cp bootsect /dev/fd0 on linux). This is fine if the filesystem on the floppy doesn't use the bootsector for anything (e.g. ext2), however the most common fs type, FAT12 does use some of the bootsector, so this will stop you being able to use the disk normally! The solution is to paste the filesystem structures from the bootsector on the disk into the bootsector you want to write. There are many possible ways to do this. insboot makes this easy on unix. You can do it manually if you like that: head -c 3 bootsect > tmpboot # jmp instruction from file head -c 62 /dev/fd0 | tail -c 59 >> tmpboot # FAT info from disk head -c 510 bootsect | tail -c 448 >> tmpboot # bulk of file echo -en "\125\252" >> tmpboot # 0xaa55 signature cp tmpboot /dev/fd0 # write new bootsector With DOS you can use debug: debug bootsect # load 'bootsect' to 0x0100 l 300 0 0 1 # load current bootsector to 0x0300 m 303 33d 103 # copy FAT info to new bootsector e 2fe 55 aa # set 0xaa55 signature w 100 0 0 1 # write new bootsector Both examples assume you are writing 'bootsect' to the first floppy device. You should bare in mind that DOS (and at least win95/98) require the first 3 bytes of a FAT bootsector to be an x86 "jmp disp16" (0xE9 disp16) or a "jmp disp8; nop" (0xEB disp8 0x90). Anything else causes DOS to throw a wobbler and reject the disk! There is no logical reason for this as the bootsector is only executed by the BIOS at boot time, so the executable code has nothing to do with DOS. |
|||||||||||||||||