最近实验要装xv6运行环境,踩坑无数,千万要小心配环境真的最好找最近的博客,千万别找1年以前的,不然会像我一样被坑死。
闲话少说。
实验环境
ubuntu 16.04
VmWare workstation
这是我认为靠谱的两个参考网站
https://blog.csdn.net/yinglang19941010/article/details/49310111
https://pdos.csail.mit.edu/6.828/2018/homework/xv6-boot.html
首先安装xv6源代码
git clone git://github.com/mit-pdos/xv6-public.git cd xv6-public make
最后这样就说明xv6源码编译成功。
接下来,安装qemu,安装这个有两种方式,一种是我下面的这种直接做,简单明了。还有一种是通过源码安装,不建议这种方式,复杂还容易出错。就在xv6-public这个文件下
sudo apt-get install qemu
验证qemu安装成功在xv6-public文件夹下:qemu-system-i386
如果弹出qemu的窗口说明成功。
现在就可以在qemu上运行调试xv6:
$cd xv6-public
$ make qemu-gdb
...
//这时重新在xv6-public再次 开一个终端
$ gdb
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
+ target remote localhost:26000
The target architecture is assumed to be i8086
[f000:fff0] 0xffff0: ljmp $0xf000,$0xe05b
0x0000fff0 in ?? ()
+ symbol-file kernel
.......