NetBSD-Users archive

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

Re: issues running i386 6.1 under VirtualBox 4.2.12

Malcolm Herbert <> wrote:

> trap type 6 code 0 eip c0100ea6 cs 8 eflags 82 cr2 fbc0ad8b ilevel 1
> kernel: supervisor trap page fault, code=0
> Stopped in pid 0.1 (system) at  netbsd:Xspllower+0x16:  addb   
> 0(%eax),%al
> db{0}>
> I've set the VM guest to the following parameters: 128MB memory, 1 vcpu,
> emulated PIIX3 chipset, IO APIC off, 10GB virtual disk, 1 emulated intel
> NIC.  Hardware virtualisation features (VT-x/AMD-V) are off.

If your CPU supports hardware virtualization you should use it -
NetBSD will work.

Otherwise, you can tell vbox to not use "raw mode"[1] for the kernel with
--recompile-supervisor command line options (it's not exposed in the
GUI).  That will be slow, but will work :)

I also have a few small hacks to the netbsd kernel that work around
those problems and allow netbsd to run under vbox without hardware
virtualization (e.g. on older Core2 cpus), but they are way too ugly
to commit.  You can install the system from original CD with
--recompile-supervisor and then compile and install a custom kernel
that would work in "raw mode" and work with acceptable speed.

I've uploaded what seems like the cleaned up version (i386 only) to

There are three hacks there:

- i386/i386/spl.S - this is what causes your panic, vbox doesn't
  detect that the instruction after "cli" is a target of indirect
  jump.  The 4 byte nop inserted after that "cli" provides space for
  vbox to stomp over when patching the code.

- x86/x86/patch.c - prevents the kernel from overwriting generic mutex
  ops with more optimial variants.

- x86/include/cpu.h - moves TSS to a page of its own to improve
  performance (a lot).  vbox needs to shadow tss, and since tss is on
  the same page with the rest of cpu_info, every kernel access to
  cpu_info (and there are a lot of them) is trapped.  Since this was
  the part I was less sure about, it's controlled with a kernel option:

    options VBOX_TSS_KLUDGE

[1] See for
details about "raw mode" software virtualization


Home | Main Index | Thread Index | Old Index