Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 1.36 KB

工具链.md

File metadata and controls

52 lines (31 loc) · 1.36 KB

MIT 6.828 工具链搭建测试

mit 6.828 lab 代码和笔记,以及中文注释源代码已放置在github中:
[https://github.com/yunwei37/xv6-labs](https://github.com/yunwei37/xv6-labs)

tools

环境:在vmware中新安装的ubuntu 版本 20.04:

  • uname -a

    Linux ubuntu 5.4.0-39-generic #43-Ubuntu SMP Fri Jun 19 10:28:31 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

参考:https://pdos.csail.mit.edu/6.828/2018/tools.html

  1. 安装开发环境:

    ubuntu 版本 20.04 是没有携带相关开发环境的,因此需要进行安装

    sudo apt-get install -y build-essential gdb
    sudo apt-get install gcc-multilib
    
    
  2. 下载qemu,编译:

    git clone https://github.com/mit-pdos/6.828-qemu.git qemu
    ./configure --disable-kvm --disable-werror --target-list="i386-softmmu x86_64-softmmu"
    make
    
    

    报错:

    /usr/bin/ld: qga/commands-posix.o: in function `dev_major_minor':
    /home/yunwei/qemu/qga/commands-posix.c:633: undefined reference to `major'
    /usr/bin/ld: /home/yunwei/qemu/qga/commands-posix.c:634: undefined reference to `minor'
    collect2: error: ld returned 1 exit status
    

    解决方案:在qga/commands-posix.c文件中加上头文件: #include<sys/sysmacros.h>

    make && make install