On at 2023-08-02 15:27 +0800, Paul Edwards via Freedos-devel wrote:

 > FreeDOS should run on 8086, both kernel and shell. If it doesn't,
 > that's a bug or omission.

Are you sure? I thought I was told that the standard
distribution relied on an 80386.

 > ke20xx_32.zip : binaries for 8086, FAT16, FAT32

I got this, and then renamed my kernel.sys to kernel.old,
then copied this new kernel.sys onto the disk, and then
started it under an emulator and it worked fine (as before).

I have no way of knowing whether it was actually using the
new kernel.sys.

The act of renaming kernel.sys to kernel.old would have
left it as the first file on the disk. I was under the
impression that the boot sector of Freedos would allow
the kernel.sys to reside as something other than the
first file, so I expected this to be a valid test and
to skip the kernel.old and use the new kernel.sys.

Yes, this is valid. All FreeDOS kernel loaders only load based on the filename, not the position of the file data or directory entries within the file system.

Please let me know if this is an invalid test.

Regardless, I then burned the image onto the CF and
booted on the Book 8088 and I got the same problem.
"loading freedos" followed by incessant beeping.

The only boot loader that displays this message is boot32lb.asm [1]. This boot loader happens to display the message, first thing [2]. However, after this it starts using 386-only instructions.

I assume that your file system is FAT32? Otherwise I don't know how you could get this message. How large is your file system?

Anyway, FreeDOS's SYS utility determines whether to use the 386+ LBA FAT32 loader or the 8086 CHS FAT32 loader based on whether the current machine's first HDD (unit 80h) has LBA extensions available or not [3]. This obviously fails in your case as you don't want to boot from the same machine as what you're using to install.

It isn't fully documented in the help page [4], but you can choose which FAT32 loader is installed using the /FORCE option, setting it either to /FORCE:LBA or /FORCE:CHS [5]. This will cause the use of "fat32chs" (from the source file boot32.asm rather than boot32lb.asm) [6]. The CHS FAT32 loader is also 8086-compatible.

I also copied some files to a directory on my server [7]. The sys.com and kernel.sys are both from my automatic kernel build [8]. Likewise the fat12com.bin, fat16com.bin, fat32chs.bin (8086), and fat32lba.bin (386+). It also has command.com from my automatic FreeCOM build [9]. The original FreeDOS FAT12 and FAT16 loaders are always 8086-compatible.


Other than that there is instnone.com, created from the instsect repo [10] + lmacros [11] like so:

nasm -I ../../../proj/lmacros/ ../../../proj/instsect/instsect.asm -o instnone.com -D_FAT12=0 -D_FAT16=0 -D_FAT32=0

This DOS program can be used to install a boot sector loader into a FAT12, FAT16, or FAT32 file system. The build options are to disable embedding any loaders into the program itself. You can use the /S options to load loaders from external files, which must be either 512 bytes in size or (for the FAT32 FSIBOOT loaders) 1024 bytes. The instsect program can operate on DOS drives or on image files, using the /M option. Command help is available using the /? option.


There are also three FreeDOS-compatible boot loaders that I wrote, in the files boot12c.bin, boot16c.bin, and boot32.bin. These were created from the ldosboot repo [12] + lmacros [11] like so:

nasm -I ../../../proj/lmacros/ ../../../proj/ldosboot/boot.asm -D_COMPAT_FREEDOS -D_LBA=0 -D_RPL=0 -o boot12c.bin

nasm -I ../../../proj/lmacros/ ../../../proj/ldosboot/boot.asm -D_COMPAT_FREEDOS -D_LBA=0 -D_RPL=0 -o boot16c.bin -D_FAT16

nasm -I ../../../proj/lmacros/ ../../../proj/ldosboot/boot32.asm -D_COMPAT_FREEDOS -o boot32.bin

The boot32.bin loader uses my FSIBOOT method, requiring the FAT32 file system to have an FSINFO sector. Other than that, it will try to use LBA and fall back to CHS if not found. It will try to query the geometry using int 13h function 08h. And it will use the hidden sectors passed from an MBR loader, if detected. And of course it is all 8086-compatible.

The boot12c.bin and boot16c.bin loaders are also 8086-compatible and detect the geometry and hidden sectors like the FAT32 loader. However, they will never use LBA. If a sector to read is outside the CHS-addressable space, then the loader will detect this [13] and display the error code letter "R" [14]. The RPL support is also in part disabled in these files. Disabling some options is needed to make the loaders fit into the available space for the FreeDOS kernel load protocol.


You can use any of the *.bin files with instsect by running a command like this:

instnone.com /S12=boot12c.bin /S16=boot16c.bin /S32=boot32.bin E:

The drive letter E: is of course an example. It can be replaced by an /M= option to install into an image file instead of a DOS drive. As specified in the help [15], /MO= options can be used to access a file system in an image file where the boot sector is located at a later point than at the very beginning (offset 0).


In this directory there is also the two executables ldebug.com (debugger) and instsect.com (instsect, with the lDOS load protocol boot loaders for lDebug embedded). These are both from my automatic current release build of the lDebug debugger (with a small L) [16]. You can install a bootable lDebug to a DOS drive by running this instsect on it, and copying the ldebug.com file to anywhere in the root directory of the drive.

The boot loaders installed by lDebug's instsect.com all detect the geometry, the hidden sectors of their partition, and try to use LBA if available falling back to CHS else. They are also all 8086-compatible. They cannot be used to load an unmodified FreeDOS kernel, however. (Not even if you change the filename to load from!)

But, if you boot lDebug (it too is 8086-compatible) you can then enter a command like "boot protocol freedos" followed by a "q" command to load and run the FreeDOS kernel.sys from the same file system that the debugger loaded from. If you want to automate this, write an ldebug.sld Script for lDebug file to the root directory with this content:

:bootstartup
sleep 5 seconds
boot protocol freedos
if (rc == 0 && ioi == 0) then q

This is a simple way to wait 5 seconds before continuing to run the kernel, and if a key is pressed during that period then the debugger will revert to its command line interface rather than running the kernel.


 > The very bare minimum (besides boot sector) is kernel and shell. What
 > other pieces of DOS software did you need or want?

 > I see no reason not to use FreeDOS. If something doesn't
 > work, keep bugging us here.

Sure, thanks. Possibly the Book 8088 BIOS is deficient
and Freedos is relying on that (while MSDOS 6.22 is not).

But yeah - if Freedos is 8086 out of the box, that's
fantastic and I have no reason to use MSDOS 6.22 except
for testing purposes (same as testing on Win95 but
normally I would use Freedos + doslfn + HX).

The FreeDOS kernel and shell should run fine on the 8086. Other than official releases you can also use my daily builds mentioned before [8] [9]. These should always be 8086-compatible.

As mentioned by others, doslfn is 386-only.

Regards,
ecm


[1]: https://github.com/FDOS/kernel/blob/29ccb6e45414a8a18346a97fdb0f35ebd6fb4025/boot/boot32lb.asm#L398 [2]: https://github.com/FDOS/kernel/blob/29ccb6e45414a8a18346a97fdb0f35ebd6fb4025/boot/boot32lb.asm#L138 [3]: https://github.com/FDOS/kernel/blob/29ccb6e45414a8a18346a97fdb0f35ebd6fb4025/sys/sys.c#L1291 [4]: https://github.com/FDOS/kernel/blob/29ccb6e45414a8a18346a97fdb0f35ebd6fb4025/sys/sys.c#L537 [5]: https://github.com/FDOS/kernel/blob/29ccb6e45414a8a18346a97fdb0f35ebd6fb4025/sys/sys.c#L656 [6]: https://github.com/FDOS/kernel/blob/29ccb6e45414a8a18346a97fdb0f35ebd6fb4025/sys/sys.c#L1559
[7]: https://pushbx.org/ecm/test/20230805/
[8]: https://pushbx.org/ecm/download/fdkernel.zip
[9]: https://pushbx.org/ecm/download/freecom.zip
[10]: https://hg.pushbx.org/ecm/instsect
[11]: https://hg.pushbx.org/ecm/lmacros
[12]: https://hg.pushbx.org/ecm/ldosboot
[13]: https://hg.pushbx.org/ecm/ldosboot/file/9c4923acc2be/boot.asm#l1052
[14]: https://hg.pushbx.org/ecm/ldosboot/file/9c4923acc2be/boot.asm#l793
[15]: https://hg.pushbx.org/ecm/instsect/file/18edcefc9877/instsect.asm#l4521
[16]: https://pushbx.org/ecm/download/ldebug.zip


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

Reply via email to