MIT 6.828 操作系統工程 2018 fall xv6 工具鏈搭建與測試

mit 6.828 lab 代碼和筆記,以及中文註釋源代碼已放置在github中:
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
    
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章