♦ XV6 on Linux OS


Download tools and source.

  1. sudo apt-get install -y git wget qemu build-essential gdb
  2. git clone https://github.com/mit-pdos/xv6-public.git

Build and run xv6.

  1. cd xv6-public && make qemu (or qemu-nox)

Build and run xv6 with GDB.

  1. cd xv6-public && make qemu-gdb (or qemu-nox-gdb)
  2. Open new terminal and switch to new terminal.
  3. 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


Install windows subsystem for Linux (WSL) and xv6. 

  1. Run PowerShell as administrator (Link).
  2. $ wsl --install -b ubuntu
  3. $ sudo apt-get update -y
  4. $ sudo apt-get install git make gcc wget qemu qemu-kvm gdb -y
  5. $ git clone https://github.com/mit-pdos/xv6-public.git

Build and run xv6.

  1. $ cd xv6-public && make qemu-nox

Build and 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 new ubuntu instance (Run the Ubuntu). You will get new terminal. Launch gdb with kernel binary for xv6.
  4. $ cd xv6-public && gdb ./kernel (at new ubuntu instance)