How to compile and run xv6 on windows?

筅森魡賤 提交于 2019-11-30 09:00:54

问题


We are being taught xv6 in our course. Currently we use to login to linux server of our school using putty in windows.

There we make changes in source of xv6 (using vim), then compile and run it in qemu simply

make clean
make
make qemu-nox

It is not always possible to connect to their servers therefore I want to be able to compile and run xv6 withing windows (in some emulator obviously).

What emulator I can use for above kind work? (edit code, compile and run) and how?


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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.




回答5:


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.



来源:https://stackoverflow.com/questions/7534388/how-to-compile-and-run-xv6-on-windows

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