Skip to contentSkip to conversation

sparc-softmmu with sun prom image?

Qemu-devel Brian Wheeler 3 participants 3 messages May 6, 2009 – May 7, 2009

lore
Share & tools
lore
#0 lore raw

I grabbed a prom image from my SS10 and it mostly works, but the idprom stuff seems to be broken. Has anyone tried this? When I run 'printenv' at the ok prompt it gives me a data access error and when I turned on the debuging of unmapped memory, it would try to read at an offset just above the allocated ram.

Brian

#1 lore raw
Quoted 10 lines · Brian Wheeler

I grabbed a prom image from my SS10 and it mostly works, but the idprom stuff seems to be broken. Has anyone tried this? When I run 'printenv' at the ok prompt it gives me a data access error and when I turned on the debuging of unmapped memory, it would try to read at an offset just above the allocated ram.

Brian

Here is a patch I did about a month ago when more OpenBios parameters were added to nvram. The format used by OpenBios is different from OpenBoot so the added parameters made running an OpenBoot PROM image worse than before.

This patch lets you load nvram from a file rather than letting qemu fill it with OpenBios parameters. Use a file with all zeros except for the idprom area. I have a small program to generate an nvram image with idprom for an SS-10. Start OpenBoot and run set-defaults just like you would with a new NVRAM chip. You will then be able to run printenv without a crash. You could also get the nvram image from a real machine.

I never submitted this patch because there in no simple way to save the nvram contents at program exit. There are no destructor functions for either QEMUMachine or a QEMU hardware device. Is anyone else interested in adding destructor functions to devices or machines? Is this even feasible?

I also have a small patch for eccmemctl and a large patch for better SuperSPARC CPU support that I'm sitting on. They help a little with getting an SS-10 OpenBoot PROM working better but there is still a long way to go. The biggest piece missing from QEMU is probably sbus emulation. This will be needed before OpenBoot could be used to load an OS.

vl.c +4 -0
Index: vl.c
===================================================================
@@ -189,6 +189,7 @@
 
 const char *bios_dir = CONFIG_QEMU_SHAREDIR;
 const char *bios_name = NULL;
+const char *nvram_name = NULL;
 static void *ioport_opaque[MAX_IOPORTS];
 static IOPortReadFunc *ioport_read_table[3][MAX_IOPORTS];
 static IOPortWriteFunc *ioport_write_table[3][MAX_IOPORTS];
@@ -4658,6 +4659,9 @@
             case QEMU_OPTION_bios:
                 bios_name = optarg;
                 break;
+            case QEMU_OPTION_nvram:
+                nvram_name = optarg;
+                break;
             case QEMU_OPTION_S:
                 autostart = 0;
                 break;
qemu-options.hx +7 -0
Index: qemu-options.hx
===================================================================
@@ -1265,6 +1265,13 @@
 Set the filename for the BIOS.
 ETEXI
 
+DEF("nvram", HAS_ARG, QEMU_OPTION_nvram, \
+    "-nvram file      set the filename for the NVRAM\n")
+STEXI
+@item -nvram @var{file}
+Set the filename for the NVRAM.
+ETEXI
+
 #ifdef USE_KQEMU
 DEF("kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu, \
     "-kernel-kqemu   enable KQEMU full virtualization (default is user mode only)\n")
sysemu.h +1 -0
Index: sysemu.h
===================================================================
@@ -11,6 +11,7 @@
 /* vl.c */
 extern const char *bios_name;
 extern const char *bios_dir;
+extern const char *nvram_name;
 
 extern int vm_running;
 extern const char *qemu_name;
sun4m.c +37 -20

69 lines not on this page · raw message

#2 lore raw
Quoted 26 lines · Robert Reif
Quoted 11 lines · Brian Wheeler

I grabbed a prom image from my SS10 and it mostly works, but the idprom stuff seems to be broken. Has anyone tried this? When I run 'printenv' at the ok prompt it gives me a data access error and when I turned on the debuging of unmapped memory, it would try to read at an offset just above the allocated ram.

Brian

Here is a patch I did about a month ago when more OpenBios parameters were added to nvram. The format used by OpenBios is different from OpenBoot so the added parameters made running an OpenBoot PROM image worse than before.

This patch lets you load nvram from a file rather than letting qemu fill it with OpenBios parameters. Use a file with all zeros except for the idprom area. I have a small program to generate an nvram image with idprom for an SS-10. Start OpenBoot and run set-defaults just like you would with a new NVRAM chip. You will then be able to run printenv without a crash. You could also get the nvram image from a real machine.

Quoted 6 lines

I never submitted this patch because there in no simple way to save the nvram contents at program exit. There are no destructor functions for either QEMUMachine or a QEMU hardware device. Is anyone else interested in adding destructor functions to devices or machines? Is this even feasible?

I think this is similar issue but somewhat separate to VM snapshotting. The user can load an initial VM snapshot, snapshot load and save can be commanded from monitor and by default, at least the disk image is updated, unless in snapshot mode.

IMHO NVRAM (and PC CMOS, pflash etc.) should act the same way. Maybe qcow etc could be reused?

Quoted 6 lines

I also have a small patch for eccmemctl and a large patch for better SuperSPARC CPU support that I'm sitting on. They help a little with getting an SS-10 OpenBoot PROM working better but there is still a long way to go. The biggest piece missing from QEMU is probably sbus emulation. This will be needed before OpenBoot could be used to load an OS.

What's missing from Sbus emulation? I know probing and slot enable/disable does not work, are there other known issues?