Creating an Operating System: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
m Maybe not that early
Line 33:
 
The compiler expects you to perform various program initialization tasks, such as calling the constructors on global C++ objects. Normally you would use a <tt>kernel_early_main</tt> function to set up the minimal kernel features, then perform all these initialization tasks, and then jump to the actual <tt>kernel_main</tt> function.
 
=== Stack Smash Protector ===
{{Main|Stack Smashing Protector}}
 
Early is not too soon to think about security and robustness. You can take advantage of the optional stack smash protector offered by modern compilers that detect stack buffer overruns rather than behaving unexpectedly (or nothing happening, if unlucky).
 
=== Terminal Support ===
Line 43 ⟶ 38:
 
You will often need to debug your operating system. Your very best friend is a printf function that is able to print strings and integers to the screen onto a terminal-like buffer. It is crucial to add a printf function to your kernel early on as you will certainly need it later for debugging.
 
=== Stack Smash Protector ===
{{Main|Stack Smashing Protector}}
 
Early is not too soon to think about security and robustness. You can take advantage of the optional stack smash protector offered by modern compilers that detect stack buffer overruns rather than behaving unexpectedly (or nothing happening, if unlucky).
 
=== Multiboot ===