Skip to content

Commit

Permalink
fix vscode launch script and get the breakpoints to work
Browse files Browse the repository at this point in the history
  • Loading branch information
goodstuff20 committed Jan 2, 2021
1 parent d990a69 commit bf1eb61
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ based off https://github.com/jserv/armv8-hello and https://wiki.osdev.org/ARM_Ra

Run a custom kernel on a hardware-emulated raspberry pi 3.

to run qemu-io-test:
- ./run.sh
- run Debug QEMU launc configuration

notes:
- since raspberry pi 4 is not yet supported by qemu raspi3 is running
- output "Hello World" sometimes looses characters or prints different chars
Expand Down
22 changes: 13 additions & 9 deletions qemu-IO-test/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug program",
"name": "Debug QEMU",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/kernel8.img",
"miDebuggerServerAddress": "localhost:9000",
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"program": "${workspaceRoot}/build/kernel8.img",
"miDebuggerServerAddress": "localhost:1234",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb-multiarch",
"preLaunchTask": "Run QEMU",
"externalConsole": true,
"launchCompleteCommand": "exec-run",
"linux": {
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb-multiarch"
}
//"preLaunchTask": "qemu background"
}
]
}
4 changes: 2 additions & 2 deletions qemu-IO-test/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"label": "Run QEMU",
"type": "shell",
"isBackground": true,
"command": "echo Starting QEMU&qemu-system-aarch64 -S -gdb tcp::9000 -M raspi3 -kernel build/kernel8.img --nographic -d int",
"command": "echo Starting QEMU&qemu-system-aarch64 -S -gdb tcp::1234 -M raspi3 -kernel build/kernel8.img --nographic -d int",
"problemMatcher": {
"pattern": {
"regexp": "^(Starting QEMU)",
Expand All @@ -16,7 +16,7 @@
"endsPattern": "^(Starting QEMU)"
}
}
},
}
],
"version": "2.0.0"
}
4 changes: 2 additions & 2 deletions qemu-IO-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ KERNEL_FILE = kernel8.img
-march=armv8-a \
-Iinclude
# -mgeneral-regs-only
CFLAGS = -Wall -nostdlib -nostartfiles -ffreestanding -Iinclude -mgeneral-regs-only
SFLAGS = -Iinclude
CFLAGS = -Wall -nostdlib -nostartfiles -ffreestanding -Iinclude -mgeneral-regs-only -g
SFLAGS = -Iinclude -g

C_FILES = $(wildcard src/*.c)
S_FILES = $(wildcard src/*.S)
Expand Down
2 changes: 1 addition & 1 deletion qemu-IO-test/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
echo "Press Ctrl-A and then X to exit QEMU"
echo
qemu-system-aarch64 -M raspi3 -kernel build/kernel8.img --nographic -d int
qemu-system-aarch64 -S -M raspi3 -kernel build/kernel8.img --nographic -gdb tcp::1234

0 comments on commit bf1eb61

Please sign in to comment.