@@ -2900,11 +2900,11 @@ The target Linux kernel of the executable is a GCC toolchain build-time configur
2900
2900
First let's run a dynamically linked executable built with the Buildroot toolchain:
2901
2901
2902
2902
....
2903
- ./build-qemu --arch arm --userland
2904
- ./build-userland --arch arm
2905
- ./build-buildroot --arch arm
2903
+ ./build-qemu --arch aarch64 --userland
2904
+ ./build-userland --arch aarch64
2905
+ ./build-buildroot --arch aarch64
2906
2906
./run \
2907
- --arch arm \
2907
+ --arch aarch64 \
2908
2908
--userland print_argv \
2909
2909
-- \
2910
2910
asdf qwer \
@@ -2923,12 +2923,12 @@ You can also try statically linked executables with:
2923
2923
2924
2924
....
2925
2925
./build-userland \
2926
- --arch arm \
2926
+ --arch aarch64 \
2927
2927
--make-args='CCFLAGS_EXTRA=-static' \
2928
2928
--userland-build-id static \
2929
2929
;
2930
2930
./run \
2931
- --arch arm \
2931
+ --arch aarch64 \
2932
2932
--userland-build-id static \
2933
2933
--userland print_argv \
2934
2934
-- \
@@ -2940,13 +2940,13 @@ Or you can run statically linked built by the host packaged toolchain with:
2940
2940
2941
2941
....
2942
2942
./build-userland \
2943
- --arch arm \
2943
+ --arch aarch64 \
2944
2944
--host \
2945
2945
--make-args='-B CFLAGS_EXTRA=-static' \
2946
2946
--userland-build-id host-static \
2947
2947
;
2948
2948
./run \
2949
- --arch arm \
2949
+ --arch aarch64 \
2950
2950
--userland-build-id host-static \
2951
2951
--userland print_argv \
2952
2952
-- \
@@ -2962,9 +2962,9 @@ It's nice when <<gdb,the obvious>> just works, right?
2962
2962
2963
2963
....
2964
2964
./run \
2965
- --arch arm \
2966
- --wait-gdb \
2965
+ --arch aarch64 \
2967
2966
--userland print_argv \
2967
+ --wait-gdb \
2968
2968
-- \
2969
2969
asdf qwer \
2970
2970
;
@@ -2974,13 +2974,26 @@ and on another shell:
2974
2974
2975
2975
....
2976
2976
./run-gdb \
2977
- --arch arm \
2977
+ --arch aarch64 \
2978
2978
--userland print_argv \
2979
2979
main \
2980
2980
;
2981
2981
....
2982
2982
2983
- or to stop at the very first instruction of a freestanding program, just use `--no-continue` TODO example.
2983
+ Or alternatively, if you are using <<tmux>>, do everything in one go with:
2984
+
2985
+ ....
2986
+ ./run \
2987
+ --arch aarch64 \
2988
+ --userland print_argv \
2989
+ --tmux=main \
2990
+ --wait-gdb \
2991
+ -- \
2992
+ asdf qwer \
2993
+ ;
2994
+ ....
2995
+
2996
+ To stop at the very first instruction of a freestanding program, just use `--no-continue` TODO example.
2984
2997
2985
2998
=== gem5 syscall emulation mode
2986
2999
@@ -10231,40 +10244,32 @@ For example, on the first shell:
10231
10244
then on the second shell:
10232
10245
10233
10246
....
10234
- ./run-gdb --arch arm --baremetal interactive/prompt --no-continue
10247
+ ./run-gdb --arch arm --baremetal interactive/prompt -- main
10235
10248
....
10236
10249
10237
- and now we are left at the very first executed instruction of our tiny <<baremetal-bootloaders>>.
10238
-
10239
- Then just use `stepi` to when jumping into main to go to the C code in link:baremetal/interactive/prompt.c[].
10240
-
10241
- You can also find executables that don't use the bootloader at all under `baremetal/arch/<arch>/no_bootloader/*.S`, e.g.:
10250
+ Or if you are a <<tmux,tmux pro>>, do everything in one go with:
10242
10251
10243
10252
....
10244
- ./run --arch arm --baremetal arch/arm/no_bootloader/semihost_exit --wait-gdb
10253
+ ./run --arch arm --baremetal interactive/prompt --wait-gdb --tmux=main
10245
10254
....
10246
10255
10247
- The cool thing about those examples is that you start at the very first instruction of your program, which gives more control.
10248
-
10249
- Alternatively, skip directly to the C program main function with:
10256
+ Alternatively, to start from the very first executed instruction of our tiny <<baremetal-bootloaders>>:
10250
10257
10251
10258
....
10252
- ./run-gdb --arch arm --baremetal interactive/prompt main
10259
+ ./run --arch arm --baremetal interactive/prompt --wait-gdb --tmux=--no-continue
10253
10260
....
10254
10261
10255
- and then proceed as usual:
10262
+ Now you can just `stepi` to when jumping into main to go to the C code in link:baremetal/interactive/prompt.c[].
10256
10263
10257
- ....
10258
- ./run --arch arm --baremetal interactive/prompt --wait-gdb --gem5
10259
- ....
10260
-
10261
- and on another shell:
10264
+ This is specially interesting for the executables that don't use the bootloader from under `baremetal/arch/<arch>/no_bootloader/*.S`, e.g.:
10262
10265
10263
10266
....
10264
- ./run-gdb --arch arm --baremetal interactive/prompt --gem5 --no-continue
10267
+ ./run --arch arm --baremetal arch/arm/no_bootloader/semihost_exit --wait-gdb --tmux= --no-continue
10265
10268
....
10266
10269
10267
- `aarch64` GDB step debug is broken as mentioned at: <<gem5-gdb-step-debug-kernel-aarch64>>.
10270
+ The cool thing about those examples is that you start at the very first instruction of your program, which gives more control.
10271
+
10272
+ `aarch64` gem5 GDB step debug is broken as mentioned at: <<gem5-gdb-step-debug-kernel-aarch64>>.
10268
10273
10269
10274
=== Baremetal bootloaders
10270
10275
0 commit comments