How to compile and run xv6 on windows?

In our course we are taught xv6 . We are currently using our school's Linux server login using putty in windows.

Here we make changes to the xv6 source (using vim), then compile and run it in qemu simply

make clean make make qemu-nox 

It is not always possible to connect to your servers, so I want to be able to compile and run xv6 with windows (obviously in some kind of emulator).

What emulator can I use to work on a similar view? (edit code, compile and run) and how?

+7
source share
5 answers

Well, there are reasonable instructions on how to create an environment for building and using XV6 under Windows at http://www.cs.mta.ac.il/~carmi/Teaching/OS.xv6/index.html . The emulator they use to actually run is Bochs.

+6
source

You can run Linux inside VirtualBox , which will provide you with the same environment on your computer that you use on the school server. Then you can continue to run xv6 in qemu. To do this, you will need a fairly suitable machine, but a dual-core processor with 4G memory is the minimum I would try to do this.

+4
source

Below are instructions for setting up the xv6 build environment on Windows 7 (32-bit), without using Cygwin or virtual machines.

1. Install MSYS

MSYS provides several build tools ( bash , make , dd , perl , git , rm )

Download msys + 7za + wget + svn + git + mercurial + cvs-rev13.7z

Unzip anywhere, for example. ~/tools/msys/ .

2. Install the integrated tool chain

The toolchain package provides a version of gcc and binutils for creating 32-bit Windows programs such as xv6/mkfs .

Download i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z

Unzip anywhere, for example. ~/tools/mingw32/ . Add ~/tools/mingw32/bin to PATH .

3. Install the 32-bit ELF Toolchain

Unzip anywhere, for example. ~/tools/ia32-2012.09/

4. Install Qemu

I'm not sure if this Qemu binary includes the enhanced debugging support mentioned here http://pdos.csail.mit.edu/6.828/2012/tools.html .

5. Starting bash

Double click on ~/tools/msys/msys.bat

6. Configure git and clone xv6 repository

 git config --global core.autocrlf false git config --global core.eol lf git config --global core.filemode false git clone git://pdos.csail.mit.edu/xv6/xv6.git 

7. Apply this patch to the xv6 tree for

  • indicate the tools installed above.
  • fix mkfs.c , so it builds and works correctly

(fixed patch with ff2783442ea2801a4bf6c76f198f36a6e985e7dd)

8. make qemu

This will compile xv6 and run Qemu

+2
source

I would go for some kind of VM solution (as suggested by TMN), but it might be worth trying to create it on Cygwin if you don’t have the hardware to run a sufficiently designed virtual machine.

+1
source

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

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

I opened the Virtual Box GUI by right-clicking on the virtual machine when it was turned off (stopped), I right-clicking on the virtual machine, then clicking the β€œsystem” tab, and then changing the memory of the motherboard to more than 2000 MB.

After that I ran:

 make make qemu-nox 

It worked for me, although nothing else worked.

0
source

All Articles