Hi all,
I'm currently measuring the code base sizes of Genode with different kernels. I have split this into the kernel itself and kernel-dependent code of Genode (core and ld.lib.so). This worked well for all kernels except hw where I couldn't really make a distinction between the kernel and core. The only additional binary is is called *.bootstrap and resides inside var/. Unfortunately it doesn't contain any references to its source code and I couldn't find any debug binary that does so (I need this since I measure the code size by source references in elf binaries via objdump).
Is there a way to build this binary with more debug information. And more generally how are the kernel part and core separated in hw (which isn't as easy as with other kernels that use a port)?
Regards, Johannes
Hi Johannes,
El 11/04/18 a las 14:17, Johannes Kliemann escribió:
Is there a way to build this binary with more debug information. And more generally how are the kernel part and core separated in hw (which isn't as easy as with other kernels that use a port)?
In base-hw, the kernel is incorporated into Core. There is no dedicated binary or lib. The output of
! grep "kernel/" base-hw/lib/mk
shows that the kernel code is used only by Core (the Syscall and Bootstrap lib that also show up use only the syscall bindings). AFAIK, the purpose of the Bootstrap binary is merely to bring up the MMU and set everything in place to let the real kernel start. Afterwards it is abandoned. That said, I don't think that it fits well into your considerations.
If you still want an unstripped Bootstrap binary you may replace in file base-hw/src/bootstrap/hw/target.mk:
! $(BOOTSTRAP_OBJ).stripped: $(BOOTSTRAP_OBJ) ! $(VERBOSE)$(STRIP) --strip-debug -o $@ $<
with:
! $(BOOTSTRAP_OBJ).stripped: $(BOOTSTRAP_OBJ) ! $(VERBOSE)cp $< $@
Do make clean and then make run/<RUN_SCRIPT>. Finally, these are the Core and Bootstrap binaries with debug symbols:
./var/run/<RUN_SCRIPT>.core ./var/run/<RUN_SCRIPT>.bootstrap
Martin
A little addition on that:
In base-hw, in contrast to other base repositories, the kernel and Core work together and trust each other - they even share the same virtual address space. There's also not a clear distinction between C++ sources of the kernel and those of the rest of Core. However, the kernel sub-directories should contain all code that represents only kernel interna.
El 11/04/18 a las 14:17, Johannes Kliemann escribió:
Hi all,
I'm currently measuring the code base sizes of Genode with different kernels. I have split this into the kernel itself and kernel-dependent code of Genode (core and ld.lib.so). This worked well for all kernels except hw where I couldn't really make a distinction between the kernel and core. The only additional binary is is called *.bootstrap and resides inside var/. Unfortunately it doesn't contain any references to its source code and I couldn't find any debug binary that does so (I need this since I measure the code size by source references in elf binaries via objdump).
Is there a way to build this binary with more debug information. And more generally how are the kernel part and core separated in hw (which isn't as easy as with other kernels that use a port)?
Martin