mihe wrote:
- -m32: To make sure it is 32bits
You don't need this.
mihe wrote:
- -O0: No optimizations, to avoid running into problems at this stage, reduce complexity and make the learning curve not that step.
I prefer to compile multiple times with different optimization levels. That way, if I have some undefined behavior in my code, I'm more likely to end up with a crash.
mihe wrote:
- -masm=intel: Just personal preference to examine the code generated
This option also affects inline assembly, in case you use any.
mihe wrote:
@ Shall I use std=gnu99 or a more recent version of the C standard? Is there any showstopper to use c11 or c17?
I'm not aware of any reasons to avoid using C17 instead of C99. There are only a handful of differences between the two, as far as a freestanding compiler is concerned, so you may not notice the difference if you don't try to use any of the new features.
C17 is (almost?) exclusively clarifications and fixes for C11, so there's no reason to use C11.
mihe wrote:
- I will use also the linker to concatenate my asm bootloader (already in machine code via the NASM assembler) with the compiled code from the Kernel in c, resulting in the final ELF32 file.
- For the aforementioned process, I will use a linker script.
I'm not sure this will work the way you want. The bootloader is a boot sector, right? You can't put that part inside an ELF executable because then it won't be at the beginning.