[NASM] Execute ELF kernel
Posted: Mon Apr 27, 2009 6:59 am
I am writing bootloader with NASM and the last step which remains is to execute kernel.
I have written kernel with C, compiled with:
Then linked with:
link.ld:
The kernel is loaded at 1MB in RAM. I don't know how to execute the kernel and I am asking to help me. I have red ELF documentation, but haven't understand it enough to execute my kernel.
Sorry for poor English, I am not native speaker of English.
I have written kernel with C, compiled with:
Code: Select all
gcc -c filename.c -nostdlib -nostdinc -fno-builtin -fno-stack-protector
Code: Select all
ld -T link.ld filename.o -o kernel
Code: Select all
ENTRY(main)
SECTIONS
{
.text 0x100000 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data :
{
data = .; _data = .; __data = .;
*(.data)
*(.rodata)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
Sorry for poor English, I am not native speaker of English.