I'm just getting started with the Pintos project, working from my home computer that is running Ubuntu.
I'm able to compile the project from the src/threads/
directory, and the initial test pintos run alarm-multiple
seems to work okay (notice that it runs qemu by default):
$:~/workspace/pintos/src/threads/build$ pintos run alarm-multiple
qemu -hda /tmp/ODhMQLwBNh.dsk -m 4 -net none -serial stdio
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
PiLo hda1
Loading..........
Kernel command line: run alarm-multiple
Pintos booting with 4,096 kB RAM...
383 pages available in kernel pool.
383 pages available in user pool.
Calibrating timer... 111,206,400 loops/s.
Boot complete.
Executing 'alarm-multiple':
(alarm-multiple) begin
(alarm-multiple) Creating 5 threads to sleep 7 times each.
...
(alarm-multiple) thread 4: duration=50, iteration=7, product=350
(alarm-multiple) end
Execution of 'alarm-multiple' complete.
However, when I run this test with the bochs emulator, I get a panic as soon as I hit printf()
, which seems to be first called from read_command_line()
.
pintos:
$:~/workspace/pintos/src/threads/build$ pintos --gdb --bochs -- run alarm-multiple
squish-pty bochs -q
========================================================================
Bochs x86 Emulator 2.2.6
Build from CVS snapshot on January 29, 2006
========================================================================
00000000000i[ ] reading configuration from bochsrc.txt
00000000000e[ ] user_shortcut: old-style syntax detected
00000000000i[ ] Enabled gdbstub
00000000000i[ ] installing x module as the Bochs GUI
00000000000i[ ] using log file bochsout.txt
Waiting for gdb connection on localhost:1234
PiLo hda1
Loading..........
Kernel command lineTriple fault: stopping for gdb
pintos-gdb:
$:~/workspace/pintos/src/threads/build$ pintos-gdb kernel.o
*** /usr/class/cs140/pintos/pintos/src/misc/gdb-macros does not exist ***
*** Pintos GDB macros will not be available ***
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/ozhu/workspace/pintos/src/threads/build/kernel.o...done.
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
warning: unrecognized item "ENN" in "qSupported" response
0x0000fff0 in ?? ()
qTStatus: Target returns error code 'NN'.
(gdb) break schedule
Breakpoint 1 at 0xc0020e7b: file ../../threads/thread.c, line 557.
qTStatus: Target returns error code 'NN'.
(gdb) c
Continuing.
qTStatus: Target returns error code 'NN'.
Program received signal SIGTRAP, Trace/breakpoint trap.
0xc0026a16 in __vprintf (format=<optimized out>, args=0xc000efa8 "\265\033", output=0xc002a094 <vprintf_helper>, aux=0xc000ef6c) at ../../lib/stdio.c:296
296 s = "(null)";
(gdb) bt
#0 0xc0026a16 in __vprintf (format=<optimized out>, args=0xc000efa8 "\265\033", output=0xc002a094 <vprintf_helper>, aux=0xc000ef6c) at ../../lib/stdio.c:296
#1 0xc002a160 in vprintf (format=0xc002e99b " %s", args=0xc000efa4 ">}") at ../../lib/kernel/console.c:131
#2 0xc0026377 in printf (format=0xc002e99b " %s") at ../../lib/stdio.c:85
#3 0xc00202a7 in read_command_line () at ../../threads/init.c:218
#4 main () at ../../threads/init.c:85
(gdb)
As you can see, as soon as I run the c
(continue) command in gdb, pintos will crash in the call to read_command_line()
when it calls printf()
.
I don't believe I've made any significant changes to the baseline Pintos code. What could possibly be making bochs panic at this function call? Running this same test with qemu doesn't seem to have this problem.