diff --git a/Justfile b/Justfile index 431a879..df1e2b2 100644 --- a/Justfile +++ b/Justfile @@ -30,3 +30,6 @@ openocd: gdb: cargo make gdb + +nm: + cargo make nm diff --git a/README.md b/README.md index 940be7a..0bf55aa 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,12 @@ just gdb If you launch OpenOCD or QEMU before, then gdb shall connect to it and allow you to load the kernel binary directly into memory. Type `load` in gdb to do that. +### To see kernel symbols and their values + +``` +just nm +``` + ### To see kernel disassembly You need to have [Hopper](https://hopperapp.com) and hopperv4 cli helper installed. diff --git a/nucleus/Makefile.toml b/nucleus/Makefile.toml index 659c29b..95cfa7e 100644 --- a/nucleus/Makefile.toml +++ b/nucleus/Makefile.toml @@ -78,6 +78,13 @@ script = [ "rust-gdb -x ${GDB_CONNECT_FILE} ${KERNEL_ELF}" ] +[tasks.nm] +dependencies = ["build", "kernel-binary"] +script = [ + "${NM} -- ${KERNEL_ELF} | sort" +] +#install_crate = "cargo-binutils" + [tasks.sdcard] dependencies = ["build", "kernel-binary"] script_runner = "@duckscript"