heres some code:
Code: Select all
[BITS 32]
extern _sys_entry
global x32
x32:
mov ax, data ; set data segments to data selector (0x10)
mov ds, ax
mov fs, ax
mov es, ax
mov gs, ax
mov esp, 90000h
call _sys_entry
hlt
times 512-($-$$) db 0
Code: Select all
void sys_entry(void)
{
writeLine("Kernel Loaded");
}
i want ld tomake a flat binary without any headers just an normal bin as nasm will ouput..
thanks for any help.
make.bat:
Code: Select all
call nasm source/BOOTZ.asm -f bin -o bin/BOOTZ.bin
call cd bin
call gcc -ffreestanding -fno-builtin -nostdlib -c C:\Users\Mark\Desktop\OS\source\kernel\*.c
call cd..
call nasm -f elf source/CORELD.asm -o bin/CORELD.o
call ld -Ttext 0x1000 -o bin/CORE.bin bin/*.o