Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Floppy boot sector injection/conversion to HD (Miscellaneous)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 28.02.2021, 08:57

> You might be able to use some FreeDOS boot sectors together with one of the
> more flexible SYS versions to say you want the boot sector to load a file
> from the root directory with any name of your choice, to any address
> segment of your choice. Depending on whether your operating system needs
> anything more than that, this lets you use FreeDOS boot infrastructure to
> load and boot kernels of other DOS brands by giving the right parameters on
> the SYS command line. Could be useful for DR DOS, EDR DOS, MS DOS, PC DOS
> etc. multiboot "switching" by updating your boot sector and restarting the
> computer. Not sure how experimental this was and which SYS versions have
> it.

This only works if the file in question allows loading as a FreeDOS load protocol kernel. This is only true of FreeDOS's own kernel.sys (expects to be loaded at 60h:0 and probably doesn't support other addresses), later EDR-DOS's drbio.sys (at 70h:0), and my later RxDOS.COM and ldebug.com files (require loading at 60h:0 because that is how they detect they're entered in the FreeDOS load protocol). The ss:bp far pointer points to the boot sector with BPB in memory, typically at 1FE0h:7C00h, and the entire file is loaded to the specified address. The bl register contains the ROM-BIOS unit to load from.

MS-DOS (up to version 6.xx) and PC-DOS (including up to version 7.10) follow a different protocol: the boot sector is located at 0:7C00h and the first three sectors (more accurately, 1.5 KiB) are loaded to 70h:0, and some registers are set up, including dl with the unit to load from. The directory entries for the BIO and DOS file are located at 0:500h and 0:520h.

MS-DOS 7 and 8 have their own protocol: the boot sector is again usually at 0:7C00h and also pointed to by ss:bp. Four sectors (more accurately 2 KiB) of the file are loaded to 70h:0 and entered at 70h:200h. si:di or only di contain the first cluster of the load file. The dword below the boot sector copy in memory contains the number of the first data cluster's sector, absolute within the boot unit (including hidden sectors).

A way of multibooting that works with a range of loaders and not just FreeDOS-compatible ones is to use my debugger's BOOT command while in bootloaded mode. The included instsect.com installs a loader (lDOS protocol) which allows loading the debugger. The debugger can in turn load any kernel in a variety of formats. Then if the load succeeded simply run q or g and the kernel is executed.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 47 users online (0 registered, 47 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum