Problems booting OpenBSD on iMac G4 (Flat screen)

View: New views
7 Messages — Rating Filter:   Alert me  

Problems booting OpenBSD on iMac G4 (Flat screen)

by Steven Presser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
        I have an iMac G4 that I'm attempting to dual boot OS X and  
OpenBSD.  I'm quite aware that this would be much simpler if I didn't  
need to dual boot and used MBR partitioning, but I do need to dual boot.
        As my setup currently stands, I can get ofwboot to load, but it  
thows this error:
Found OpenBSD DPME partition
:Inappropriate file type or format
Open /pci@f4000000/ata-6@d/disk@0/bsd: unknown error: code -8097432
Boot (or "exit");

Searching the error code reveals only pages in Russian.  Reading them  
(via google translate) gives no clues as to the solution.  Searching  
that first message -- found DPME partition, indicates that this may  
be due to my partitioning.  As far as I can tell, I've followed the  
instructions.  As such, heres a general map of my partition  
(apologies for not having anything exact):
# Type
1 Apple Partition map
2 HFS #This is my OpenBSD booting partition.  ofwboot is located here
3 OpenBSD #OpenBSD root
4 HFS+ #Mac Root
Followed by some other partitions, including ones for /var, /tmp,  
and /usr which should be properly set up, as they were told to do so  
during the install process.

So, to explain a little bit more -- the 2nd partition on the disk is  
HFS (not +, not X, called HFS Standard by Disk Utility).  This is  
where I have ofwboot located.  At one point a copy of the kernel was  
here.  However, the kernel paniced booting, saying the root file  
system had size 0.  Removed that (assumed it tried to read the  
partition it was on and found it couldn't).  The OpenBSD root  
partition is of type OpenBSD and named OpenBSD, as it should be  
according to INSTALL.macppc

I had some trouble with the version of ofwboot that came with 4.4.  I  
spent a few hours reading everything I could find on google about it  
before I stumbled on one post which stated that it had been broken  
between the 4.1 and 4.2 releases, and was scheduled to be fixed by  
4.3.  (Unfortunately I've lost the link).  Was it?  Sure doesn't seem  
it -- open firmware won't even let it load before throwing out error  
messages. I'm using the 4.0 version of ofwboot, which is able to try  
loading the kernel, but fails.

So basically, I'm stuck, and any help people can give is very much  
appreciated.  Is there a version of ofwboot that somebody is using  
they know is working?  Is this a partitioning issue, or something else?

Steve


Re: Problems booting OpenBSD on iMac G4 (Flat screen)

by Mark Kettenis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> From: Steven Presser <steve160@...>
> Date: Sat, 3 Jan 2009 10:18:54 -0500
>
> Hi all,
> I have an iMac G4 that I'm attempting to dual boot OS X and  
> OpenBSD.  I'm quite aware that this would be much simpler if I didn't  
> need to dual boot and used MBR partitioning, but I do need to dual boot.
> As my setup currently stands, I can get ofwboot to load, but it  
> thows this error:
> Found OpenBSD DPME partition
> :Inappropriate file type or format
> Open /pci@f4000000/ata-6@d/disk@0/bsd: unknown error: code -8097432
> Boot (or "exit");
>
> Searching the error code reveals only pages in Russian.  Reading them  
> (via google translate) gives no clues as to the solution.  Searching  
> that first message -- found DPME partition, indicates that this may  
> be due to my partitioning.  As far as I can tell, I've followed the  
> instructions.  As such, heres a general map of my partition  
> (apologies for not having anything exact):
> # Type
> 1 Apple Partition map
> 2 HFS #This is my OpenBSD booting partition.  ofwboot is located here
> 3 OpenBSD #OpenBSD root
> 4 HFS+ #Mac Root
> Followed by some other partitions, including ones for /var, /tmp,  
> and /usr which should be properly set up, as they were told to do so  
> during the install process.

Well, that partition table looks a bit strange.  For one thing, you
really want a single OpenBSD partition, that you then later divide
into root, /usr, /var partitions using disklabel.

I also think, you should have that OpenBSD partition *after* the MacOS
partition, and store ofwboot in the root of the MacOS partition.

Anyway, here is what my pdisk /dev/wd0c says on my dual boot Mac.

Partition map (with 512 byte blocks) on '/dev/wd0c'
 #:                type name                    length   base      ( size )
 1: Apple_partition_map Apple                       63 @ 1        
 2:          Apple_Free                         262144 @ 64        (128.0M)
 3:           Apple_HFS Apple_HFS_Untitled_2 112984064 @ 262208    ( 53.9G)
 4:     Apple_UNIX_SVR2 Swap                   1572864 @ 113246272 (768.0M)
 5:             OpenBSD OpenBSD               25165824 @ 114819136 ( 12.0G)
 6:          Apple_Free Extra                 16316528 @ 139984960 (  7.8G)


Re: Problems booting OpenBSD on iMac G4 (Flat screen)

by Steven Presser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hm ok.

I set up a separate HFS partition (note: NOT HFS+) for ofwboot  
because it did not seem to like booting from the HFS+ partition with  
OS X.  Trying to do so only got: "HD:,ofwboot : can't open" in Open  
Firmware.  So I created this separate HFS partition.

Disklabel didn't seem to object to this setup.  It considered the  
whole disk to be its 'domain' to play in, and even autoadded the HFS  
partitions to the label.  It didnt automatically show any of the  
OpenBSD partitions, even the one named openbsd -- I had to manually  
add those.

I'd like to try everything possible before repartitioning -- I've had  
to do it twice, and its become a huge pain.  Do you happen to know  
what version of ofwboot you're using?

I notice you have a partition of type Apple_UNIX_SVR2 that is a swap  
partition.  How did you create this partition?  Via pdisk/Disk  
Utility/OpenBSD installer?

Here is a full partition map (comments at the end of lines after #:
Partition map (with 512 byte blocks) on '/dev/disk0'
  #:                type name                    length   base      
( size )
  1: Apple_partition_map Apple                       63 @ 1
  2:           Apple_HFS Apple_HFS_Untitled_1   1048576 @ 64        
(512.0M) #ofwboot
  3:             OpenBSD OpenBSD                9699264 @ 1048640    
(  4.6G) #openbsd root
  4:           Apple_HFS Apple_HFS_Untitled_2  14417920 @ 10747904  
(  6.9G) #OSX root
  5:          Apple_Free                        8650752 @ 25165824  
(  4.1G)
  6:           Apple_HFS Apple_HFS_Untitled_3  24903680 @ 33816576  
( 11.9G) #More for OSX
  7:          Apple_Boot eXternal booter          17408 @ 58720256  
(  8.5M)
  8:           Apple_UFS Apple_UFS_Untitled_4   2079744 @ 58737664  
(1015.5M) #var
  9:          Apple_Free                       10485760 @ 60817408  
(  5.0G)
10:          Apple_Boot eXternal booter          17408 @ 71303168  
(  8.5M)
11:           Apple_UFS Apple_UFS_Untitled_5   8371200 @ 71320576  
(  4.0G) #usr
12:           Apple_HFS Apple_HFS_Untitled_6    524288 @ 79691776  
(256.0M) #tmp
13:          Apple_Free                       10485760 @ 80216064  
(  5.0G)
14:          Apple_Boot eXternal booter          17408 @ 90701824  
(  8.5M)
15:           Apple_UFS Apple_UFS_Untitled_7   1031168 @ 90719232  
(503.5M) #swap
16:          Apple_Free                         262144 @ 91750400  
(128.0M)
17:           Apple_HFS Apple_HFS_Untitled_8  64288928 @ 92012544  
( 30.7G) #Shared partition for docs
18:          Apple_Free                             16 @ 156301472

Device block size=512, Number of Blocks=156301488 (74.5G)
DeviceType=0x0, DeviceId=0x0

Egads, I need to do some work on that.

Steve

On Jan 3, 2009, at 12:14 PM, Mark Kettenis wrote:

>> From: Steven Presser <steve160@...>
>> Date: Sat, 3 Jan 2009 10:18:54 -0500
>>
>> Hi all,
>> I have an iMac G4 that I'm attempting to dual boot OS X and
>> OpenBSD.  I'm quite aware that this would be much simpler if I didn't
>> need to dual boot and used MBR partitioning, but I do need to dual  
>> boot.
>> As my setup currently stands, I can get ofwboot to load, but it
>> thows this error:
>> Found OpenBSD DPME partition
>> :Inappropriate file type or format
>> Open /pci@f4000000/ata-6@d/disk@0/bsd: unknown error: code -8097432
>> Boot (or "exit");
>>
>> Searching the error code reveals only pages in Russian.  Reading them
>> (via google translate) gives no clues as to the solution.  Searching
>> that first message -- found DPME partition, indicates that this may
>> be due to my partitioning.  As far as I can tell, I've followed the
>> instructions.  As such, heres a general map of my partition
>> (apologies for not having anything exact):
>> # Type
>> 1 Apple Partition map
>> 2 HFS #This is my OpenBSD booting partition.  ofwboot is  
>> located here
>> 3 OpenBSD #OpenBSD root
>> 4 HFS+ #Mac Root
>> Followed by some other partitions, including ones for /var, /tmp,
>> and /usr which should be properly set up, as they were told to do so
>> during the install process.
>
> Well, that partition table looks a bit strange.  For one thing, you
> really want a single OpenBSD partition, that you then later divide
> into root, /usr, /var partitions using disklabel.
>
> I also think, you should have that OpenBSD partition *after* the MacOS
> partition, and store ofwboot in the root of the MacOS partition.
>
> Anyway, here is what my pdisk /dev/wd0c says on my dual boot Mac.
>
> Partition map (with 512 byte blocks) on '/dev/wd0c'
>  #:                type name                    length   base      
> ( size )
>  1: Apple_partition_map Apple                       63 @ 1
>  2:          Apple_Free                         262144 @ 64        
> (128.0M)
>  3:           Apple_HFS Apple_HFS_Untitled_2 112984064 @ 262208    
> ( 53.9G)
>  4:     Apple_UNIX_SVR2 Swap                   1572864 @ 113246272  
> (768.0M)
>  5:             OpenBSD OpenBSD               25165824 @ 114819136  
> ( 12.0G)
>  6:          Apple_Free Extra                 16316528 @ 139984960  
> (  7.8G)


Re: Problems booting OpenBSD on iMac G4 (Flat screen)

by Josh Elsasser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jan 03, 2009 at 06:14:50PM +0100, Mark Kettenis wrote:
> Well, that partition table looks a bit strange.  For one thing, you
> really want a single OpenBSD partition, that you then later divide
> into root, /usr, /var partitions using disklabel.
>
> I also think, you should have that OpenBSD partition *after* the MacOS
> partition, and store ofwboot in the root of the MacOS partition.
>
> Anyway, here is what my pdisk /dev/wd0c says on my dual boot Mac.

FWIW, I have ofwboot on a separate HFS partition which comes before
anything else except the MacOS 9 drivers partitions.  I did change the
type though, to keep MacOS from automatically mounting it and possibly
messing up the blessing magic that I did.

Partition map (with 512 byte blocks) on '/dev/rwd0c'
 #:                type name               length   base      ( size )
 1: Apple_partition_map Apple                  63 @ 1
 2:      Apple_Driver43*Macintosh              56 @ 64
 3:      Apple_Driver43*Macintosh              56 @ 120
 4:    Apple_Driver_ATA*Macintosh              56 @ 176
 5:    Apple_Driver_ATA*Macintosh              56 @ 232
 6:      Apple_FWDriver Macintosh             512 @ 288
 7:  Apple_Driver_IOKit Macintosh             512 @ 800
 8:       Apple_Patches Patch Partition       512 @ 1312
 9:     Apple_Bootstrap Boot                40960 @ 1824      ( 20.0M)
10:        JRE_IGNOREME OpenBSD swap      2097152 @ 42784     (  1.0G)
11:           Apple_HFS OS9               2097152 @ 2139936   (  1.0G)
12:           Apple_HFS Jaguar           10485760 @ 4237088   (  5.0G)
13:           Apple_HFS Panther          20971520 @ 14722848  ( 10.0G)
14:           Apple_HFS Tiger            41943040 @ 35694368  ( 20.0G)
15:          Apple_Boot Darwin boot        262144 @ 77637408  (128.0M)
16:          Apple_HFSX Darwin           20709376 @ 77899552  (  9.9G)
17:          Apple_Free Extra            10485760 @ 98608928  (  5.0G)
18:     Apple_UNIX_SVR2 Linux            30408704 @ 109094688 ( 14.5G)
19:     Apple_UNIX_SVR2 swap              1048576 @ 139503392 (512.0M)
20:             OpenBSD OpenBSD          20971520 @ 140551968 ( 10.0G)
21:           Apple_HFS Chicago          72918160 @ 161523488 ( 34.8G)

Device block size=512, Number of Blocks=234441648 (111.8G)
DeviceType=0x0, DeviceId=0x0
Drivers-
1:  23 @ 64, type=0x1
2:  36 @ 120, type=0xffff
3:  21 @ 176, type=0x701
4:  34 @ 232, type=0xf8ff


Re: Problems booting OpenBSD on iMac G4 (Flat screen)

by Dale Rahn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jan 03, 2009 at 01:10:39PM -0500, Steven Presser wrote:
> Hm ok.
>
> I set up a separate HFS partition (note: NOT HFS+) for ofwboot  
> because it did not seem to like booting from the HFS+ partition with  
> OS X.  Trying to do so only got: "HD:,ofwboot : can't open" in Open  
> Firmware.  So I created this separate HFS partition.
>

This is not quite true. OpenBSD (openfirmware really) cannot load a
file from a _Case_Sensitive_ HFS+ filesystem, a normal HFS+ file system
should not be a problem.

Dale Rahn drahn@...


Re: Problems booting OpenBSD on iMac G4 (Flat screen)

by Steven Presser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All,
Thanks for your help.  I decided to just make things simple and not  
mess around with throwing OS's all over the disk.  I took a chunk of  
space on the middle of the disk and declared it OpenBSD, put the OS  
in there (on one partition), set up my swap, and reinstalled.  Worked  
like a charm!  Heres my new pdisk:

Partition map (with 512 byte blocks) on '/dev/disk0'
  #:                type name                    length   base      
( size )
  1: Apple_partition_map Apple                       63 @ 1
  2:           Apple_HFS Apple_HFS_Untitled_1   1048576 @ 64        
(512.0M)
  3:          Apple_Free Extra                  9699264 @ 1048640    
(  4.6G)
  4:           Apple_HFS Apple_HFS_Untitled_2  14417920 @ 10747904  
(  6.9G)
  5:          Apple_Free                        8650752 @ 25165824  
(  4.1G)
  6:           Apple_HFS Apple_HFS_Untitled_3  24903680 @ 33816576  
( 11.9G)
  7:             OpenBSD OpenBSD               31998976 @ 58720256  
( 15.3G)
  8:     Apple_UNIX_SVR2 OpenBSDSwap            1031168 @ 90719232  
(503.5M)
  9:          Apple_Free                         262144 @ 91750400  
(128.0M)
10:           Apple_HFS Apple_HFS_Untitled_8  64288928 @ 92012544  
( 30.7G)
11:          Apple_Free                             16 @ 156301472

Device block size=512, Number of Blocks=156301488 (74.5G)
DeviceType=0x0, DeviceId=0x0


Partition 2 is plain-jane HFS, and has ofwboot from 4.0 on it.

Only problem I can think of with this setup is the massive amount of  
space-on-disk I'm wasting.  Does Gparted work on mac/something  
similar exist?

Josh:  Any chance you want to share some of that bless'd magic?  It'd  
be really nice to not have to play with bootloaders as well...

Dale:  It seemed to be causing problems.  Of course, my HFS+ fs seems  
to be semi-case sensitive at the moment -- it can find /volumes and "/
Volumes/Macintosh HD" but not "/volumes/Macintosh HD".  Annoying.

Apologies for the length -- I'm trying to make sure everything is  
documented for the next person who makes the same mistake.

Steve

On Jan 3, 2009, at 1:20 PM, Josh Elsasser wrote:

> On Sat, Jan 03, 2009 at 06:14:50PM +0100, Mark Kettenis wrote:
>> Well, that partition table looks a bit strange.  For one thing, you
>> really want a single OpenBSD partition, that you then later divide
>> into root, /usr, /var partitions using disklabel.
>>
>> I also think, you should have that OpenBSD partition *after* the  
>> MacOS
>> partition, and store ofwboot in the root of the MacOS partition.
>>
>> Anyway, here is what my pdisk /dev/wd0c says on my dual boot Mac.
>
> FWIW, I have ofwboot on a separate HFS partition which comes before
> anything else except the MacOS 9 drivers partitions.  I did change the
> type though, to keep MacOS from automatically mounting it and possibly
> messing up the blessing magic that I did.
>
> Partition map (with 512 byte blocks) on '/dev/rwd0c'
>  #:                type name               length   base      ( size )
>  1: Apple_partition_map Apple                  63 @ 1
>  2:      Apple_Driver43*Macintosh              56 @ 64
>  3:      Apple_Driver43*Macintosh              56 @ 120
>  4:    Apple_Driver_ATA*Macintosh              56 @ 176
>  5:    Apple_Driver_ATA*Macintosh              56 @ 232
>  6:      Apple_FWDriver Macintosh             512 @ 288
>  7:  Apple_Driver_IOKit Macintosh             512 @ 800
>  8:       Apple_Patches Patch Partition       512 @ 1312
>  9:     Apple_Bootstrap Boot                40960 @ 1824      ( 20.0M)
> 10:        JRE_IGNOREME OpenBSD swap      2097152 @ 42784     (  1.0G)
> 11:           Apple_HFS OS9               2097152 @ 2139936   (  1.0G)
> 12:           Apple_HFS Jaguar           10485760 @ 4237088   (  5.0G)
> 13:           Apple_HFS Panther          20971520 @ 14722848  ( 10.0G)
> 14:           Apple_HFS Tiger            41943040 @ 35694368  ( 20.0G)
> 15:          Apple_Boot Darwin boot        262144 @ 77637408  (128.0M)
> 16:          Apple_HFSX Darwin           20709376 @ 77899552  (  9.9G)
> 17:          Apple_Free Extra            10485760 @ 98608928  (  5.0G)
> 18:     Apple_UNIX_SVR2 Linux            30408704 @ 109094688 ( 14.5G)
> 19:     Apple_UNIX_SVR2 swap              1048576 @ 139503392 (512.0M)
> 20:             OpenBSD OpenBSD          20971520 @ 140551968 ( 10.0G)
> 21:           Apple_HFS Chicago          72918160 @ 161523488 ( 34.8G)
>
> Device block size=512, Number of Blocks=234441648 (111.8G)
> DeviceType=0x0, DeviceId=0x0
> Drivers-
> 1:  23 @ 64, type=0x1
> 2:  36 @ 120, type=0xffff
> 3:  21 @ 176, type=0x701
> 4:  34 @ 232, type=0xf8ff


Re: Problems booting OpenBSD on iMac G4 (Flat screen)

by Josh Elsasser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jan 03, 2009 at 05:53:02PM -0500, Steven Presser wrote:
> Josh:  Any chance you want to share some of that bless'd magic?  It'd be
> really nice to not have to play with bootloaders as well...

Sure, heres's the bootselector script:

<CHRP-BOOT>
<COMPATIBLE>
MacRISC MacRISC3 MacRISC4
</COMPATIBLE>
<DESCRIPTION>
A simple bootselector
</DESCRIPTION>
<BOOT-SCRIPT>
: lc ( char -- char )
    dup [char] A [char] Z between if [char] a [char] A - + then ;
: bootsel ( -- )
    cr
    " Choose one of the following:"                                     type cr
    "  d Darwin               hd:15,\\:tbxi"                            type cr
    "  l Linux                hd:9,lunix\yaboot"                        type cr
    "  8 MacOS 8              hd:10,\\:tbxi"                            type cr
    "  9 MacOS 9              hd:11,\\:tbxi"                            type cr
    "  2 MacOS 10.2 Jaguar    hd:12,System\Library\CoreServices\BootX"  type cr
    "  3 MacOS 10.3 Panther   hd:13,System\Library\CoreServices\BootX"  type cr
    "  4 MacOS 10.4 Tiger     hd:14,System\Library\CoreServices\BootX"  type cr
    "  5 MacOS 10.5 Leopard   ultra1:10,\\:tbxi"                        type cr
    "  o OpenBSD rel          hd:9,openbsd\ofwboot"                     type cr
    "  c OpenBSD cur          ultra1:9,boot\ofwboot"                    type cr
    "  f Open Firmware Prompt"                                          type cr
    "  r Reboot"                                                        type cr
    "  s Shut Down"                                                     type cr
    begin key lc case
        [char] d of " boot hd:15,\\:tbxi"                               endof
        [char] l of " boot hd:9,lunix\yaboot"                           endof
        [char] 8 of " boot hd:10,\\:tbxi"                               endof
        [char] 9 of " boot hd:11,\\:tbxi"                               endof
        [char] 2 of " boot hd:12,System\Library\CoreServices\BootX"     endof
        [char] 3 of " boot hd:13,System\Library\CoreServices\BootX"     endof
        [char] 4 of " boot hd:14,System\Library\CoreServices\BootX"     endof
        [char] 5 of " boot ultra1:10,\\:tbxi"                           endof
        [char] o of " boot hd:9,openbsd\ofwboot"                        endof
        [char] c of " boot ultra1:9,boot\ofwboot"                       endof
        [char] f of quit                                                endof
        [char] r of " reset-all"                                        endof
        [char] s of " shut-down"                                        endof
        " noop"
    endcase eval again ;
bootsel
</BOOT-SCRIPT>
</CHRP-BOOT>

Below is the shell script I run under MacOS X to install the above
file to the small boot partition.  You will need to mount the
partition first if you've changed the type from APPLE_HFS to something
else, and then create a directory on it to install the above file into.

Ideally this would allow the boot selector script to be picked when
ofw is looking for the first MacOS install on the disk, like right
after you've reset the pram.  Unfortunately this isn't the case, and
you do actually have to set the boot-device variable by hand.  I use
hd:9,\\:tbxi but you will likely need to adjust that for your
bootstrap partition.

#!/bin/sh

file="$1"
dest="$2"

if [ -z "$file" -o -z "$dest" ]; then
    echo "usage: `basename "$0"` file destdir" >&2
    exit 1
fi

if [ x0 != "x`id -u`" ]
then
    sudo=sudo
else
    sudo=
fi

case "`uname -r`" in
    9.*)
        bless="bless -folder9"
        ;;
    8.*)
        bless="bless-10.3 -folder9"
        which=`which "$bless" 2>/dev/null`
        if [ 0 != "$?" -o -z "$which" -o \! -e "$which" ]; then
            echo "error: need bless from 10.3 on this OS version"
            exit 1
        fi
        ;;
    7.*)
        bless="bless -folder9"
        ;;
    *)
        echo "error: don't know how to bless on this OS version"
        exit 1
        ;;
esac

echo "create directory $dest"
$sudo mkdir -p "$dest"
echo "install $file into $dest"
$sudo rm -f "${dest}/${file}"
$sudo cp "$file" "${dest}/${file}"
echo "set creator and type of ${dest}/${file} to chrp and txbi"
if [ -e /Developer/Tools/SetFile ]
then
    $sudo /Developer/Tools/SetFile -c chrp -t tbxi "${dest}/${file}"
else
    osascript -e 'tell application "Finder"'                        \
              -e "  set p to POSIX file "\""${dest}/${file}"\"      \
              -e '  set creator type of file p to "chrp"'           \
              -e '  set file type of file p to "tbxi"'              \
              -e 'end tell'
fi
echo "bless ${dest} as bootable"
$sudo $bless "$dest"