记录bochs下如何加载和调试jos内核的过程:
I.Bochs下编译和运行Jos内核
http://pdos.lcs.mit.edu/6.828/2007/labs/lab1/lab1.tar.gz 下载Lab1所需内核
tar 解压
1. 设置编译环境,安装GCC
1.1 Set>$ make
$>$ make
$>$ make;make check
$>$ cd ../gcc-4.5.0/
$ ./configure --prefix=/usr/local/gcc-4.5.0 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1
$>a known problem that puts the files in a non standard location on Ubuntu12.04.
Solution:
(1) Add>export LIBRARY_PATH=/usr/lib/$(gcc
-print-multiarch)export C_INCLUDE_PATH=/usr/include/$(gcc
-print-multiarch)export CPLUS_INCLUDE_PATH=/usr/include/$(gcc
-print-multiarch)
#>4.5.0
Copyright (C) 2010 Free Software Foundation, Inc.
This>00000000000i[ ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[ ] BXSHARE>Event type: PANIC
Device: [ ]
Message:> Bochs x86 Emulator 2.4.6
Build>00000000000i[ ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[ ] BXSHARE>Event type: PANIC
Device: [MEM0 ]
Message: ROM: System BIOS>
to
romimage:>2.1.3 Issue 3
========================================================================
Bochs x86 Emulator 2.4.6
Build>00000000000i[ ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[ ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000i[ ] reading configuration from .bochsrc
bochs-bin: symbol lookup error: /usr/lib/bochs/plugins/libbx_x.so: undefined symbol: XpmCreatePixmapFromData
Solution:
Add this line "display_library: sdl" in .bochsrc