♦ XV6 on Linux OS
Download tools and source.
-
sudo apt-get install -y git wget qemu build-essential gdb
-
git clone https://github.com/mit-pdos/xv6-public.git
Build and run xv6.
-
cd xv6-public && make qemu (or qemu-nox)
Build and run xv6 with GDB.
-
cd xv6-public && make qemu-gdb (or qemu-nox-gdb)
-
Open new terminal and switch to new terminal.
-
cd xv6-public && gdb ./kernel
♦ XV6 on Mac OS
Package download
-
package manager : https://www.macports.org
-
gdb : https://ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.gz
Setting
-
Check your mac version (e.g high sierra)
-
Download package manager
-
Setting environment variable your mac to use package manager ( export PATH=/opt/local/bin:/opt/local/sbin:$PATH )<- just copy
-
sudo port install git wget ( if you don't have it.. )
-
git clone https://github.com/mit-pdos/xv6-public.git
-
sudo port install qemu
-
sudo port install i386-elf-gcc
-
cd xv6-public && vi Makefile
-
Search line number 32 or TOOLPREFIX = i386-jos-elf
-
Modify TOOLPREFIX = i386-jos-elf to TOOLPREFIX = i386-elf-
-
make qemu (or qemu-nox)
-
cd ..
-
wget https://ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.gz
-
tar -xvf gdb-6.8a.tar.gz
-
cd gdb-6.8
-
./configure --prefix=/usr/local --target=i386-elf --disable-werror
-
sudo make all -j4
-
sudo make install
-
i386-elf-gdb --version ( Check your gdb version 6.8 , target = i386-elf )
-
cd ../xv6-public
-
make qemu-gdb
-
Open new terminal
-
cd xv6-public && i386-elf-gdb ./kernel
♦ XV6 on Windows
Install windows subsystem for Linux (WSL) and xv6.
-
Run PowerShell as administrator (Link).
-
$ wsl --install -b ubuntu
-
$ sudo apt-get update -y
-
$ sudo apt-get install git make gcc wget qemu qemu-kvm gdb -y
-
$ git clone https://github.com/mit-pdos/xv6-public.git
Build and run xv6.
-
$ cd xv6-public && make qemu-nox
Build and run xv6 with GDB.
-
Add "set auto-load safe-path /" line to configuration file "~/.gdbinit".
-
$ cd xv6-public && make qemu-nox-gdb
-
Open new ubuntu instance (Run the Ubuntu). You will get new terminal. Launch gdb with kernel binary for xv6.
-
$ cd xv6-public && gdb ./kernel (at new ubuntu instance)