XV6 on Linux OS

Setting

  1. sudo apt-get install git wget qemu
  2. git clone https://github.com/mit-pdos/xv6-public.git
  3. sudo apt-get install gdb ( if you don’t have it.. )
  4. cd xv6-public && make qemu (or qemu-nox)
  5. make qemu-gdb
  6. Open new terminal
  7. cd xv6-public && gdb ./kernel

XV6 on Mac OS

Package download

Setting

  1. Check your mac version (e.g high sierra)
  2. Download package manager
  3. Setting environment variable your mac to use package manager ( export PATH=/opt/local/bin:/opt/local/sbin:$PATH )<- just copy
  4. sudo port install git wget ( if you don’t have it.. )
  5. git clone https://github.com/mit-pdos/xv6-public.git
  6. sudo port install qemu
  7. sudo port install i386-elf-gcc
  8. cd xv6-public && vi Makefile
  9. Search line number 32 or TOOLPREFIX = i386-jos-elf
  10. Modify TOOLPREFIX = i386-jos-elf to TOOLPREFIX = i386-elf-
  11. make qemu (or qemu-nox)
  12. cd ..
  13. wget https://ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.gz
  14. tar -xvf gdb-6.8a.tar.gz
  15. cd gdb-6.8
  16. ./configure –prefix=/usr/local –target=i386-elf –disable-werror
  17. sudo make all -j4
  18. sudo make install
  19. i386-elf-gdb –version ( Check your gdb version 6.8 , target = i386-elf )
  20. cd ../xv6-public
  21. make qemu-gdb
  22. Open new terminal
  23. cd xv6-public && i386-elf-gdb ./kernel

XV6 on Windows

Setting

  1. Run the PowerShell as administrator (Link).
  2. $ wsl –install
  3. Reboot the system. 
  4. Download Ubuntu 20.04.4 LTS.
  5. Run Unbuntu on Windows. It may take a few minutes.
  6. Open a new terminal (Run the Ubuntu 20.04.4 LTS).

Build and run xv6

  1. $ sudo apt-get update -y
  2. $ sudo apt-get install git make gcc wget qemu qemu-kvm gdb -y
  3. $ git clone https://github.com/mit-pdos/xv6-public.git
  4. $ cd xv6-public && make qemu-nox

Run xv6 with GDB.

  1. Add “set auto-load safe-path /” line to configuration file “~/.gdbinit”.
  2. $ cd xv6-public && make qemu-nox-gdb
  3. Open a new terminal.
  4. $ cd xv6-public && gdb ./kernel (at another terminal)