Kernel don't show anything.
Posted: Sat Jun 15, 2013 7:52 am
I'm trying to run my simple kernel, but qemu doesn't show anything.
kernel.c
boot.asm
link.ld
Makefile
But qemu don't show anything.
Any ideas?
kernel.c
Code: Select all
int kmain(void){
unsigned char *vidmem = (char*) 0xB8000;
vidmem[0] = 65; // 'A'
vidmem[1] = 0x07; //whie text on black screen
}
Code: Select all
[global start]
start:
extern kmain // _kmain caused error
call kmain
cli
hlt
link.ld
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 : {
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data : {
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
Code: Select all
all:
gcc -c kernel.c -o kernel.o
nasm -f aout boot.asm -o boot.o
ld -T link.ld -o kernel.bin boot.o kernel.o
qemu -kernel kernel.bin
Any ideas?