9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Plan9/Bochs/kernel panic
@ 2003-11-11  9:34 Paul Swartz
  2003-11-11 14:14 ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Swartz @ 2003-11-11  9:34 UTC (permalink / raw)
  To: 9fans

I tried installing Plan9 on Boches (CVS on Debian unstable, kernel
2.6.0-test9), but get a strange error when I boot from the floppy. 
The kernel loads and detects the emulated CPU, then dies immediatly
with a "panic: math emu".  Also interesting is before the "entry:
80100020" line, there's this strange line that appears to be some kind
of computation.  "1267078 => 745652+1116416+83748=1945816.".

Any ideas?

TIA, -p
--
      Paul Swartz
(o_   z3p at twistedmatrix dot com
//\   http://www.twistedmatrix.com/users/z3p.twistd/
V_/_  AIM: Z3Penguin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Plan9/Bochs/kernel panic
  2003-11-11  9:34 [9fans] Plan9/Bochs/kernel panic Paul Swartz
@ 2003-11-11 14:14 ` Russ Cox
  2003-11-11 19:00   ` Russ Cox
       [not found]   ` <-280943911904599510@unknownmsgid>
  0 siblings, 2 replies; 4+ messages in thread
From: Russ Cox @ 2003-11-11 14:14 UTC (permalink / raw)
  To: 9fans

> I tried installing Plan9 on Boches (CVS on Debian unstable, kernel
> 2.6.0-test9), but get a strange error when I boot from the floppy.
> The kernel loads and detects the emulated CPU, then dies immediatly
> with a "panic: math emu".  Also interesting is before the "entry:
> 80100020" line, there's this strange line that appears to be some kind
> of computation.  "1267078 => 745652+1116416+83748=1945816.".
>
> Any ideas?

The computation is the boot loader telling you its progress
in loading the kernel.  Disk size => text+data+bss = Mem size.

Beyond that I'm not much help.  Math emu means that the kernel
got a floating point exception, which should not happen.

Russ


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Plan9/Bochs/kernel panic
  2003-11-11 14:14 ` Russ Cox
@ 2003-11-11 19:00   ` Russ Cox
       [not found]   ` <-280943911904599510@unknownmsgid>
  1 sibling, 0 replies; 4+ messages in thread
From: Russ Cox @ 2003-11-11 19:00 UTC (permalink / raw)
  To: 9fans

> Beyond that I'm not much help.  Math emu means that the kernel
> got a floating point exception, which should not happen.

I tracked this down.  It seems to be a bug in Bochs.
Real processors all let us turn off the FPU twice,
but if the FPU is already off, then Bochs causes an
exception when we "FWAIT" before turning it off again.
The Intel manual (I looked at the current online one
as well as an old 486 one) is very clear -- FWAIT causes
an exception if CR0.EM and CR0.TS are *both* set, whereas
Bochs causes an exception if *either* is set.
(To be fair, all the other floating point instructions
are supposed to cause the exception if *either* is set,
so it's not surprising that Bochs got this one exception
(no pun intended) wrong.)

Russ


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Plan9/Bochs/kernel panic
       [not found]   ` <-280943911904599510@unknownmsgid>
@ 2005-04-19  4:19     ` Russ Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Russ Cox @ 2005-04-19  4:19 UTC (permalink / raw)
  To: 9fans

On 11/11/03, Russ Cox <rsc@swtch.com> wrote:
> I tracked this down.  It seems to be a bug in Bochs.
> Real processors all let us turn off the FPU twice,
> but if the FPU is already off, then Bochs causes an
> exception when we "FWAIT" before turning it off again.

I tracked this down again (I had quite a sense of deja vu
once I found the problem, but google failed me and I hadn't
thought to look in my gmail).  This time I fixed Plan 9 to
work around it.  There is a new /sys/src/9/pc/l.s on sources
that avoids the FWAIT when the FPU is already off.
With that change, Plan 9 boots in Bochs, though I
suggest qemu with the kqemu module unless you
are doing OS hacking and need Bochs's better debugging
features.

Russ


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-19  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-11  9:34 [9fans] Plan9/Bochs/kernel panic Paul Swartz
2003-11-11 14:14 ` Russ Cox
2003-11-11 19:00   ` Russ Cox
     [not found]   ` <-280943911904599510@unknownmsgid>
2005-04-19  4:19     ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).