Betamoo
Betamoo

Reputation: 15860

Writing an OS kernel in assembly with NASM

I want to know what is the standard way for writing a -simple- kernel to be compiled on NASM?

To get it clearer: I was able to define the code block with all the following ways:

[segment code]
[segment .code]
segment code
segment .code

[section code]
[section .code]
section code
section .code

I need to know what is the standard way to do that, And what is the difference between them...

Thanks

Upvotes: 1

Views: 2551

Answers (1)

anonymous
anonymous

Reputation: 31

Your question is answer in the NASM documentation, as stated above.

The truth is.. the sections do not mean verymuch when you load your code. A kernel to be loaded, needs a complete bootloader, and a bootloader has 512b to load GDTr, , enabling A20, entering protected mode, and jumping to _kmain. Checkout OSDev.org for more examples, and information.

Upvotes: 3

Related Questions