You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -44,18 +46,25 @@ Execution will be stopped where you put the 'jmp $' in the code. Take a look at
44
46
QEMU will now be running the code directly after the `jmp $` you had inserted. After the first `stepi` command is executed you can hit enter to repeat the action and want the CPU step through the assembly code.
45
47
46
48
47
-
## Debugging with QEMU (at a known address)
49
+
### GDB instructions
50
+
51
+
Dump some memory
52
+
53
+
x 0xXXXXX
54
+
55
+
56
+
## Debugging with QEMU
48
57
49
58
When the kernel is compiled a file called `kernel-debug.txt` is generated. This file can be used as a reference for opcode addresses within the kernel. Add `0x100000` to any address in the text file for the actual in-memory address.
50
59
51
60
Start QEMU with the `-S` switch to start the virtual machine in a paused mode if you need to add a breakpoint somewhere in the kernel startup code. You can un-pause the execution by typing `c` into GDB after you create the breakpoint.
52
61
53
62
54
-
## The QEMU monitor
63
+
###The QEMU monitor
55
64
56
-
QEMU has a built in monitor to allow you to query the state of the VM.
65
+
QEMU has a built in monitor to allow you to query the state of the VM. Running BareMetal via `./baremetal.sh run` in `BareMetal-OS` enables the monitor telnet port.
57
66
58
-
`Escape+2` will switch to the QEMU monitor console and `Escape+1` will switch back to the VM. Enter `quit` on the QEMU monitor console to stop the VM.
67
+
telnet localhost 8086
59
68
60
69
61
70
### Debugging via QEMU monitor
@@ -86,13 +95,6 @@ The "format" can be x (hex), d (signed decimal), u (unsigned decimal), o (octal)
86
95
The "size" parameter can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits).
0 commit comments