10

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?

sigjuice
  • 28,661
  • 12
  • 68
  • 93
SMUsamaShah
  • 7,677
  • 22
  • 88
  • 131
  • possible duplicate of [How to compile and run xv6 on windows?](http://stackoverflow.com/questions/7531696/how-to-compile-and-run-xv6-on-windows) – Foo Bah Sep 28 '11 at 17:52

6 Answers6

6

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

Subangkar KrS
  • 353
  • 5
  • 8
6

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.

Morass
  • 323
  • 1
  • 5
4

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.

TMN
  • 3,060
  • 21
  • 23
  • 1
    I only have 1 GB Ram. That probably won't help because I'll be running an emulator (qemu), within an emulator (VirtualBox) – SMUsamaShah Sep 24 '11 at 05:58
  • 1
    VirtualBox is not an emulator, it's a virtual machine. Big difference. Given how cheap RAM is these days, it might be worth upgrading the RAM in your laptop. – Timo Geusch Sep 24 '11 at 23:45
1

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.

Timo Geusch
  • 24,095
  • 5
  • 52
  • 70
  • I feel difficult to use Cygwin, after I install it, can I do all as I told in my question (make and run on qemu)? – SMUsamaShah Sep 24 '11 at 06:00
  • Well, there is a version of qemu for windows, and you need gcc to build xv6. GCC is provided by Cygwin. Is it going to work? I don't know, but it's an option for you to try. – Timo Geusch Sep 24 '11 at 23:45
0

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.

BSMP
  • 4,596
  • 8
  • 33
  • 44
0

I have succeeded to build and run xv6 with Command Prompt (cmd.exe) on Windows 10. That's what I've done. Not on Linux, nor Windows10 + WSL environment, nor Windwos10 + Cygwin or MSYS environment, I built it on Windows10 using Command Prompt. You need the following for Windows: MinGW, BusyBox, and QEMU. The xv6 source code modified by me can be download the following URL.

https://github.com/mirokuuno/xv6-windows

The details are documented in "How to build and run Unix-xv6 with Command Prompt on Windows" .