Skip to content

add docker for riscv64 programming practice #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

listentodella
Copy link

添加docker,自带 qemu4.2.1,Mac M1、WSL2 环境亲测可用

@runninglinuxkernel
Copy link
Owner

谢谢,docker是否有GUI?我们实验里有 提到学员可以使用eclipse来图像化调试程序

@listentodella
Copy link
Author

谢谢,docker是否有GUI?我们实验里有 提到学员可以使用eclipse来图像化调试程序

DOCKER_TAG ?= rlk-study:latest
.PHONY: docker build_docker

docker:
        docker run --rm -it -p 3333:1234 -v ${PWD}:/mnt -w /mnt --name rlk-study ${DOCKER_TAG} bash

build_docker: 
        docker build -t ${DOCKER_TAG} --target build .

gdb:
        qemu-system-riscv64 -machine virt -m 128M -nographic -bios target/riscv64gc-unknown-none-elf/debug/mysbi.bin -device loader,file=target/riscv64gc-unknown-none-elf/debug/os.bin,addr=0x80200000 -S -gdb tcp::1234

run:
        qemu-system-riscv64 -machine virt -m 128M -nographic -bios target/riscv64gc-unknown-none-elf/debug/mysbi.bin -device loader,file=target/riscv64gc-unknown-none-elf/debug/os.bin,addr=0x80200000

这个倒是没有考虑到,为了让docket尽可能小,没有加gui的功能。

我是通过在外面修改,启动docker时,将docker的1234端口重映射到host的3333端口,这样docker内只需要启动gdbserver,外面的host通过gdb-multiarch 去连接3333端口即可。

理论上外部的eclipse也可以用同样的方式连接上后再调试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants