Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Installing and booting and OF3 machine from a single empty internal disk, not working



I've been working on finding a way to get the install CD to properly
prepare an internal disk so it will automatically boot (with the
proper firmware boot command, of course) on an OF3 machine. The goal
is to be able to have an OF3 Mac with an install CD and end up with a
working, booting NetBSD OS.

I may not be smart enough about the bootstrap process for OF3 Macs in
order to do this, especially with an MSDOS partition, so I'll just say
what I've done and see if anyone can help. I'm not finding a lot of
info about the exact boot process these Macs use.

My particular machine is this one:

http://www.everymac.com/systems/apple/powermac_g3/stats/powermac_g3_400_bl.html

It has the newer motherboard with "402" on the IDE controller.

It has a single 200 gig disk in it. I think it isn't a problem that it
is larger than 128 gigs, but maybe it is and it isn't obvious to me?

The reason why I think this can or should work is, OpenBSD and other
operating systems can apparently do it. So it seems like NetBSD should
be able to do it. "it" being making a bootable MSDOS partition and
then booting from it.

I'm not sure where to start or if I've properly researched this
(usually someone will point out that I haven't) but here are some
points:

o If I install off the CD as per normal (using a 2 gig root disk so I
know it's inside the first 128 gig), I cannot load the ofwboot.xcf
from somewhere (network, CD) and then point it at the NetBSD disk and
ask it to load the kernel. Actually, I can, but the kernel stops and
asks me for a root device, and at that point the keyboard isn't
working so I can't type it in. I suppose I could compile a kernel with
a harcoded "wd0a" as the root device or something. This means that
even if I load ofwboot.xcf from somewhere other than the internal
disk, I still can't figure out a way to tell it to properly boot from
the internal disk. This is the command I'm using:

boot cd:,ofwboot.xcf ultra0:0/netbsd

Like I said, this does boot the kernel, but it stops and asks me for a
root device and I can't type it in.

o If I boot the install cd and then go to a prompt and attempt to make
an MSDOS partition similar to OpenBSD's setup, I'm not able to then
disklabel the disk, and it may be because I'm using the wrong fdisk
command or something. For example, this is what fdisk from NetBSD says
about the OpenBSD created disk:

netbsd# fdisk -vv wd0
fdisk: Cannot determine the number of heads
Disk: /dev/rwd0c
NetBSD disklabel disk geometry:
cylinders: 387621, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 390721968

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 390721968

Partition table:
0: Primary 'big' DOS, 16-bit FAT (> 32MB) (sysid 6)
    start 1, size 2048 (1 MB, Cyls 0/0/2-0/32/33), Active
        beg: cylinder    0, head   0, sector  2
        end: cylinder    2, head   0, sector 33
        Information from PBR:
            PBR appears to be bootable
            OEM name: "BSD  4.4"
            BPB FAT16 boot signature found
1: <UNUSED> (sysid 0)
    start 0, size 0
        beg: cylinder    0, head   0, sector  0
        end: cylinder    0, head   0, sector  0
2: <UNUSED> (sysid 0)
    start 0, size 0
        beg: cylinder    0, head   0, sector  0
        end: cylinder    0, head   0, sector  0
3: OpenBSD (sysid 166)
    start 3024, size 390718944 (190781 MB, Cyls 0/48/1-24321/80/63)
        beg: cylinder    3, head   0, sector  1
        end: cylinder 1023, head  15, sector 63
        Information from PBR:
            Not bootable: All bytes are identical (0x00)
            Not bootable: Bad magic number (0x0000)
First active partition: 0

I'm not figuring out how to get this stuff to happen in NetBSD:

            PBR appears to be bootable
            OEM name: "BSD  4.4"
            BPB FAT16 boot signature found

I'm guessing this is some primary bootstrap that is installed by fdisk
or something? Not sure.

This is what OpenBSD's disklabel says about it. NetBSD doesn't read
OpenBSD's disklabel apparently:

openbsd# disklabel wd0
# Inside MBR partition 3: type A6 start 3024 size 390718944
# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: ST3200822A
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 387621
total sectors: 390721968
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:        386523648          4198320  4.2BSD   2048 16384    1
  b:          4195296             3024    swap
  c:        390721968                0  unused
  i:             2048                1   MSDOS


This is what I'm doing from NetBSD:

netbsd# fdisk -u wd0
fdisk: primary partition table invalid, no magic in sector 0
fdisk: Cannot determine the number of heads
Disk: /dev/rwd0c
NetBSD disklabel disk geometry:
cylinders: 387621, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 390721968

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 390721968

Do you want to change our idea of what BIOS thinks? [n]

Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
No active partition.
Which partition do you want to change?: [none] 0
The data for partition 0 is:
<UNUSED>
sysid: [0..255 default: 169] 6
start: [0..24321cyl default: 63, 0cyl, 0MB] 1
size: [0..24321cyl default: 62, 0cyl, 0MB] 2048

Partition table:
0: Primary 'big' DOS, 16-bit FAT (> 32MB) (sysid 6)
    start 1, size 2048 (1 MB, Cyls 0/0/2-0/32/33)
        PBR is not bootable: All bytes are identical (0x00)
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
No active partition.
Which partition do you want to change?: [none]

We haven't written the MBR back to disk yet.  This is your last chance.
Partition table:
0: Primary 'big' DOS, 16-bit FAT (> 32MB) (sysid 6)
    start 1, size 2048 (1 MB, Cyls 0/0/2-0/32/33)
        PBR is not bootable: All bytes are identical (0x00)
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
No active partition.
Should we write new partition table? [n] y
netbsd#

Then I make it active:

netbsd# fdisk -0 -a wd0
fdisk: Cannot determine the number of heads
Disk: /dev/rwd0c
NetBSD disklabel disk geometry:
cylinders: 387621, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 390721968

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 390721968

Partition 0:
Primary 'big' DOS, 16-bit FAT (> 32MB) (sysid 6)
    start 1, size 2048 (1 MB, Cyls 0/0/2-0/32/33)
        PBR is not bootable: All bytes are identical (0x00)
Do you want to change the active partition? [n] y
Choosing 4 will make no partition active.
active partition: [0..4 default: 0] 0
Are you happy with this choice? [n] y

We haven't written the MBR back to disk yet.  This is your last chance.
Should we write new partition table? [n] y
netbsd# fdisk wd0
fdisk: Cannot determine the number of heads
Disk: /dev/rwd0c
NetBSD disklabel disk geometry:
cylinders: 387621, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 390721968

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 390721968

Partition table:
0: Primary 'big' DOS, 16-bit FAT (> 32MB) (sysid 6)
    start 1, size 2048 (1 MB, Cyls 0/0/2-0/32/33), Active
        PBR is not bootable: All bytes are identical (0x00)
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
First active partition: 0
#

Then I try to disklabel it:

netbsd# disklabel -i wd0
partition> i
Filesystem type [?] [unused]: msdos
Start offset ('x' to start after partition 'x') [0c, 0s, 0M]: 1
Partition size ('$' for all remaining) [0c, 0s, 0M]: 2048
 i:      2048         1      MSDOS                     # (Cyl.      0*-      2*)
partition> W
Label disk [n]? y
disklabel: partitions a and b overlap
disklabel: partitions a and i overlap
disklabel: partitions b and i overlap
disklabel: ioctl DIOCWDINFO: Label magic number or checksum is wrong!
(disklabel or kernel is out of date?)
Label not written
partition> Q
netbsd#

Based on research, it seems that this is disklabel not agreeing with
what fdisk has done. If I don't use fdisk and only disklabel the disk,
this doesn't happen. But OF3 doesn't understand NetBSD disklabels, so
I'm pretty sure I can't do that.

So my questions here are:
1. What do I need to do with fdisk (or maybe installboot?) to make the
fdisk look like OpenBSD's? I haven't found any information to help me
here, and it's been difficult to search for.
2. What do I need to do with disklabel to make it label the disk?

o The previously mentioned method to simply write an iso9660 image to
the front of the disk seems like a hack to me, although I think other
architectures actually use this method for their native OS (AIX either
used to or still does, not sure). I suppose I would be fine with this
if the install CD could do it for us, or we had enough tools on the
machine to be able to do it. It might be possible to do by leaving the
front of the disk free by using fdisk and disklabel before installing,
installing NetBSD into it, mounting it, and using the tools inside it
to make this image, and then write it to the front of the disk before
rebooting? I haven't tried it partly because mkisofs changed to makefs
and I just haven't translated the syntax. I will try this next. But I
still think it's a hack.

Ok, enough for now, I hope someone can help.

Thanks,
Andy


Home | Main Index | Thread Index | Old Index