内容大致来源: 1.视频教程:https://space.bilibili.com/16765968/channel/collectiondetail?sid=86878 2.文档:https://tarplkpqsm.feishu.cn/docs/doccnoBgv1TQlj4ZtVnP0hNRETd#W8iZmH
注意:docker支持Windows 10 操作系统专业版,所以要升级windows版本 买密钥升级即可
相关配置:https://www.runoob.com/docker/windows-docker-install.html
参考文档:https://tarplkpqsm.feishu.cn/docs/doccnxrUYjtjuoNnAyxwajplSyf#
注意:安装ubuntu20.04LTS版本(https://packages.ubuntu.com/focal/misc/qemu-system-misc) 管理员启动powerShell,输入 docker pull ubuntu:20.04
方法一: powerShell中输入:docker start -i ubuntu 方法二: 直接在docker desktop中点击start即可 注:进入一个正在运行的容器 1.查看运行的容器ID:docker ps 2.进入容器:docker attach 容器ID
apt-get update apt-get install vim
vim /etc/apt/source.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
apt-get install git python3 sudo
sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu
sudo apt-get remove qemu-system-misc sudo apt-get install qemu-system-misc=1:4.2-3ubuntu6
docker export -o ubuntu.tar ubuntu
补充:
压缩包创建镜像并运行生成容器
docker import ubuntu.tar my_ubuntu:0.1 docker run -i -t -w /root --name my_ubuntu111 my_ubuntu:0.1 bash
git clone git://g.csail.mit.edu/xv6-labs-2021 cd xv6-labs-2021 git checkout util
make make qemu
输入ls查看是否成功
退出QEMU: ctrl+a x可以退出sh(是按住ctrl还有a,松开手,再按下x,然后回车)
注意:在VSCode中不能使用快捷键查看运行进程信息,由于快捷键冲突导致
在powerShell中查看进程信息: ctrl + p 可以查看当前进程