zoukankan      html  css  js  c++  java
  • XV6环境搭建及注意事项

    Ubuntu16.04SLT 64位

    工具链

    sudo apt-get install gcc-multilib

    libsdl1.2-dev, libtool-bin, libglib2.0-dev, libz-dev, and libpixman-1-dev.

    下载lab进行make编译

    下载qemu进行编译

    git clone http://web.mit.edu/ccutler/www/qemu.git -b 6.828-2.3.0

    编译的时候首先需要指定目录

    ./configure --disable-kvm [--prefix=PFX] [--target-list="i386-softmmu x86_64-softmmu"]

    PFX为指定的目录

    然后 make && make install

    在lab的GNUmakefile需要修改QEMU的路径

    可以通过命令make qemu启动

    启动非图形界面,可以使用make qemu-nox

    离开界面使用 Ctrl+a x

    调试操作系统(开两个窗口)

    make qemu-gdb (or make qemu-nox-gdb).

    In the second terminal, from the same directory you ran make, run make gdb or gdb You should see something like this,

    现在就可以调试了,使用si进行单步调试

    BootLoader开始执行的地方You can set address breakpoints in GDB with the b command. For example, b *0x7c00

    记得修改配置

    将下面的语句放到/home/kexinxin/.gdbinit

    add-auto-load-safe-path /home/kexinxin/6.828/xv6-public-test/.gdbinit

    替换为xv6的路径

    注意默认只能调试内核代码,要调试用户代码需要在gdb中使用语句file _filename,以调试sh.c为例

    file _sh

    这样的话就不能调试内核代码,只能调试用户代码,要切换回去的话,使用

    file kernel

    注意来回切换的时候断点会被清除,因此需要重新设置断点。

  • 相关阅读:
    tcpip详解笔记(1) 概述
    tcpip详解笔记(11) 广播和多播
    tcpip详解笔记(13) tftp
    tcpip详解笔记(15) TCP协议连接过程
    tcpip详解笔记(8) traceroute
    tcpip详解笔记(5) RARP协议
    tcpip详解笔记(6) icmp协议
    tcpip详解笔记(7) ping
    tcpip详解笔记(4) arp协议
    tcpip详解笔记(3) IP网际协议
  • 原文地址:https://www.cnblogs.com/kexinxin/p/9939154.html
Copyright © 2011-2022 走看看