Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.misc > #1914

Re: hard disk image

From Paul Edwards <mutazilah@gmail.com>
Newsgroups comp.os.os2.programmer.misc
Subject Re: hard disk image
Date 2024-03-18 08:01 +0800
Organization A noiseless patient Spider
Message-ID <ut809i$3q47h$1@dont-email.me> (permalink)
References <usn514$3lml7$1@dont-email.me>

Show all headers | View raw


On 11/03/24 22:38, Paul Edwards wrote:

After a lot of effort, I can now answer my own questions.

> This is a FAT32, MBR and the partition starts at
> sector LBA 128, not LBA 63.

ArcaOS documents this vaguely as "CHS aligned".

When it creates a partition at beginning of free
space, it starts on LBA 63, which means it is
track-aligned, not cylinder-aligned.

However, the end of the partition is indeed
cylinder aligned.

But actually it accepts the start of the partition
not even track aligned, as in this 128 example below.

Thus this command (using the latest bug-fixed parted):

D:\scratch\xxx>parted mkpart 0x80,0x0b,128,954448 pdos.vhd

D:\scratch\xxx>hexdump pdos.vhd 0 512
...
0001A0  00000000 00000000 00000000 00000000  ................
0001B0  00000000 00000000 230CA653 00008002  ........#..S....
0001C0  03000B0F FFB28000 00005090 0E000000  ..........P.....
0001D0  00000000 00000000 00000000 00000000  ................
0001E0  00000000 00000000 00000000 00000000  ................
0001F0  00000000 00000000 00000000 000055AA  ..............U.


has an end head of 0F (offset 1C3) and the FF is actually 3F,
meaning sector number 63. The high 2 bits should be ignored -
they are part of the cylinder number.

This VHD has a geometry of 16 heads, as seen here
at offset 3A:

D:\scratch\xxx>hexdump pdos.vhd 488743424
1D21A200 636F6E65 63746978 00000002 00010000  conectix........
1D21A210 FFFFFFFF FFFFFFFF 2D8A2B2E 77696E20  ........-.+.win
1D21A220 00060001 5769326B 00000000 1D21A200  ....Wi2k.....!..
1D21A230 00000000 1D21A200 03B3103F 00000002  .....!.....?....
1D21A240 FFFFEB3E 27146D29 2607290F 202E1426  ...>'.m)&.). ..&
1D21A250 496C2B22 00000000 00000000 00000000  Il+"............
1D21A260 00000000 00000000 00000000 00000000  ................

and 63 sectors per track as per offset 3B, and
number of cylinders 3B3 (big endian format at 38).


Although it seems that any start value can be used,
I chose to use 504 to get a clean track alignment,
as well as being 4k-aligned. That's a trivial amount
of wasted space (about 200k).

Here is the command I (now) use:

parted --boot devel\pdos\src\mbr.com mkpart 0x80,0x0b,504,954072 ..\pdos.vhd

However, I think I will take advantage of the fact
that 128 is accepted to return to what I was using
before.

Note that I am using x'0b' to indicate that the CHS
values are accurate - as required by ArcaOS, rather
than x'0c' to say that LBA should be used as the CHS
values may be inaccurate. It is ironic that ArcaOS
uses x'0c' in partitions it creates given that it
relies on the CHS.

Finally, ArcaOS doesn't appear to properly detect or
enforce that the end CHS is cylinder-aligned, so
doesn't always throw an error. The fact that it
doesn't throw an error doesn't mean that there isn't
a problem with failing to properly align. It may or
may not be OK. I don't have sufficient insight into
ArcaOS internals.

Anyway, the end result of this is a FAT32 VHD in
pdoso.zip (not pdos.zip) at http://pdos.org that
contains a bootable image of PDOS/386 (a partial
Windows, OS/2 and Linux clone) with native OS/2
LX executables sufficient to run a toolchain
(which includes gcc 3.2.3) so that you are in a
position to compile (or write new software) any
other C90-compliant software available. And there
is a masm (subset) compatible assembler too (as86),
so you can write assembler in traditional standard
format too.

Simply add the disk (the disk is standard FAT32 -
there is no LVM information or anything else that
is specific to ArcaOS - so you need to use ArcaOS
to add that) to the ArcaOS machine in Virtualbox,
open a command prompt and run lvmgui, select the
partition, then volume, create volume (I chose
non-bootable and compatible - other options may
work but I didn't try them and I don't know what
they mean).

When you exit, you should have a D drive or whatever.

Then you can do:

path %path%;d:\dos
d:
cd \devel\pdos\pdpclib
pdmake -f makefile.sos
pdptest abc def

to demonstrate the software.

BFN. Paul.

Back to comp.os.os2.programmer.misc | Previous | NextPrevious in thread | Find similar


Thread

hard disk image Paul Edwards <mutazilah@gmail.com> - 2024-03-11 22:38 +0800
  Re: hard disk image Paul Edwards <mutazilah@gmail.com> - 2024-03-12 00:19 +0800
  Re: hard disk image Dave Yeo <dave.r.yeo@gmail.com> - 2024-03-11 10:59 -0700
    Re: hard disk image Paul Edwards <mutazilah@gmail.com> - 2024-03-12 04:22 +0800
      Re: hard disk image Dave Yeo <dave.r.yeo@gmail.com> - 2024-03-11 16:12 -0700
        Re: hard disk image Paul Edwards <mutazilah@gmail.com> - 2024-03-12 11:59 +0800
          Re: hard disk image Paul Edwards <mutazilah@gmail.com> - 2024-03-12 19:13 +0800
          Re: hard disk image Dave Yeo <dave.r.yeo@gmail.com> - 2024-03-12 08:59 -0700
    Re: hard disk image Marcel Mueller <news.5.maazl@spamgourmet.org> - 2024-03-11 21:54 +0100
  Re: hard disk image Paul Edwards <mutazilah@gmail.com> - 2024-03-18 08:01 +0800

csiph-web