Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

WDe and GPT, booting DOS (Users)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 02.11.2022, 09:55

> First you should make yourself familiar with the difference of MBR ( the
> boot sector of the DISK ) and a FAT32 "boot sector".
>
> Some details where FD may differ from MS-DOS:
>
> - the MS-DOS kernel is named IO.SYS.
> - the boot code of DOS71BSG.BIN loads IO.SYS at 0070:0000
> - the boot code loads just the first 4 sectors of IO.SYS.
> - the boot code checks four bytes of loaded IO.SYS ( at pos 0 and pos 200h
> )
> - the boot code loads SI:DI with the start cluster of IO.SYS
> - the boot code of MS-DOS jumps to 0070:0200 to switch control to the
> kernel
> - when jumping, there are a few values on the stack that IO.SYS might use.
>
> So there's pretty much that may go wrong when using DOS71BSG for
> FreeDOS...:-D

I made it so my FAT32 and FAT16 and FAT12 boot sector loaders can load various kernels using different protocols. Build options select which protocol to implement. You can look at the protocols supported here for FAT12/FAT16: https://hg.pushbx.org/ecm/ldosboot/file/094041a616f5/boot.asm#l140 and for FAT32 here: https://hg.pushbx.org/ecm/ldosboot/file/094041a616f5/boot32.asm#l110

Largely the same information is encoded in the load settings for the lDebug BOOT commands at https://hg.pushbx.org/ecm/ldebug/file/b98dc45862ba/source/msg.asm#l1899 (This is used by a single build of a loader that implements different protocols at run time.)

In short, for the FreeDOS kernel:

* Default name is KERNEL.SYS

* Load address is linear 00600h

* Entrypoint is at CS:IP = 60h:0

* BL holds load unit for int 13h

* Full file must be loaded, implying that the boot sector loader needs to relocate itself away from linear 07C00h

* SS:BP points to the boot sector with (E)BPB (not used by current kernels)

---
l

 

Complete thread:

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