On at 2024-06-02 18:19 +0200, Bernd Böckmann via Freedos-devel wrote:


5. SYS C: /FORCE:CHS


And that boots without problem on the Pocket386!


Also: you asked about FDISK /XO output. It reports "W95B INT LBA
FAT32" in the upper left corner. This is running FDISK 1.3.15.

To Jim: Are you sure you ran FDISK /XO on the Pocket386 system? If FDISK says it detects LBA there but the LBA loader from FreeDOS doesn't work that'd be quite the bug.

Well, this is good on the one hand, but bad on the other. It means that the 
system (supposedly) supports LBA access, but the FAT32 LBA loader for a reason 
yet unknown to me fails to boot the thing. LBA in general seems to be working. 
Otherwise FDISK would also fail in one way or another.

Have to think about what might be the cause. Looking at the source of FAT32 LBA 
loader, it passes the disk access packet to the BIOS by pushing it onto the 
stack and setting SI=SP, instead of reserving some space for it in its data 
area. Not exactly sure that this is a good idea, as it makes this susceptible 
to stack corruption, depending on how the BIOS mishandles the packet.

The packet on the stack trick is used by some lDOS MBR/boot loaders as well, and it generally works.

https://github.com/FDOS/kernel/blob/c0127001908405d30d90f1755ad10c1b59ea8c90/boot/boot32lb.asm#L384

The BIOS may also trash some registers...

Anyone a suggestion?

If it really turns out that FDISK /XO detected LBA support *on the Pocket386* but the LBA loader fails, I could cough up some debugging hints as to how to install bootable lDebug on the system then debug the failing loader. For instance:

1. Rename kernel.sys to fdkernel.sys (exact name doesn't matter)
2. Copy ldebug.com to working drive (using CHS loader) as kernel.sys
3. Boot lDebug
4. Boot FreeDOS using "BOOT PROTOCOL FREEDOS fdkernel.sys" then "Q"
5. Write loader to file: "SYS C: /BOOTONLY /FORCE:LBA BOOTSECT.DOS"
6. Reboot into lDebug
7. Try "BOOT PROTOCOL CHAIN" and then trace the loader

You could install the FAT32+FSIBOOT loader for lDebug as well but when you already have a working boot loader then this would just be the possible cause of more headaches. Not impossible, but not worth it probably. As I have oft repeated lDebug can be loaded as a number of kernel formats, most recently including the FreeDOS and the original Enhanced DR-DOS (v7.01.07) kernel load formats.

I will advertise the lDOS FAT32 loader more in another subsequent email.

Regards,
ecm


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to