-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys and boot sector improvements [TODO] #139
Comments
|
merge all changes from kernel sys and boot sectors into sys repo and then make it a submodule of the kernel like share, etc. |
The current 512-Bytes files per boot sector loader are more compatible and easier to use for other programs, eg my instsect or with dd to write to an image. Albeit, it would be a nice(r) approach to append some trailer. I also did this in #78 for the new exeflat stubs, the stubs have trailing data to point exeflat to where to patch them. But in that case there was no compatibility with other programs to consider. The unit selection code (/FORCE:BSDRV or /FORCE:BIOSDRV) can be scanned very easily, I do that in instsect already. The FAT12/FAT16 LBA detection (/FORCE:LBA or /FORCE:CHS or /FORCE:AUTO) is also easily scanned. The loadsegoff is fairly simple to scan for too, just check for a dword matching 60_0000h or 70_0000h and also you can check that there is a jmp far indirect that references the same dword. The check for segment 70h is for boot sector loaders that are modified with the EDR-DOS SYS/boot patches, which changed the default segment too. Eg in https://pushbx.org/ecm/download/edrdos/freedos/drsys35s.zip boot.asm and boot32.asm have the default segment as 70h, but not boot32lb.asm. (It doesn't really matter to SYS because it writes In the OEM boot sector loaders, just scanning for The kernel name is okay to leave as a magic offset I think. In instsect I chose to scan for potentially multiple filenames (up to 4 are supported by default) just using a heuristic for valid filenames, which works nicely, but isn't really needed for SYS.
lDOS boot32 does this, it is a combined LBA and CHS, 8086-clean loader. It uses its "FSIBOOT4" stage in the FSINFO sector's large reserved area, which I believe has never been used by anyone else. The current revision has a _COMPAT_FREEDOS mode which allows to load kernel.sys. The addressing and relocation differs from the kernel's current loaders, but the protocol matches what I consider essential to FreeDOS load. The exact same FSIBOOT4 stage can be used by different loader first stages, to load RxDOS.3, lDOS/lDebug, MS-DOS v7.10, or PC-DOS v7.10, all changes for these protocols are confined to the first stage. That includes the addresses to load at and transfer control to, as well as the filenames to search for. |
Ah, I think in the PR I forgot that not all of the boot loader sources use the appropriate |
Also relevant: #94 |
Originally posted by @ecm-pushbx in #135 (comment)
The text was updated successfully, but these errors were encountered: