如何在windows上编译并运行xv6?
我们在课程中学习xv6。目前我们在windows下使用putty登录我们学校的linux服务器。
在那里,我们对 xv6 的源代码进行了更改(使用 vim),然后在 qemu 中编译并运行它。
make clean
make
make qemu-nox
并不总是可以连接到他们的服务器,因此我希望能够编译并运行 xv6 windows(显然在某些模拟器中)。
我可以使用什么模拟器来完成上述工作? (编辑代码,编译并运行)以及如何?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
好吧,在网站 http://www.cs.mta.ac.il/~carmi/Teaching/OS.xv6/index.html。
他们实际运行它所使用的模拟器是 Bochs。
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.
如果您想在 Windows 10 上使用 WSL(适用于 Linux 的 Windows 子系统),这可能会有所帮助。
按照此处有关 Windows 的说明 或
第 1 步: 在 这个。
第 2 步:运行 WSL bash 并在 WSL 上安装所需的内容。
cd
bash
这会将 CMD 切换为 WSL bashsudo apt-get update && sudo apt-get install git nasm build-essential qemu gdb
第 3 步: 在 Makefile 中为 qemu 禁用视频设备。
使用任何文本编辑器打开 xv6 源目录中的 Makefile。
查找以以下开头的行
-display none
到此行并保存文件。第 4 步: 在该终端中输入类似 linux 的命令,即
make
make qemu
现在,如果一切正常,您应该位于 xv6 终端中
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.
cd <xv6-source-path>
bash
and this will switch CMD into WSL bashsudo 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
-display none
to this line and save the file.Step 4: type linux like commands in that terminal i.e
make
make qemu
Now if everything is okay, you should be in the xv6 terminal
您可以在 VirtualBox 中运行 Linux,这将为您提供与学校服务器上使用的计算机相同的环境。然后你可以继续在 qemu 中运行 xv6。不过,您需要一台功能相当强大的机器来完成此任务——带有 4G 内存的双核 CPU 是我尝试此操作的最低要求。
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.
我也会选择某种 VM 解决方案(如 TMN 建议的那样),但如果您没有硬件来运行足够规格的 VM,那么在 Cygwin 上构建它可能值得尝试。
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.
我已经尝试过上面的方法,但是 make qemu-nox 给了我这个错误:
我打开 Virtual Box GUI,右键单击虚拟机,当它关闭(暂停)时,我右键单击在VM上,然后单击“系统”选项卡,然后将主板内存更改为2000MB以上。
之后我跑了:
这对我有用,尽管其他方法都不起作用。
I had tried the above but
make qemu-nox
gave me this error: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:
This worked for me even though nothing else worked.
我已成功在 Windows 10 上使用命令提示符 (cmd.exe) 构建并运行 xv6。这就是我所做的。不是在Linux上,也不是Windows10 + WSL环境,也不是Windwos10 + Cygwin或MSYS环境,我使用命令提示符在Windows10上构建了它。
对于 Windows,您需要以下组件:MinGW、BusyBox 和 QEMU。我修改的xv6源代码可以从以下网址下载。
https://github.com/mirokuuno/xv6-windows
详细信息记录在“如何在 Windows 上使用命令提示符构建和运行 Unix-xv6”。
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" .