一直想好好学习一下操作系统课程,去一个Mooc网站上找了一门操作系统的课程。这便是里面的配套实验。

实验指导:点这里

lab0主要是准备相关的操作环境。课程推荐使用qemu作为硬件模拟器,推荐运行环境为linux操作系统。

因为我使用的是Windows系统,所以需要解决运行环境的问题。开始想了几种解决方案:一个是直接装一个Linux的操作系统,但是觉得这样子系统切换太麻烦了;一个是租一台云服务器,在网上看了一下感觉国内都略贵的样子;还有就是自己装一个虚拟机了,虽然这样子可能有时候性能会有点慢。

另外,在网上看到有个叫做"实验楼"的网站,上面有这门课的配套实验。网站会给你分配和布置实验设备。在上面用过几次,觉得每次都会重新分配机器,不是很方便。还有就是毕竟是别人布置的环境,总有种不自由的感觉。对于我这种新手如果碰到莫名其妙的问题,而解决方案要改权限什么的话,就懵逼了。

所以,我最终还是选择了在虚拟机上装一个Ubuntu。

安装Ubuntu虚拟机

虚拟机一般有两种选择:一个是VMWare Workstation,另一个是Virtual Box。我选择了VBox,因为这个是免费的。

Virtaul Box的安装过程按照默认的选项就好了,没有什么特别之处。

安装好以后,在VBox里面新建一个Ubuntu的设备就好了。我使用的虚拟设备配置如下:

内存: 1GB

硬盘:10GB (本来Vbox建议的是8GB,但是后来安装系统的时候至少要8G空间来访系统配置,然后我就给了10G)

然后点击"运行"的时候,说需要读启动盘。到网上搜了一下,说要下一个镜像放进去。

于是,我去下了一个镜像,用虚拟光驱读出来。

接下来的过程,就是像给正常机器装系统一样,在虚拟设备上装了一个Ubuntu系统,装好以后就不再需要启动盘了。

为了方便和虚拟机之间传输数据,在虚拟设备里面挂载了一个共享盘。具体细节可以参考这里

Virtaul Box下载地址:https://www.virtualbox.org/wiki/Downloads

Ubuntu下载地址(选Desktop就好了):https://www.ubuntu.com/download

安装qemu

去官网上下了一个压缩包。打开发现是源码。于是上网搜了一下,安装的过程大约是下面这样子。

  1. cd /qemu-xxxx
  2. ./configure
  3. sudo make
  4. sudo make install

在make 时出现了以下错误:

  1. GEN aarch64-softmmu/config-devices.mak.tmp
  2. GEN aarch64-softmmu/config-devices.mak
  3. GEN alpha-softmmu/config-devices.mak.tmp
  4. GEN alpha-softmmu/config-devices.mak
  5. GEN arm-softmmu/config-devices.mak.tmp
  6. GEN arm-softmmu/config-devices.mak
  7. GEN cris-softmmu/config-devices.mak.tmp
  8. GEN cris-softmmu/config-devices.mak
  9. GEN i386-softmmu/config-devices.mak.tmp
  10. GEN i386-softmmu/config-devices.mak
  11. GEN lm32-softmmu/config-devices.mak.tmp
  12. GEN lm32-softmmu/config-devices.mak
  13. GEN m68k-softmmu/config-devices.mak.tmp
  14. GEN m68k-softmmu/config-devices.mak
  15. GEN microblaze-softmmu/config-devices.mak.tmp
  16. GEN microblaze-softmmu/config-devices.mak
  17. GEN microblazeel-softmmu/config-devices.mak.tmp
  18. GEN microblazeel-softmmu/config-devices.mak
  19. GEN mips-softmmu/config-devices.mak.tmp
  20. GEN mips-softmmu/config-devices.mak
  21. GEN mips64-softmmu/config-devices.mak.tmp
  22. GEN mips64-softmmu/config-devices.mak
  23. GEN mips64el-softmmu/config-devices.mak.tmp
  24. GEN mips64el-softmmu/config-devices.mak
  25. GEN mipsel-softmmu/config-devices.mak.tmp
  26. GEN mipsel-softmmu/config-devices.mak
  27. GEN moxie-softmmu/config-devices.mak.tmp
  28. GEN moxie-softmmu/config-devices.mak
  29. GEN or32-softmmu/config-devices.mak.tmp
  30. GEN or32-softmmu/config-devices.mak
  31. GEN ppc-softmmu/config-devices.mak.tmp
  32. GEN ppc-softmmu/config-devices.mak
  33. GEN ppc64-softmmu/config-devices.mak.tmp
  34. GEN ppc64-softmmu/config-devices.mak
  35. GEN ppcemb-softmmu/config-devices.mak.tmp
  36. GEN ppcemb-softmmu/config-devices.mak
  37. GEN s390x-softmmu/config-devices.mak.tmp
  38. GEN s390x-softmmu/config-devices.mak
  39. GEN sh4-softmmu/config-devices.mak.tmp
  40. GEN sh4-softmmu/config-devices.mak
  41. GEN sh4eb-softmmu/config-devices.mak.tmp
  42. GEN sh4eb-softmmu/config-devices.mak
  43. GEN sparc-softmmu/config-devices.mak.tmp
  44. GEN sparc-softmmu/config-devices.mak
  45. GEN sparc64-softmmu/config-devices.mak.tmp
  46. GEN sparc64-softmmu/config-devices.mak
  47. GEN tricore-softmmu/config-devices.mak.tmp
  48. GEN tricore-softmmu/config-devices.mak
  49. GEN unicore32-softmmu/config-devices.mak.tmp
  50. GEN unicore32-softmmu/config-devices.mak
  51. GEN x86_64-softmmu/config-devices.mak.tmp
  52. GEN x86_64-softmmu/config-devices.mak
  53. GEN xtensa-softmmu/config-devices.mak.tmp
  54. GEN xtensa-softmmu/config-devices.mak
  55. GEN xtensaeb-softmmu/config-devices.mak.tmp
  56. GEN xtensaeb-softmmu/config-devices.mak
  57. GEN aarch64-linux-user/config-devices.mak.tmp
  58. GEN aarch64-linux-user/config-devices.mak
  59. GEN alpha-linux-user/config-devices.mak.tmp
  60. GEN alpha-linux-user/config-devices.mak
  61. GEN arm-linux-user/config-devices.mak.tmp
  62. GEN arm-linux-user/config-devices.mak
  63. GEN armeb-linux-user/config-devices.mak.tmp
  64. GEN armeb-linux-user/config-devices.mak
  65. GEN cris-linux-user/config-devices.mak.tmp
  66. GEN cris-linux-user/config-devices.mak
  67. GEN i386-linux-user/config-devices.mak.tmp
  68. GEN i386-linux-user/config-devices.mak
  69. GEN m68k-linux-user/config-devices.mak.tmp
  70. GEN m68k-linux-user/config-devices.mak
  71. GEN microblaze-linux-user/config-devices.mak.tmp
  72. GEN microblaze-linux-user/config-devices.mak
  73. GEN microblazeel-linux-user/config-devices.mak.tmp
  74. GEN microblazeel-linux-user/config-devices.mak
  75. GEN mips-linux-user/config-devices.mak.tmp
  76. GEN mips-linux-user/config-devices.mak
  77. GEN mips64-linux-user/config-devices.mak.tmp
  78. GEN mips64-linux-user/config-devices.mak
  79. GEN mips64el-linux-user/config-devices.mak.tmp
  80. GEN mips64el-linux-user/config-devices.mak
  81. GEN mipsel-linux-user/config-devices.mak.tmp
  82. GEN mipsel-linux-user/config-devices.mak
  83. GEN mipsn32-linux-user/config-devices.mak.tmp
  84. GEN mipsn32-linux-user/config-devices.mak
  85. GEN mipsn32el-linux-user/config-devices.mak.tmp
  86. GEN mipsn32el-linux-user/config-devices.mak
  87. GEN or32-linux-user/config-devices.mak.tmp
  88. GEN or32-linux-user/config-devices.mak
  89. GEN ppc-linux-user/config-devices.mak.tmp
  90. GEN ppc-linux-user/config-devices.mak
  91. GEN ppc64-linux-user/config-devices.mak.tmp
  92. GEN ppc64-linux-user/config-devices.mak
  93. GEN ppc64abi32-linux-user/config-devices.mak.tmp
  94. GEN ppc64abi32-linux-user/config-devices.mak
  95. GEN ppc64le-linux-user/config-devices.mak.tmp
  96. GEN ppc64le-linux-user/config-devices.mak
  97. GEN s390x-linux-user/config-devices.mak.tmp
  98. GEN s390x-linux-user/config-devices.mak
  99. GEN sh4-linux-user/config-devices.mak.tmp
  100. GEN sh4-linux-user/config-devices.mak
  101. GEN sh4eb-linux-user/config-devices.mak.tmp
  102. GEN sh4eb-linux-user/config-devices.mak
  103. GEN sparc-linux-user/config-devices.mak.tmp
  104. GEN sparc-linux-user/config-devices.mak
  105. GEN sparc32plus-linux-user/config-devices.mak.tmp
  106. GEN sparc32plus-linux-user/config-devices.mak
  107. GEN sparc64-linux-user/config-devices.mak.tmp
  108. GEN sparc64-linux-user/config-devices.mak
  109. GEN tilegx-linux-user/config-devices.mak.tmp
  110. GEN tilegx-linux-user/config-devices.mak
  111. GEN x86_64-linux-user/config-devices.mak.tmp
  112. GEN x86_64-linux-user/config-devices.mak
  113. GEN config-all-devices.mak
  114. GEN config-host.h
  115. (cd /home/phantom01/work/qemu/pixman; autoreconf -v --install)
  116. /bin/sh: 1: autoreconf: not found
  117. Makefile:211: recipe for target '/home/phantom01/work/qemu/pixman/configure' failed
  118. make: *** [/home/phantom01/work/qemu/pixman/configure] Error 127

./pixman/目录下看了一下,确实没有configure文件,但是有一个configure.ac。所以需要autoreconf工具,将这个configure.ac生成对应的configure文件。

所以,接下来我安装了autoreconf

  1. apt-get install autoconf automake libtool

然后切换到pixman目录下面执行

  1. autoreconf -v --install

来生成configure文件。

然后在切到qemu目录下执行make。然后在 sudo make install成功。

为方便操作,建立软连接:

  1. sudo ln -s /usr/local/bin/qemu-system-i386 /usr/local/bin/qemu

注意点: make失败是不要clean再重新make。因为在make过程中会改变一些make文件,所以clean掉可能会出一些问题。

qemu下载地址:http://wiki.qemu.org/Download

附1: VirtualBox创建内Linux系统与Windows的共享文件夹

来源: http://jingyan.baidu.com/article/2fb0ba40541a5900f2ec5f07.html

在日常工作或学习中我们经常需要在一台电脑上同时使用Windows和Linux(这里以Ubuntu为例)两个系统,我们通常的做法有两种:

一种安装双系统(双系统的安装方法经验里已经有很多,大家可以去参照)

另一种更为普遍的是在Windows本机用虚拟机安装Linux系统,然而Windows本机与虚拟机内Linux系统的文件该如何交换呢,其实也有好多方法,如USB接口设备共享、Ftp服务器共享等,这里主告诉告诉大家一种更为方便办法“共享文件夹”(这个方法在windows虚拟系统上设置比较简单),下面我们看看如何让Windows本机和Linux虚拟系统之间共享文件夹。


工具/原料

  • Oracle VM VirtualBox
  • Windows XP 以上操作系统

方法/步骤

  1. 首先,必须要有已经在VirtualBox中安装好的Ubuntu系统,才能按照以下步骤操作,具体怎样在VirtualBox中安装Ubuntu系统百度经验里已经有很多,大家可以自己查询参照。
  2. 打开虚拟机进入Ubuntu系统,首先要安装VirtualBox增强功能包(VBoxGuestAdditions),参照下图,如果确认已经安装就直接跳过至第4步。 (设备 - 安装增强功能)
  3. 点击运行后,系统会自动安装,安装完成后要求重启系统。
  4. 在本机系统设置一个共享文件夹,用于与Ubuntu交互的区域空间。
  5. 右击状态栏上共享文件夹图标或菜单栏“设备-共享文件夹”,打开共享文件夹设置。
  6. 点击共享文件夹设置框,右上角的添加按钮
  7. 选择之前本机设置的共享文件夹,此时一定不可以勾选自动挂载
  8. 设置好共享名后,进入Ubuntu系统,打开终端,先执行命令,在挂载点目录添加bdshare目录,接着执行mount -t vboxsf BaiduShare /mnt/bdshare/,就能完成共享文件夹的设置。
  9. 设置完成,可以创建几个文件,测试一下。
  10. 设置自动挂载,重启虚拟机系统共享仍在。可以在/etc/fstab中添加一项BaiduShare /mnt/share vboxsf rw,gid=110,uid=1100,auto 0 0
  11. 卸载挂载点命令:umount -f /mnt/share

注意事项

  • 其它linux系统设置方法基本相同
  • 共享文件夹的名称不能和挂载点的名称相同。

参考资料

  1. http://www.lofter.com/tag/ucore

ucore_lab0的更多相关文章

随机推荐

  1. 2016年工作中遇到的问题1-10:select-for-update锁表

    1.select... for update锁表.注意事项:事务下使用,@Transactional如果用主键,只锁住1行记录如果不用主键,会锁住多条记录,mysql下测试,查询1条,锁住1行,查询2 ...

  2. python对大文件的处理

    多线程框架中采取queue来实现线程间资源的互斥. 在文件过大的情况下,如果都读入内存的话,占用内存就太多了. 这里手动实现了一个多线程调用文件迭代器来使用f.next() # -*- coding: ...

  3. HDU 3567 Eight II

    Eight II Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on HDU. Original ID: 3 ...

  4. Android数据库高手秘籍:SQLite命令

    要想熟练地操作任何一个数据库,最最基本的要求就是要懂SQL语言,这也是每个程序员都应该掌握的技能.虽说SQL博大精深,要想精通确实很难,但最基本的一些建表命令,增删改查,大家还是必须要学会的. SQL ...

  5. hibernate 管理 Session(单独使用session,非spring)

    Hibernate 自身提供了三种管理 Session 对象的方法 Session 对象的生命周期与本地线程绑定 Session 对象的生命周期与 JTA 事务绑定 Hibernate 托付程序管理 ...

  6. 关于App class loader的总结

    关于App class loader的总结 2010-05-11 15:19:09 分类: 系统运维 Java本身是一种设计的非常简单,非常精巧的语言,所以Java背后的原理也很简单,归结起来就是两点 ...

  7. [Phonegap+Sencha Touch] 移动开发19 某些安卓手机上弹出消息框 点击后不消失的解决的方法

    Ext.Msg.alert等弹出框在某些安卓手机上,点击确定后不消失. 原因是: 消息框点击确定后有一段css3 transform动画,动画完毕后才会隐藏(display:none). 有些奇葩手机 ...

  8. 开源ext2read代码走读之-在windows下怎样推断有几个硬盘设备?

    int get_ndisks() {     HANDLE hDevice;               // handle to the drive to be examined     int n ...

  9. 内存问题检测神器:Valgrind

    Linux下内存问题检测神器:Valgrind 在写大型C/C++工程时难免会发生内存泄漏现象,系统编程中一个重要的方面就是有效地处理与内存相关的问题.你的工作越接近系统,你就需要面对越多的内存问题. ...

  10. Centos7 minimal 系列之Redis集群搭建(六)

    一.redis安装 借鉴上篇博客:http://www.cnblogs.com/WJ--NET/p/8176071.html 二.集群搭建 2.1.创建文件夹 mkdir redis_cluster ...