It's incomplete, but otherwise it's correct. Multiboot doesn't follow any standard C ABI, so you need at least a little bit of assembly code at the kernel entry point to set up the stack and adjust the parameter passing. The tutorial includes code to do one of those two things.
If you place your stack in the .bss section, you don't need to modify your linker script. You might not want to place your stack in the .bss section, but it's an option.
I'm pretty sure your stack needs to be loaded. If you want it to be uninitialized data like the .bss section, that's a different flag. Normally you let the linker automatically set the output section attributes based on the input section attributes, so you'd specify the attributes of your .stack section in the assembly file where you declare it (.section .stack,"aw",@nobits) and then you wouldn't need to give it any special treatment in your linker script.
Inline assembly is not allowed to change the stack pointer like that.teverett wrote: ↑Sat Apr 19, 2025 1:39 pmCode: Select all
asm volatile("mov %0, %%esp" : : "r" (kernel_stack_bottom));
Most of them probably did boot.