Comments (5)
- update sys and boot code so sys can extract all necessary offsets without hard coding, possibly by scanning for magic bytes or having the boot sectors have an additional trailer chunk
- possible update is to have sys move files so PC/MS DOS kernel files first two directory entries and physically on disk [not sure if worth the bloat, since can ensure this by sys to a blank disk]
- see if possible to update FAT32 boot code to support both LBA and CHS with same boot sector, may require using more than one sector
from kernel.
merge all changes from kernel sys and boot sectors into sys repo and then make it a submodule of the kernel like share, etc.
from kernel.
- update sys and boot code so sys can extract all necessary offsets without hard coding, possibly by scanning for magic bytes or having the boot sectors have an additional trailer chunk
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 opts->kernel.loadaddr
to the variable unconditionally.)
In the OEM boot sector loaders, just scanning for jmp 70h:0
or jmp 70h:200h
should be sufficient to find the far branch to the next stage.
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.
- see if possible to update FAT32 boot code to support both LBA and CHS with same boot sector, may require using more than one sector
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.
from kernel.
Ah, I think in the PR I forgot that not all of the boot loader sources use the appropriate cpu 8086
or cpu 386
NASM directives. So add that to the pile.
from kernel.
Also relevant: #94
from kernel.
Related Issues (20)
- FAT32 loader installed by FreeDOS SYS with /OEM:EDR doesn't correctly pass the load unit in DL (and vice versa) HOT 1
- fdconfig.sys SHELL=4debug.com will try to load debug.com HOT 3
- Wrong format specifiers if compiled without FAT32 support
- Startup CPU check does not accept NEC V20/V30 as 186-class processors HOT 5
- FAT32 boot loaders: With a (rounded) file size of 128 KiB, either the file data corrupts the FAT sector or vice versa
- Regression: After commit 1c2f541 (2024/02/04) CH357 driver doesn't work anymore (UPDATE) HOT 32
- A small build issue when building using OpenWatcom 1.9 under DOS HOT 3
- gcc/Linux/GNU make fails to build country.sys HOT 13
- Build issue with recent OpenWatcom snapshots requiring `-wcd=106` HOT 8
- SYS /OEM:W9X /L 0 does not set loadaddr to 0
- ddt.offset confusingly commented HOT 1
- Terminating the device / fdconfig.sys process crashes the system
- DDT / UDSC / UPB structure differs from MS-DOS v6.22/v7.00/v7.10 (and EDR-DOS) HOT 1
- INT25/26 fail for uninitialized FAT-12/16 partitions leading to format error
- Is there anything implemented that uses PartitionMode yet? HOT 4
- FDIMPLES crashes with current kernel HOT 11
- win31support HOT 1
- Suggestion: Work around Xi8088 BIOS bug by setting DS = 40h for 13.41 call HOT 1
- DPB memory invalidation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kernel.