Re: [Freedos-user] Can FreeDOS Be Installed By Means Of UNIX Commands?

2023-07-16 Thread Jerome Shidel via Freedos-user


> On Jul 16, 2023, at 10:21 AM, Jay F. Shachter via Freedos-user 
>  wrote:
> [..]
> If the answer to the first question is Yes, then I can continue this
> narrative, otherwise the remainder of this posting is moot.  I copied
> FD13FULL.img to a USB stick, stuck it into the above-described
> computer, and instructed it to boot from the USB device.  The
> installation procedure scares me.  I have already partitioned my disk
> and designated in my mind the logical slice onto which I want to
> install FreeDOS, but the installation procedure on FD13FULL.img
> implies that I must repartition my disk, and I am afraid to proceed,
> lest I irretrievably trash my entire computer.

First... Never install an OS or update an OS on a machine you are not 
willing to rebuild from scratch! I doesn’t matter how careful you are. 
I does not matter how new or great the OS and installer is. Things can
go wrong with the best of them and leave your machine broken or
not even bootable from the internal drives. Backup!

When you boot the from the FreeDOS USB stick, that drive should be
seen by the OS as drive C:. The installer then queries FDISK to see
if a drive D: is present and readable by FreeDOS. If so, it will use that
drive as a target for installation. If not, it will prompt to partition the 
drive.
If the installer is prompting to partition using FDISK, it cannot find a 
hard drive (other than the USB stick) that is suitable to install FreeDOS.

There is an advanced mode for the installer. However, that gets only
limited testing. Therefore, I recommend you install FreeDOS in a 
virtual machine or manually.

> [..]
> then populating the
> newly-created vfat filesystem by means of the cp and unzip commands
> (the packages, I noticed -- and there is a huge number of them -- are
> zip files, but there are also some files that are fundamental to
> system that are already present without having to be unzipped, which I
> envision simply copying over).  

That is not really going to work very well. The zip archives are packages. 
The contain various directory aliases that get remapped during package 
installation. While many could just be unzipped and used, others will be
in directories different from how they are configured and will not function
properly. 

You have multiple options on how you can proceed. 

1) You could run the installer in advanced mode. Based on how your 
machine is setup, this WILL most likely hose your system anyway.

2) You could install FreeDOS to a virtual machine like VirtualBox or 
QEMU. 

3) You could do a hybrid install into DOSBox. The installer defaults to 
hybrid on that virtual platform. There are DOCs and Youtube videos 
on how to do type of install. The benefit is having direct and easy
access to the DOS filesystem from the host. There are some drawbacks.
It is best suited for developers. 

4) Install manually. After setting up a partition and it’s boot sector, I would 
proceed one of two ways. I would either install FreeDOS into a VM’s 
hard drive using a flat disk image, then copy the files to the hard disk
partition. Or…. copy over the kernel and command. Then unzip the 
FDNPKG and FDIMPLES packages. If you place their files in the proper
directories, adjust the FDNPKG.CFG file and configure a few environment
variables, you could then use them to install all the other packages. 

Jerome




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


Re: [Freedos-user] Can FreeDOS Be Installed By Means Of UNIX Commands?

2023-07-16 Thread Felix Miata via Freedos-user
Jay F. Shachter composed on 2023-07-16 09:21 (UTC-0500):

> I have a computer, with an MBR-partitioned disk, that is configured to
> perform Legacy boot.  Microsoft Windows is installed on three primary
> partitions, because that is what Windows does

It did that because you didn't take control. It's your computer. If you only
give Windows one acceptable option, that's what it will use. So, partition
in advance. Following is an example based on one of my older Dell's old HDD:

|ID |ux|Type, description|Format  |Related |VolumeLabel|OS2-LVM/LABEL|Size 
MiB |
+--[/dev/sda  MBR disk  1]++---[Toshiba 
DT01ACA1]+-+
|01 |  |FreeSpace Wasted |-- -- --|-- -- --|- - - - - -| |  
1.0|
|01*| 1|Prim 0b FAT32|FAT32   |FRDOS5.1|P01ST10C   |To10P01 WINBOOT  |
400.0|
|02*| 2|Prim bb AcrHidden|FAT32   |DFSe11.x|SS10P02DOS |To10P02DOSBOOT   |
509.0|
|03>| 3|Prim 83 LinuxNatv|EXT2|GRUB|03realboot |To10P03 realboot |
400.0|
|04 | 5|Log  82 SunS/SWAP|SWAP|LinuxV1 |SWAPSPACE2 |To10P05 swapper  |   
4102.0|
|05*| 6|Log  07 Inst-FSys|NTFS|Win NT  |P06ST10D   |To10P06 WinXP|   
6401.0|
|06 | 7|Log  07 DfsNoWarn|-   |unknown |   |To10P07 Win8 |  
48000.0|
|07*| 8|Log  83 LinuxNatv|EXT4|GRUB|08s151 |To10P08 suse 151 |  
1.0|
|08*| 9|Log  83 LinuxNatv|EXT4|GRUB|09s423 |To10P09 suse 423 |  
1.0|

Given the above, Windows will use the 48000 MiB space to install 7, 8 or 10,
though you may find it carves that space into two, depending on which Windows
version, and how you answer its questions.

> and every other
> operating system on this computer must find a home for itself within
> the logical partitions carved out of the fourth, extended partition.
 
Start over the right way, and "all" won't have to. Logicals are perfectly
usable by Linux and Windows both. Once they've booted, nothing that counts
knows which kind of partitions the filesystems live on.
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata


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


Re: [Freedos-user] Can FreeDOS Be Installed By Means Of UNIX Commands?

2023-07-16 Thread C. Masloch via Freedos-user

Hi,

On at 2023-07-16 09:21 -0500, Jay F. Shachter via Freedos-user wrote:


Esteemed Colleagues:

I have a computer, with an MBR-partitioned disk, that is configured to
perform Legacy boot.  Microsoft Windows is installed on three primary
partitions, because that is what Windows does, and every other
operating system on this computer must find a home for itself within
the logical partitions carved out of the fourth, extended partition.

I want to install FreeDOS on a logical partition.  So my first
question is: Does FreeDOS even support this?  Many operating systems
do not, and only support installation on primary partitions, and on
GPT-partitioned disks.


The FreeDOS kernel expects its FDCONFIG.SYS ("altconfig", the preferred 
alternative) or CONFIG.SYS ("oldconfig", the old fallback) on whatever 
file system it detects as the C: drive. Technically, this is the *only* 
file you need on what is detected as drive C:, as you can use lines like 
"device=f:\..." and "shell=f:\command.com /p:f:\fdauto.bat" to make use 
of a different drive for other things. (Some DOS programs may expect to 
use drive C: regardless, so watch out.)


(Using the kernel command line extension I added [1] to the kernel in 
2022, you can specify different CONFIG/ALTCONFIG/OLDCONFIG pathnames to 
try a file on a different drive than drive C:, but the only ways to pass 
a kernel command line are currently to boot into my debugger (lDebug 
[2], with a small L) and use it to load the kernel; or to pack the 
kernel executable into my iniload + fdkernpl stages then boot it as 
Multiboot1 or Multiboot2 specification kernel from GRUB which allows to 
pass along a command line as well. I can give more detailed instructions 
on those if you want.)


The kernel will detect drive C: based on which partitions are primary 
and logical. If you have only a single HDD, then probably the first 
visible primary FAT FS partition gets to be drive C: (regardless the 
actual placement on the hard disk; only the position in the partition 
tables should matter).


The kernel is loaded in its entirety by the boot sector loader, or 
whatever is fulfilling its role. That means the kernel itself doesn't 
need to know what drive/partition it was loaded from. Technically, the 
loader will pass along the boot sector with a BPB/EBPB of what partition 
it loaded from, but the kernel does not (yet) make any use of it. (Not 
true if you replace the FreeDOS kernel file by my debugger executable, 
lDebug does make use of this info.) This includes that it does not use 
it for the determination of what drive gets to be drive C:.


As for the boot sector loader, FreeDOS's originals should be able to 
load from a logical partition if you correctly set up the hidden sectors 
field (should give LBA sector number of the boot sector itself in the 
total disk unit, not uninitialised and not counting within the extended 
partition) and possibly the two CHS geometry fields (if the sector will 
use CHS access to load the kernel). All you need to do then is to 
instruct your prior loader to chainload the boot sector loader, either 
from a dump file or from the actual boot sector of the logical partition.


(In my ldosboot repo [3] I provide alternative loaders which can with 
some degree of success auto-detect the hidden sectors and CHS geometry. 
However, not all of these features are available in combination with the 
FreeDOS load protocol because of how much code it requires. But you 
could instead use the lDOS boot loaders to load lDebug, then use lDebug 
to load the FreeDOS kernel.)


To install the proper superblock values into a boot sector dump file, or 
inversely install the proper boot loader into the actual sector while 
leaving intact the superblock values (called the BPB or EBPB), you can 
use a DOS tool like my instsect (a build is included in lDebug packages) 
or the kernel's SYS utility (comes with kernel builds). SYS will 
obviously default to install the loader corresponding to its kernel; 
instsect has default loaders built-in but you can specify a file to read 
the loader from instead. (Do not try lDebug's instsect's default 
built-in loader with the unmodified FreeDOS kernel -- it will fail to 
load it, even if you change the filenames to match. This is because 
these loaders load using the lDOS load protocol rather than the FreeDOS 
one.)


SYS can write the resulting sector to a drive or to a dump file, 
likewise instsect. What I think is a feature unique to instsect is to 
operate on a partition image that appears to DOS as a file, rather than 
a drive, both for reading the superblock values as well as installing 
the resulting sector. However, both programs are DOS programs, so you 
need some sort of DOS running on the system or with access to the drive 
(image) that you want to install to.


The core feature of SYS and instsect is not super difficult to replicate 
using dd. You just need to copy over the (E)BPB of the superblock to 
combine it with the 

Re: [Freedos-user] Can FreeDOS Be Installed By Means Of UNIX Commands?

2023-07-16 Thread Bryan Kilgallin via Freedos-user

G'day, Jay:


Microsoft Windows is installed on three primary
partitions, because that is what Windows does, and every other
operating system on this computer must find a home for itself within
the logical partitions carved out of the fourth, extended partition.


Ugh!


The
installation procedure scares me.


Back up!


 "Quidquid latine dictum sit, altum videtur"


Not profound, just pompous!
--
members.iinet.net.au/~kilgallin/


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


[Freedos-user] Can FreeDOS Be Installed By Means Of UNIX Commands?

2023-07-16 Thread Jay F. Shachter via Freedos-user


Esteemed Colleagues:

I have a computer, with an MBR-partitioned disk, that is configured to
perform Legacy boot.  Microsoft Windows is installed on three primary
partitions, because that is what Windows does, and every other
operating system on this computer must find a home for itself within
the logical partitions carved out of the fourth, extended partition.

I want to install FreeDOS on a logical partition.  So my first
question is: Does FreeDOS even support this?  Many operating systems
do not, and only support installation on primary partitions, and on
GPT-partitioned disks.

If the answer to the first question is Yes, then I can continue this
narrative, otherwise the remainder of this posting is moot.  I copied
FD13FULL.img to a USB stick, stuck it into the above-described
computer, and instructed it to boot from the USB device.  The
installation procedure scares me.  I have already partitioned my disk
and designated in my mind the logical slice onto which I want to
install FreeDOS, but the installation procedure on FD13FULL.img
implies that I must repartition my disk, and I am afraid to proceed,
lest I irretrievably trash my entire computer.

Is it possible to install FreeDOS using UNIX commands, which I know
how to control?  I envision doing a "mkfs -t vfat" on the logical
slice of disk on which I want to install the system, mounting the USB
stick on some arbitrary directory, and then populating the
newly-created vfat filesystem by means of the cp and unzip commands
(the packages, I noticed -- and there is a huge number of them -- are
zip files, but there are also some files that are fundamental to
system that are already present without having to be unzipped, which I
envision simply copying over).  And then finally I envision using the
dd command in some way to populate the first block of the vfat
filesystem with a bootloader, so that GRUB can boot FreeDOS with
something along the lines of "chainloader (hd0,msdos11)+1".  Or
perhaps a bootloader is unnecessary, perhaps GRUB can be given the
name of the FreeDOS kernel and boot directly into it without having to
use the chainloader command.

Is this possible?  If a FreeDOS system is populated in this way, will
the kernel be able to boot and then figure out how big the disk is and
all the other things that will be different than they were in
FD13FULL.img?  If not, is there anyone reading this who is willing to
gently and patiently walk me thru the native install procedure and
assure me that it will not trash my hard drive?

As always, thank you in advance for any and all replies.

Jay F. Shachter
6424 North Whipple Street
Chicago IL  60645-4111
(1-773)7613784   landline
(1-410)9964737   GoogleVoice
j...@m5.chicago.il.us
http://m5.chicago.il.us

"Quidquid latine dictum sit, altum videtur"



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