I wonder if that would be an issue for our bootloader
We handle .bss sections here: https://github.com/rust-osdev/bootloader/blob/e136cbe898a42d9787bb94367d7d8091dc2cddbc/src/page_table.rs#L103-L184
wait, but how does using const functions as an initializer to statics work? The .bss section contains uninitialized data so rust cannot initialize them at compile time but there is nothing that could call the initializer at runtime either
It's not uninitialized data, but zeroed data. The idea is that you don't need to actually store static variables that are initialized with zero in the executable. Instead, you tell the loader which memory range it should set to zero when loading.
This has nothing to do with const functions, all that matters is the bit-value of the result. If it is zero, the compiler does not store it in the .rodata/.data sections but only increases the size of the .bss section without actually writing it to the executable. However, this only works when your loader zeroes the memory range specified by the .bss section. If you write a custom loader and forget to do this, the memory will be unitialized and might contain random values.
Yes, it is. https://github.com/lowenware/leos-kernel
I’ve started with real hardware recently. Haven’t commit anything yet, but hopefully will do until the end of the week.