1. 程式人生 > >在ubuntu配置xv6環境

在ubuntu配置xv6環境

最近實驗要裝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
.......