XV6 on Linux OS
Setting
- sudo apt-get install git wget qemu
- git clone https://github.com/mit-pdos/xv6-public.git
- sudo apt-get install gdb ( if you don’t have it.. )
- cd xv6-public && make qemu (or qemu-nox)
- make qemu-gdb
- Open 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
Setting
- Run the PowerShell as administrator (Link).
- $ wsl –install
- Reboot the system.
- Download Ubuntu 20.04.4 LTS.
- Run Unbuntu on Windows. It may take a few minutes.
- Open a new terminal (Run the Ubuntu 20.04.4 LTS).
Build and run xv6
- $ 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
- $ cd xv6-public && make qemu-nox
Run xv6 with GDB.
- Add “set auto-load safe-path /” line to configuration file “~/.gdbinit”.
- $ cd xv6-public && make qemu-nox-gdb
- Open a new terminal.
- $ cd xv6-public && gdb ./kernel (at another terminal)