Re: [Freedos-devel] Booting FreeDOS kernel without a 386

2023-08-11 Thread Rugxulo via Freedos-devel
Hi,

On Fri, Aug 11, 2023 at 5:28 AM Paul Edwards via Freedos-devel
 wrote:
>
> Sorry for the delay. I've been sick recently (possibly Covid)
> plus had other stuff to deal with.

No fun, get well soon.


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


Re: [Freedos-devel] Booting FreeDOS kernel without a 386

2023-08-11 Thread Liam Proven via Freedos-devel
On Fri, 11 Aug 2023 at 11:28, Paul Edwards via Freedos-devel
 wrote:

>
> Yes, 240 MB.

You don't need FAT32 for a drive that small.

The cutoff where FAT32 becomes notably more efficient is 512MB, which
has clusters twice as big as a drive of 129-254 MB.

It becomes really worth it over 1GB.

For a 240MB drive, reformat it as FAT16. It'll be easier.


-- 
Liam Proven ~ Profile: https://about.me/liamproven
Email: lpro...@cix.co.uk ~ gMail/gTalk/FB: lpro...@gmail.com
Twitter/LinkedIn: lproven ~ Skype: liamproven
IoM: (+44) 7624 277612: UK: (+44) 7939-087884
Czech [+ WhatsApp/Telegram/Signal]: (+420) 702-829-053


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


Re: [Freedos-devel] Booting FreeDOS kernel without a 386

2023-08-11 Thread Paul Edwards via Freedos-devel
Sorry for the delay. I've been sick recently (possibly Covid)
plus had other stuff to deal with.

On Sat, 5 Aug 2023 at 20:36, C. Masloch  wrote:
>


> On at 2023-08-02 15:27 +0800, Paul Edwards via Freedos-devel wrote:
>
> 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?
>

Yes, 240 MB.


> 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.
>

Thanks for that! I'll try that out when I get back to this.


> As mentioned by others, doslfn is 386-only.
>

Ok, I can live without that on the Book 8088.

BFN. Paul.
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


[Freedos-devel] Booting FreeDOS kernel without a 386

2023-08-05 Thread C. Masloch via Freedos-devel

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