Qemu again

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Qemu again

Hannu Vuolasaho
Hi!

I'm trying to set up testbench for software on different archs and I
ran into few issues when trying to get openbsd to work.

Has anyone done full install and taken notes how to get OpenBSD to run
on Qemu-system-ppc ?

My current wishlist is short:
1) OpenBSD running
2) network for it

Point 1) successed from install66.iso  but the installed system doesn't boot
Trying hd,\\:tbxi...
No valid state has been set by load or init-program

I've tried few boot hd,:ofwboot /bsd variations but I'm stuck.

I try to start Qemu 4.2.0 on AMD64 linux with:
qemu-system-ppc -M mac99 -cpu g4 \
-usb -device usb-kbd \
 -hda obsd-ppc32.qcow
If I add anything on command line considering network, OpenBSD hangs,
panics or exits to firmware.

What am I missing?

Best regards,
Hannu Vuolasaho

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

Petit d'Homme
Hi,

If it's of any help, on my iBook (G3) I use "hd:,ofwboot /bsd" (and
not "hd,:ofwboot /bsd").
The comma is after the semi-colon. Don't know if it's a typo of yours or not.

Best,

Jean-Baptiste

Le lun. 13 avr. 2020 à 12:40, Hannu Vuolasaho <[hidden email]> a écrit :

>
> Hi!
>
> I'm trying to set up testbench for software on different archs and I
> ran into few issues when trying to get openbsd to work.
>
> Has anyone done full install and taken notes how to get OpenBSD to run
> on Qemu-system-ppc ?
>
> My current wishlist is short:
> 1) OpenBSD running
> 2) network for it
>
> Point 1) successed from install66.iso  but the installed system doesn't boot
> Trying hd,\\:tbxi...
> No valid state has been set by load or init-program
>
> I've tried few boot hd,:ofwboot /bsd variations but I'm stuck.
>
> I try to start Qemu 4.2.0 on AMD64 linux with:
> qemu-system-ppc -M mac99 -cpu g4 \
> -usb -device usb-kbd \
>  -hda obsd-ppc32.qcow
> If I add anything on command line considering network, OpenBSD hangs,
> panics or exits to firmware.
>
> What am I missing?
>
> Best regards,
> Hannu Vuolasaho
>

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

Peter J. Philipp-3
In reply to this post by Hannu Vuolasaho
On Mon, Apr 13, 2020 at 01:39:19PM +0300, Hannu Vuolasaho wrote:

> Hi!
>
> I'm trying to set up testbench for software on different archs and I
> ran into few issues when trying to get openbsd to work.
>
> Has anyone done full install and taken notes how to get OpenBSD to run
> on Qemu-system-ppc ?
>
> My current wishlist is short:
> 1) OpenBSD running
> 2) network for it
>
> Point 1) successed from install66.iso  but the installed system doesn't boot
> Trying hd,\\:tbxi...
> No valid state has been set by load or init-program
>
> I've tried few boot hd,:ofwboot /bsd variations but I'm stuck.
>
> I try to start Qemu 4.2.0 on AMD64 linux with:
> qemu-system-ppc -M mac99 -cpu g4 \
> -usb -device usb-kbd \
>  -hda obsd-ppc32.qcow
> If I add anything on command line considering network, OpenBSD hangs,
> panics or exits to firmware.
>
> What am I missing?
>
> Best regards,
> Hannu Vuolasaho
>

Hi Hannu,

I tried getting this working on OpenBSD/amd64 and ran into a problem as well..
Here is the string I boot the installer with:

qemu-system-ppc -M mac99,via=pmu-adb,graphics=off \
        -cpu g4 -nographic -m 2048M -vga none  \
        -hda macppc.img \
        -nic none \
        -cdrom install66.iso -boot d

This way will panic the kernel on boot, so one needs to quickly get into the
kernel config by typign -c at the boot: and then disable the ohci with the
command "disable ohci" and then "quit".

This will take it to the installer but there is an openpic message that keeps
repeating saying something like:

qemu-system-ppc: openpic_iack: bad raised IRQ 47 ctpr 7 ivpr 0x4047002f
qemu-system-ppc: openpic_iack: bad raised IRQ 47 ctpr 7 ivpr 0x4047002f

It emanates from qemu so I installed a patch to squelch it becuase I'M unsure
how to do this inside qemu.


--- hw/intc/openpic.c.orig Thu Dec 12 19:20:47 2019
+++ hw/intc/openpic.c Mon Apr 13 17:53:02 2020
@@ -55,7 +55,7 @@
 //#define DEBUG_OPENPIC
 
 #ifdef DEBUG_OPENPIC
-static const int debug_openpic = 1;
+static const int debug_openpic = 0;
 #else
 static const int debug_openpic = 0;
 #endif
@@ -1068,8 +1068,10 @@
     src = &opp->src[irq];
     if (!(src->ivpr & IVPR_ACTIVITY_MASK) ||
             !(IVPR_PRIORITY(src->ivpr) > dst->ctpr)) {
+#if 0
         error_report("%s: bad raised IRQ %d ctpr %d ivpr 0x%08x",
                 __func__, irq, dst->ctpr, src->ivpr);
+#endif
         openpic_update_irq(opp, irq);
         retval = opp->spve;
     } else {

... and then recompile the port.

So then I was able to install OpenBSD/macppc on the disk wd0.  However it
doesn't boot (like you said)... I get the message:

Welcome to OpenBIOS v1.1 built on Oct 28 2019 17:09
Trying hd:,\\:tbxi...
>> Not a bootable ELF image

Anyhow after working with it on -current and then trying 6.6 I gave up on it
tonight.  Also... I get panics when I select any nic device.  That's where it
is I guess.  Hoping someone picks up on my work, or leaves it be.

Good night!
-peter

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

rgcinjp
In reply to this post by Hannu Vuolasaho
On Mon, Apr 13, 2020 at 01:39:19PM +0300, Hannu Vuolasaho wrote:

> Hi!
>
> I'm trying to set up testbench for software on different archs and I
> ran into few issues when trying to get openbsd to work.
>
> Has anyone done full install and taken notes how to get OpenBSD to run
> on Qemu-system-ppc ?
>
> My current wishlist is short:
> 1) OpenBSD running
> 2) network for it
>
> Point 1) successed from install66.iso  but the installed system doesn't boot
> Trying hd,\\:tbxi...
> No valid state has been set by load or init-program
>
> I've tried few boot hd,:ofwboot /bsd variations but I'm stuck.
>
> I try to start Qemu 4.2.0 on AMD64 linux with:
> qemu-system-ppc -M mac99 -cpu g4 \
> -usb -device usb-kbd \
>  -hda obsd-ppc32.qcow
> If I add anything on command line considering network, OpenBSD hangs,
> panics or exits to firmware.
>
> What am I missing?

here is something i posted a while back:
https://marc.info/?l=openbsd-ppc&m=158007222311388&w=2

my current commandline is something like:
qemu-system-ppc \
-M mac99,via=pmu-adb -cpu g4 \
-nodefaults \
-nographic \
-display none \
-serial mon:stdio \
-cdrom test.iso \
-drive format=raw,file=/path/to/obsd.raw \
-boot d \
$@ 2> stderr

as you can see this is console only (a presudo serial console)

if you use '-nodefaults' USB devices will not be automatically added, 'pmu-adb'
does not need USB, so you get to workaround the USB (ohci) hang.

i redirect ... "2> stderr" ... the pesky logs to a file. thus no need to muck
around the qemu code.

> Point 1) successed from install66.iso  but the installed system doesn't boot
> Trying hd,\\:tbxi...
> No valid state has been set by load or init-program
>
> I've tried few boot hd,:ofwboot /bsd variations but I'm stuck.

please read #3 booting and blessing
i tried to do a custom openbios build to debug it but have never got around
to trying it out.

what i did to overcome this was to create a very rough ISO that contained a test
kernel (i was testing clang compiled kernels) ... and mounted the disk (wd0)
manually (something like "boot -a")... as i said, very rough.

if you used an install disk to boot from ... you get a RAMDISK ... which boots
off and mounts your work disk. this was NOT what i wanted to i had to modify
the ISO.

network has not been good to me either. one time it worked, then it just fails.

rgc

>
> Best regards,
> Hannu Vuolasaho
>

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

Peter J. Philipp-3
On Tue, Apr 14, 2020 at 09:18:18AM +0900, rgc wrote:

> > What am I missing?
>
> here is something i posted a while back:
> https://marc.info/?l=openbsd-ppc&m=158007222311388&w=2
>
> my current commandline is something like:
> qemu-system-ppc \
> -M mac99,via=pmu-adb -cpu g4 \
> -nodefaults \
> -nographic \
> -display none \
> -serial mon:stdio \
> -cdrom test.iso \
> -drive format=raw,file=/path/to/obsd.raw \
> -boot d \
> $@ 2> stderr
>
> as you can see this is console only (a presudo serial console)
>
> if you use '-nodefaults' USB devices will not be automatically added, 'pmu-adb'
> does not need USB, so you get to workaround the USB (ohci) hang.
>
> i redirect ... "2> stderr" ... the pesky logs to a file. thus no need to muck
> around the qemu code.
>
> > Point 1) successed from install66.iso  but the installed system doesn't boot
> > Trying hd,\\:tbxi...
> > No valid state has been set by load or init-program
> >
> > I've tried few boot hd,:ofwboot /bsd variations but I'm stuck.
>
> please read #3 booting and blessing
> i tried to do a custom openbios build to debug it but have never got around
> to trying it out.
>
> what i did to overcome this was to create a very rough ISO that contained a test
> kernel (i was testing clang compiled kernels) ... and mounted the disk (wd0)
> manually (something like "boot -a")... as i said, very rough.
>
> if you used an install disk to boot from ... you get a RAMDISK ... which boots
> off and mounts your work disk. this was NOT what i wanted to i had to modify
> the ISO.
>
> network has not been good to me either. one time it worked, then it just fails.
>
> rgc

Thanks for the hints rgc.  They got me a little further too.  I got a blessed
iso made with the following commands:

mkhybrid -part -r -hfs -hfs-bless tmp/ofwboot \
        -path-list path-list -o boot.iso tmp/

Where path-list just contains the list of programs that lie in tmp/ in my
case bsd.rd, bsd and ofwboot.

The darndest thing is that with the PROPOLICE kernel bsd now panics on
zscninit() so I'm personally in need of a NO_PROPOLICE GENERIC kernel and also
have the ohci removed (which -nodefaults didn't remove).

When I get home later today (I'm currently away from home) I'll compile such
a kernel and I'll report back if I can boot into the installed system then.

This has been very educational for me.  And I thank Hannu for starting this
topic.  Having a QEMU anything is always good to have.  I can live without
the -nic for now as long as I can compile kernels in QEMU on this amd64 MBP.

PS: I bypassed the zscninit panic by screwing with the register of
/aliases/scca which breaks zscninit and continues to boot (but then I'm not
seeing anything on console after the kernel finished).  The command for that
was

" reg" delete-property

in openfirmware after cd'ing into /aliases/scca.  It may seem I'm just breaking
things but I view it as intelligently breaking things to get beyond a spot to
see what's after.

Best Regards,
-peter

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

Peter J. Philipp-3
Hi again,

well I got it to boot multiuser in QEMU...

foo# uname -a                                                          
OpenBSD foo.my.domain 6.7 QEMU#0 macppc

It doesn't have network, but I made a second drive of type msdos that can
be used to transfer files in and out of the host system.

Here is my setup again:

qemu-system-ppc -M mac99,via=pmu,graphics=off \
        -cpu g4 -nographic -m 2048M -vga none  \
        -drive format=raw,file=macppc.raw \
        -drive format=raw,file=shuttle.raw \
        -nic none \
        -serial mon:stdio \
        -prom-env 'boot-device=cd:,ofwboot' \
        -prom-env 'auto-boot?=false' \
        -cdrom boot.iso -boot d

boot in openwirmware with 'boot' or set auto-boot?=true.

Here is how I made the boot.iso:

mkhybrid -part -r -hfs -hfs-bless tmp/ofwboot \
        -path-list path-list -o boot.iso tmp/

path-list contains bsd and ofwboot.

And I had to make a custom kernel.  I'll make this one available (if you
want to trust me) https://centroid.eu/private/bsd.qemu

It's almost a -current kernel, it contains a patch from mpi@ from a few
days ago that did WITNESS things (but witness is turned off), it shouldn't
make a difference.  It has "option NO_PROPOLICE" and ohci disabled.

Another thing I had to do was set the console in /etc/ttys to true so that
I'd get a login: prompt.

Enjoy!

Best Regards,
-peter

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

rgcinjp
On Tue, Apr 14, 2020 at 06:15:20PM +0200, Peter J. Philipp wrote:

> Hi again,
>
> well I got it to boot multiuser in QEMU...
>
> foo# uname -a                                                          
> OpenBSD foo.my.domain 6.7 QEMU#0 macppc
>
> It doesn't have network, but I made a second drive of type msdos that can
> be used to transfer files in and out of the host system.
>
> Here is my setup again:
>
> qemu-system-ppc -M mac99,via=pmu,graphics=off \
>         -cpu g4 -nographic -m 2048M -vga none  \
>         -drive format=raw,file=macppc.raw \
>         -drive format=raw,file=shuttle.raw \
>         -nic none \
>         -serial mon:stdio \
>         -prom-env 'boot-device=cd:,ofwboot' \
>         -prom-env 'auto-boot?=false' \
>         -cdrom boot.iso -boot d
>
> boot in openwirmware with 'boot' or set auto-boot?=true.
>
> Here is how I made the boot.iso:
>
> mkhybrid -part -r -hfs -hfs-bless tmp/ofwboot \
> -path-list path-list -o boot.iso tmp/
>
> path-list contains bsd and ofwboot.

or you can modify /usr/src/distrib/macppc/iso/Makefile, and create a
custom Makefile.qemu. that is how i create my ISO for testing/booting
OpenBSD on qemu

>
> And I had to make a custom kernel.  I'll make this one available (if you
> want to trust me) https://centroid.eu/private/bsd.qemu
>
> It's almost a -current kernel, it contains a patch from mpi@ from a few
> days ago that did WITNESS things (but witness is turned off), it shouldn't
> make a difference.  It has "option NO_PROPOLICE" and ohci disabled.

disabling scca probably will not work ... console uses this device

for the zs.c crash i usually edit zscninit

--- dev/zs.c    3 Sep 2019 04:48:00 -0000       1.30
+++ dev/zs.c    15 Apr 2020 09:50:22 -0000
@@ -1019,7 +1019,7 @@ zscninit(struct consdev *cp)
        int escc, escc_ch, obio;
        unsigned int zs_offset, zs_size;
        int ch = 0;
-       u_int32_t reg[5];
+       u_int32_t reg[10];
        char name[16];

        if ((escc_ch = OF_instance_to_package(stdin)) == -1)

i am probably masking a bug somewhere ... since the qemu firmware and the eeprom
dump of my PowerBook G4 matches so i don"t know why zs.c crashes on qemu.
with that hack you can compile with PROPOLICE (default GENERIC)

conf/GENERIC with zs.c hack and "-M mac99,via=pmu-adb" and "-nodefaults" on ports
qemu (4.2)

0 >   ok
0 > boot Trying cd:,\\:tbxi...
>> switching to new context:
>> OpenBSD/macppc BOOT 1.8
boot>
cannot open /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/etc/random.seed: No such file or directory
booting /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/6.7/macppc/bsd.rd: 9250252+483640 [394462+108+363984+376265]=0x100114
string [/cdrom@0:/6.7/macppc/bsd.rd] not found
Warning: boot device unrecognized: /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/6.7/macppc/bsd.rd
[ using 1135396 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2020 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.7-beta (GENERIC) #4: Wed Apr 15 18:50:40 JST 2020
    [hidden email]:/usr/src/sys/arch/macppc/compile/GENERIC
real mem = 134217728 (128MB)
avail mem = 104701952 (99MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root: model PowerMac3,1
cpu0 at mainbus0: 7400 (Revision 0x209): 900 MHz: L2 cache not enabled
mem0 at mainbus0
mpcpcibr0 at mainbus0 pci: uni-north
pci0 at mpcpcibr0 bus 0
macobio0 at pci0 dev 12 function 0 "Apple Keylargo" rev 0x00
macgpio0 at macobio0 offset 0x50
macgpio1 at macgpio0 offset 0x9: irq 47
pgs0 at macgpio0: irq 55
adb0 at macobio0 offset 0x16000: irq 25, via-pmu, 2 targets
apm0 at adb0: battery flags 0x91, 0% charged
akbd0 at adb0 addr 2: extended keyboard
wskbd0 at akbd0 mux 1
ams0 at adb0 addr 3: Mouse Systems A3 mouse, 1-button, 100 dpi
wsmouse0 at ams0 mux 0
zs0 at macobio0 offset 0x13000: irq 37,36
zstty0 at zs0 channel 0: console
zstty1 at zs0 channel 1
"escc-legacy" at macobio0 offset 0x12000 not configured
wdc0 at macobio0 offset 0x20000 irq 13: DMA
wd0 at wdc0 channel 0 drive 0: <QEMU HARDDISK>
wd0: 16-sector PIO, LBA48, 8192MB, 16777216 sectors
wd0(wdc0:0:0): using BIOS timings, DMA mode 2
wdc1 at macobio0 offset 0x21000 irq 14: DMA
atapiscsi0 at wdc1 channel 0 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 2.5+> removable
cd0(wdc1:0:0): using BIOS timings, DMA mode 2
openpic0 at macobio0 offset 0x40000: version 0x0 feature 3f0002 LE
memc0 at mainbus0: uni-n rev 0x7
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
bootpath: /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/6.7/macppc/bsd.rd
root device: wd0
swap device (default wd0b):
root on wd0a swap on wd0b dump on wd0b
WARNING: / was not properly unmounted
Automatic boot in progress: starting file system checks.
/dev/wd0a (29c62cbdfdfa90c9.a): 1734 files, 25569 used, 521478 free (174 frags, 65163 blocks, 0.0% fragmentation)
/dev/wd0a (29c62cbdfdfa90c9.a): MARKING FILE SYSTEM CLEAN
/dev/wd0e (29c62cbdfdfa90c9.e): 1 files, 1 used, 1030526 free (14 frags, 128814 blocks, 0.0% fragmentation)
/dev/wd0e (29c62cbdfdfa90c9.e): MARKING FILE SYSTEM CLEAN
/dev/wd0d (29c62cbdfdfa90c9.d): FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/wd0d (29c62cbdfdfa90c9.d): SUMMARY INFORMATION BAD (SALVAGED)
/dev/wd0d (29c62cbdfdfa90c9.d): BLK(S) MISSING IN BIT MAPS (SALVAGED)
/dev/wd0d (29c62cbdfdfa90c9.d): 25379 files, 421954 used, 1124661 free (6013 frags, 139831 blocks, 0.4% fragmentation)
/dev/wd0d (29c62cbdfdfa90c9.d): MARKING FILE SYSTEM CLEAN
pf enabled
starting network
reordering libraries: done.
openssl: generating isakmpd/iked RSA keys... done.
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
starting early daemons: syslogd pflogd ntpd.
starting RPC daemons:.
savecore: no core dump
checking quotas: done.
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
running rc.sysmerge
starting network daemons: smtpd sndiod.
running rc.firsttime
Path to firmware: http://firmware.openbsd.org/firmware/snapshots/
No devices found which need firmware files to be downloaded.
Path to firmware: http://firmware.openbsd.org/firmware/snapshots/
No devices found which need firmware files to be downloaded.
starting local daemons: cron.
Wed Apr 15 19:56:53 JST 2020

OpenBSD/macppc (emu.my.domain) (ttya)

login: root
Password:
OpenBSD 6.7-beta (GENERIC) #4: Wed Apr 15 18:50:40 JST 2020

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

You have mail.
emu# ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
        index 2 priority 0 llprio 3
        groups: lo
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
enc0: flags=0<>
        index 1 priority 0 llprio 3
        groups: enc
        status: active
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33168
        index 3 priority 0 llprio 3
        groups: pflog
emu#

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

Peter J. Philipp-3
On Thu, Apr 16, 2020 at 05:06:25AM +0900, rgc wrote:

> disabling scca probably will not work ... console uses this device
>
> for the zs.c crash i usually edit zscninit
>
> --- dev/zs.c    3 Sep 2019 04:48:00 -0000       1.30
> +++ dev/zs.c    15 Apr 2020 09:50:22 -0000
> @@ -1019,7 +1019,7 @@ zscninit(struct consdev *cp)
>         int escc, escc_ch, obio;
>         unsigned int zs_offset, zs_size;
>         int ch = 0;
> -       u_int32_t reg[5];
> +       u_int32_t reg[10];
>         char name[16];
>
>         if ((escc_ch = OF_instance_to_package(stdin)) == -1)
>
> i am probably masking a bug somewhere ... since the qemu firmware and the eeprom
> dump of my PowerBook G4 matches so i don"t know why zs.c crashes on qemu.
> with that hack you can compile with PROPOLICE (default GENERIC)

Thanks, I investigated this and it's enough to drive me insane.  It could be
that I'm lacking the intelligence.  It seems to me that OpenBSD does some
assumptions inside OF_getprop() that is called from zs.c line 1035.  
In particular with offsets to property names.  I compared the firmware from
QEMU with my G5 and there is a difference which I'm now compiling a patch for.  

Since I'm also doing a backup at the same time it may take longer than usual.  
Here is what I'm seeing in QEMU:

0 > cd /aliases  ok
0 > cd sccb  ok
0 > .properties
name                      "ch-b"
device_type               "serial"
compatible                "chrp,es3"
reg                       00013000   00000001
                          00013010   00000001
                          00013040   00000001
                          00008600   00000100
                          00008700   00000100
interrupts                -- 18 : 00 00 00 24 00 00 00 01 00 00 00 06 00 00 00 00 00 00 00 07 00 00 00 00
slot-names                0
interrupt-parent          fff66674
 ok

And what I'm seeing in my Apple G5 is different.  There is a "built-in"
property between the compatible and the reg property.  I'm trying to insert
this property in the QEMU with a patch like said above.  If you want to follow
this on your hardware the commands are a little different I photographed it
on my ipod but it would mean I turn on my access point to upload it so I'll
just list the commands.

dev /aliases
dev sccb
.properties

There you'll see the difference.  I'll report back if my patch works.

Best Regards,
-peter


> conf/GENERIC with zs.c hack and "-M mac99,via=pmu-adb" and "-nodefaults" on ports
> qemu (4.2)
>
> 0 >   ok
> 0 > boot Trying cd:,\\:tbxi...
> >> switching to new context:
> >> OpenBSD/macppc BOOT 1.8
> boot>
> cannot open /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/etc/random.seed: No such file or directory
> booting /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/6.7/macppc/bsd.rd: 9250252+483640 [394462+108+363984+376265]=0x100114
> string [/cdrom@0:/6.7/macppc/bsd.rd] not found
> Warning: boot device unrecognized: /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/6.7/macppc/bsd.rd
> [ using 1135396 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>         The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2020 OpenBSD. All rights reserved.  https://www.OpenBSD.org
>
> OpenBSD 6.7-beta (GENERIC) #4: Wed Apr 15 18:50:40 JST 2020
>     [hidden email]:/usr/src/sys/arch/macppc/compile/GENERIC
> real mem = 134217728 (128MB)
> avail mem = 104701952 (99MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root: model PowerMac3,1
> cpu0 at mainbus0: 7400 (Revision 0x209): 900 MHz: L2 cache not enabled
> mem0 at mainbus0
> mpcpcibr0 at mainbus0 pci: uni-north
> pci0 at mpcpcibr0 bus 0
> macobio0 at pci0 dev 12 function 0 "Apple Keylargo" rev 0x00
> macgpio0 at macobio0 offset 0x50
> macgpio1 at macgpio0 offset 0x9: irq 47
> pgs0 at macgpio0: irq 55
> adb0 at macobio0 offset 0x16000: irq 25, via-pmu, 2 targets
> apm0 at adb0: battery flags 0x91, 0% charged
> akbd0 at adb0 addr 2: extended keyboard
> wskbd0 at akbd0 mux 1
> ams0 at adb0 addr 3: Mouse Systems A3 mouse, 1-button, 100 dpi
> wsmouse0 at ams0 mux 0
> zs0 at macobio0 offset 0x13000: irq 37,36
> zstty0 at zs0 channel 0: console
> zstty1 at zs0 channel 1
> "escc-legacy" at macobio0 offset 0x12000 not configured
> wdc0 at macobio0 offset 0x20000 irq 13: DMA
> wd0 at wdc0 channel 0 drive 0: <QEMU HARDDISK>
> wd0: 16-sector PIO, LBA48, 8192MB, 16777216 sectors
> wd0(wdc0:0:0): using BIOS timings, DMA mode 2
> wdc1 at macobio0 offset 0x21000 irq 14: DMA
> atapiscsi0 at wdc1 channel 0 drive 0
> scsibus1 at atapiscsi0: 2 targets
> cd0 at scsibus1 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 2.5+> removable
> cd0(wdc1:0:0): using BIOS timings, DMA mode 2
> openpic0 at macobio0 offset 0x40000: version 0x0 feature 3f0002 LE
> memc0 at mainbus0: uni-n rev 0x7
> vscsi0 at root
> scsibus2 at vscsi0: 256 targets
> softraid0 at root
> scsibus3 at softraid0: 256 targets
> bootpath: /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:/6.7/macppc/bsd.rd
> root device: wd0
> swap device (default wd0b):
> root on wd0a swap on wd0b dump on wd0b
> WARNING: / was not properly unmounted
> Automatic boot in progress: starting file system checks.
> /dev/wd0a (29c62cbdfdfa90c9.a): 1734 files, 25569 used, 521478 free (174 frags, 65163 blocks, 0.0% fragmentation)
> /dev/wd0a (29c62cbdfdfa90c9.a): MARKING FILE SYSTEM CLEAN
> /dev/wd0e (29c62cbdfdfa90c9.e): 1 files, 1 used, 1030526 free (14 frags, 128814 blocks, 0.0% fragmentation)
> /dev/wd0e (29c62cbdfdfa90c9.e): MARKING FILE SYSTEM CLEAN
> /dev/wd0d (29c62cbdfdfa90c9.d): FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
> /dev/wd0d (29c62cbdfdfa90c9.d): SUMMARY INFORMATION BAD (SALVAGED)
> /dev/wd0d (29c62cbdfdfa90c9.d): BLK(S) MISSING IN BIT MAPS (SALVAGED)
> /dev/wd0d (29c62cbdfdfa90c9.d): 25379 files, 421954 used, 1124661 free (6013 frags, 139831 blocks, 0.4% fragmentation)
> /dev/wd0d (29c62cbdfdfa90c9.d): MARKING FILE SYSTEM CLEAN
> pf enabled
> starting network
> reordering libraries: done.
> openssl: generating isakmpd/iked RSA keys... done.
> ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
> starting early daemons: syslogd pflogd ntpd.
> starting RPC daemons:.
> savecore: no core dump
> checking quotas: done.
> clearing /tmp
> kern.securelevel: 0 -> 1
> creating runtime link editor directory cache.
> preserving editor files.
> running rc.sysmerge
> starting network daemons: smtpd sndiod.
> running rc.firsttime
> Path to firmware: http://firmware.openbsd.org/firmware/snapshots/
> No devices found which need firmware files to be downloaded.
> Path to firmware: http://firmware.openbsd.org/firmware/snapshots/
> No devices found which need firmware files to be downloaded.
> starting local daemons: cron.
> Wed Apr 15 19:56:53 JST 2020
>
> OpenBSD/macppc (emu.my.domain) (ttya)
>
> login: root
> Password:
> OpenBSD 6.7-beta (GENERIC) #4: Wed Apr 15 18:50:40 JST 2020
>
> Welcome to OpenBSD: The proactively secure Unix-like operating system.
>
> Please use the sendbug(1) utility to report bugs in the system.
> Before reporting a bug, please try to reproduce it with the latest
> version of the code.  With bug reports, please try to ensure that
> enough information to reproduce the problem is enclosed, and if a
> known fix for it exists, include that as well.
>
> You have mail.
> emu# ifconfig -a
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
>         index 2 priority 0 llprio 3
>         groups: lo
>         inet6 ::1 prefixlen 128
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
>         inet 127.0.0.1 netmask 0xff000000
> enc0: flags=0<>
>         index 1 priority 0 llprio 3
>         groups: enc
>         status: active
> pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33168
>         index 3 priority 0 llprio 3
>         groups: pflog
> emu#
>

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

Peter J. Philipp-3
I wrote:

> There you'll see the difference.  I'll report back if my patch works.
>
> Best Regards,
> -peter

After compiling this twice because my system was out of sync.  I realised
that openbios-ppc is not built in the QEMU port, and messing with the
Makefiles in the pobj didn't make this easier.  I'm sure my patch would have
worked but i can't compile it (yet).  It'll likely have to wait until the
weekend.

Best Regards,
-peter

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

rgcinjp
In reply to this post by Peter J. Philipp-3
On Thu, Apr 16, 2020 at 12:11:43PM +0200, Peter J. Philipp wrote:
> On Thu, Apr 16, 2020 at 05:06:25AM +0900, rgc wrote:
> > disabling scca probably will not work ... console uses this device
> >
> There you'll see the difference.  I'll report back if my patch works.
>

looking forward to your results


1 now something nasty reared it's head on 6.7-beta :-( RAMDISK kernel
(used by bsd.rd) will not boot on qemu-4.2.

openpic0 at macobio0 offset 0x40000: version 0x0 feature 3f0002 LE
panic: trap type 300 srr1 9032 at 2b9648 (0+0x2b9648) lr 2ddae0
halted

EXIT
0 >

sadly i've seen something similar when i was playing around with clang.
the error only occurs on qemu. and i never figured how to fix it.
(macppc 6.7-beta uses clang by default now)


2 networking (SLIRP)

-netdev user,id=network01 \
-device sungem,netdev=network01 \

works. i could do a sysupgrade of an old 6.6-current image and
download the 6.7-beta files but then the system can not boot from
the qemu disk image.

regards,
rgc

Reply | Threaded
Open this post in threaded view
|

Re: Qemu again

Peter J. Philipp-3
On Mon, Apr 20, 2020 at 10:15:33AM +0900, rgc wrote:
> On Thu, Apr 16, 2020 at 12:11:43PM +0200, Peter J. Philipp wrote:
> > On Thu, Apr 16, 2020 at 05:06:25AM +0900, rgc wrote:
> > > disabling scca probably will not work ... console uses this device
> > >
> > There you'll see the difference.  I'll report back if my patch works.
> >
>
> looking forward to your results

The mission is to get openbios compiled, but it uses a program called "toke"
that I couldn't locate in OpenBSD ports.  It also uses a script that gets
executed before gmaking.  I think if it were easy to build openbios on
OpenBSD it would have been done in the ports.  So my end result was that I
stalled on this.  I tried replacing the GNU Makefiles with BSD Makefiles
but that didn't work.  In a rage yesterday I deleted those and wasn't able
to recover it.  I think I'm giving up on this.

> 1 now something nasty reared it's head on 6.7-beta :-( RAMDISK kernel
> (used by bsd.rd) will not boot on qemu-4.2.
>
> openpic0 at macobio0 offset 0x40000: version 0x0 feature 3f0002 LE
> panic: trap type 300 srr1 9032 at 2b9648 (0+0x2b9648) lr 2ddae0
> halted
>
> EXIT
> 0 >
>
> sadly i've seen something similar when i was playing around with clang.
> the error only occurs on qemu. and i never figured how to fix it.
> (macppc 6.7-beta uses clang by default now)

Hmm.  That doesn't sound good.

> 2 networking (SLIRP)
>
> -netdev user,id=network01 \
> -device sungem,netdev=network01 \
>
> works. i could do a sysupgrade of an old 6.6-current image and
> download the 6.7-beta files but then the system can not boot from
> the qemu disk image.

It's amazing how creative people get to just run qemu.  I don't know if this
is all worth it.  I'm glad I have a G5 to back me up but not everyone is that
lucky.

I read that Amiga PPC's are booted by U-Boot not openbios, but doing the work
is more than a weekend on my laptop and I don't have much time beyond that at
the moment.  Plus OpenBSD/macppc expects openfirmware not FDT as far as I know.
Also getting both functionality into the kernel just for qemu can't really be
justified, can it?

> regards,
> rgc

Best Regards,
-peter