Skip to content

Instantly share code, notes, and snippets.

@eecsmap
Last active May 6, 2021 19:48
Show Gist options
  • Save eecsmap/00b881bbf1c652dbbb5651b4682ea0b4 to your computer and use it in GitHub Desktop.
Save eecsmap/00b881bbf1c652dbbb5651b4682ea0b4 to your computer and use it in GitHub Desktop.
Setup xv6 on Ubuntu 21.4

Setup xv6 on Ubuntu 21.4

  1. setup a ubuntu 21.4 desktop box in VMware/VirtualBox with minimum setup chosen.
  2. follow instructions here https://pdos.csail.mit.edu/6.828/2020/tools.html You do not need to apply the hack of qemu on ubuntu 21.4
engineer@vm-ubuntu:~$ sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu
engineer@vm-ubuntu:~$ riscv64-linux-gnu-gcc --version

Install xv6

follow up https://pdos.csail.mit.edu/6.828/2020/xv6.html

git clone git://github.com/mit-pdos/xv6-riscv.git
cd xv6-riscv
make qemu

ctrl+a x to quit

Debug xv6

echo set auto-load safe-path / > ~/.gdbinit
make qemu-gdb

in another console:

gdb-multiarch
file kernel/kernel

or

gdb-multiarch
file user/_echo
b main
@eecsmap
Copy link
Author

eecsmap commented May 6, 2021

Also verified on WSL2 (Windows 10 + Ubuntu). It works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment