MIT6.S081-实验准备

实验全程在Vmware虚拟机 (镜像:Ubuntu-20.04-beta-desktop-amd64) 中进行

一、版本控制

1.1 将mit的实验代码克隆到本地

  • git clone git://g.csail.mit.edu/xv6-labs-2020

1.2 修改本地git配置文件

  1. 创建github仓库,记录仓库地址
    • 我的仓库地址就是https://github.com/luhexin/MIT6.S081-Labs.git
    • 由于MIT教授不希望学生开源作业代码,因此我将仓库设置为private
  2. 向 Git 仓库添加一个新的远程仓库
    • 首先进入本地项目
      • cd xv6-labs-2020/
    • git remote add <remote-name> <remote-url>
      • 例如: git remote add mygit https://github.com/luhexin/MIT6.S081-Labs.git
    • 查看本地仓库的git配置文件
      • cat .git/config
        请添加图片描述

      • 因为已经有origin了,所以使用一个别的remote-name

1.3 git分支管理

  • 查看远端分支
    • git branch -r
      请添加图片描述
      • 每一个lab对应一个分支
  • 切换到相应分支
    • 比如切换到第一个lab util: git checkout util
    • 使用git branch查看本地的分支

1.4 git push

  • git push <远程主机名> <本地分支名>:<远程分支名>
    • 如果本地分支名与远程分支名相同,则可以省略冒号
      • git push <远程主机名> <本地分支名>
    • 例如: git push mygit util:util
      • 将本地的util分支push到远端的util分支
    • 提示Support for password authentication was removed: 参考https://zhuanlan.zhihu.com/p/443038323
    • 假如出现网络超时或者其他网络的问题可以尝试使用SSH进行连接,但是需要改一下.git/config
      • git remote remove mygit https://github.com/luhexin/MIT6.S081-Labs.git
      • git remote add mygit …
    • 使用SSH进行push时,不能与github.com建立连接可以参考下面文章
      • https://blog.csdn.net/mj_zm/article/details/120413479

二、安装工具链

  • 官方教程: https://pdos.csail.mit.edu/6.S081/2020/tools.html
# 必要的工具链
sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu 

# 单独移除掉qemu的新版本, 因为不知道为什么build时候会卡壳
sudo apt-get remove qemu-system-misc
# 额外安装一个旧版本的qemu
sudo apt-get install qemu-system-misc=1:4.2-3ubuntu6

# 验证安装
$ riscv64-unknown-elf-gcc --version
riscv64-unknown-elf-gcc (GCC) 10.1.0
...
$ qemu-system-riscv64 --version
QEMU emulator version 5.1.0

# 编译和运行xv6
# in the xv6 directory
$ make qemu
# ... lots of output ...
init: starting sh

参考

  • https://xv6.dgs.zone/labs/use_git/git1.html
  • https://pdos.csail.mit.edu/6.S081/2020/tools.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值