How to compile and run xv6 on windows?

耗尽温柔 提交于 2019-11-29 09:56:32

Well, there are reasonable instructions on how to construct environment for building and using XV6 under Windows in the site http://www.cs.mta.ac.il/~carmi/Teaching/OS.xv6/index.html. The emulator they are using for actually running it is Bochs.

You can run Linux inside VirtualBox, that would give you the same environment on your machine that you use on the school's server. Then you could continue to run xv6 within qemu. You'll need a reasonably capable machine for this, though -- a dual-core CPU with 4G of memory is the minimum I'd attempt this with.

If you wanna use WSL (Windows sub-system for Linux) on Windows 10, this might help.

Follow Instructions regarding Windows here or

Step 1: enable and setup WSL following this.

Step 2: run WSL bash and install required stuffs on WSL.

  • open CMD
  • type cd <xv6-source-path>
  • type bash and this will switch CMD into WSL bash
  • then sudo apt-get update && sudo apt-get install git nasm build-essential qemu gdb

Step 3: disable video device for qemu in Makefile.

  • open Makefile in xv6 source directory with any text editor.

  • find the line starting with

QEMUOPTS =

  • append -display none to this line and save the file.

Step 4: type linux like commands in that terminal i.e

  • first make
  • then make qemu

Now if everything is okay, you should be in the xv6 terminal

I'd go for some sort VM solution (as suggested by TMN) as well, but it might be worth a try building it on Cygwin if you don't have the hardware to run a sufficiently specced VM.

Aliza Miller

I had tried the above but make qemu-nox gave me this error:

Cannot set up guest memory 'pc.ram': Cannot allocate memory

I opened up the Virtual Box GUI, right clicked on the VM, when it was turned off (on halt), I right-clicked on the VM, then clicked the "system" tab, and then changed the motherboard memory to over 2000MB.

After that I ran:

make
make qemu-nox

This worked for me even though nothing else worked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!