Bochs & SMP

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pini

Bochs & SMP

Post by pini »

I compiled bochs to support multiprocessors.
I also enabled debugging, so that I can follow my code.

I got a working kernel on a uniprocessor-compiled bochs, but here when I simply run it (with the SMP bochs-BIOS), I got this :

Code: Select all

Next at t=0
(0) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
(1) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
(2) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
(3) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
(4) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
(5) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
(6) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
(7) [0x000ffff0] f000:fff0 (unk. ctxt): jmp f000:e05b             ; ea5be000f0
<bochs:1> c
[00000500000|e|000004f2[VGA  ] character height = 1, skipping text update
[00001000000|e|00000a1f[VGA  ] character height = 1, skipping text update
[00001500000|e|00000513[VGA  ] character height = 1, skipping text update
[00002000000|e|0000050f[VGA  ] character height = 1, skipping text update
[00003000000|e|000007fd[VGA  ] character height = 1, skipping text update
[00003500000|e|000007fd[VGA  ] character height = 1, skipping text update
[00004000000|e|000007fd[VGA  ] character height = 1, skipping text update
[00004500000|e|000007fd[VGA  ] character height = 1, skipping text update
And I got these "skipping text" until I break bochs (seems to be a infinite loop). Only the first CPU (Boot Processor) is working, the other are remaining in halted mode, waiting for IPI.

Does any have a multiprocessor-running bochs ? and if so, what i can do to make it ?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Bochs & SMP

Post by Candy »

pini wrote: And I got these "skipping text" until I break bochs (seems to be a infinite loop). Only the first CPU (Boot Processor) is working, the other are remaining in halted mode, waiting for IPI.

Does any have a multiprocessor-running bochs ? and if so, what i can do to make it ?
I had it working in 2p mode, where the second was never awaken. Do you have the 8p bios loaded, or still the 1p bios? If the 8p, try using a different one.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Bochs & SMP

Post by Brendan »

Hi,
pini wrote: Does any have a multiprocessor-running bochs ? and if so, what i can do to make it ?
I compiled heaps of different versions of Bochs 2.1.1 (single & SMP, with & without debugger, and 2, 4 & 8 CPUs).

Here's the configure script I used for 8 CPUs with debugging:

Code: Select all

#!/bin/sh

CC="gcc"
CXX="g++"
CFLAGS="-O6 -march=pentium"
CXXFLAGS="$CFLAGS"
export CC
export CXX
export CFLAGS
export CXXFLAGS

./configure --enable-cpu-level=6 \
   --enable-processors=8 \
   --enable-global-pages \
   --enable-disasm \
   --enable-sep \
   --enable-vbe \
   --enable-readline \
   --disable-reset-on-triple-fault \
   --enable-debugger
I compile (Bochs 2.1.1) using both Cygwin and GCC on Linux. Generally I'd type "./theScriptName", then "make bochs". I also keep the scripts for each compiled version so it's easy to add or remove support for something.

I remember having similar problems. One of the options I normally use messes up SMP (I think it was "--enable-all-optimizations").


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
pini

Re:Bochs & SMP

Post by pini »

I got it running.
I removed the --enable-all-optimizations from my configure script, and now it works good.

Thx you
Post Reply