gcc / ld problem
Posted: Fri Jan 31, 2003 12:20 pm
hi, i used tcc to compile, so far, but the compiler's support of c is unsufficent, so i wanted to settle to gcc, but when i link i get file sizes above 4k, for a hang kernel
the files:
asmsystem.asm
system.c
compile.bat
cu, thanks beforehand
the files:
asmsystem.asm
Code: Select all
; PROG.ASM
bits 16
EXTERN _kernel_main
SEGMENT START
mov ax, cs
mov ds, ax
mov es, ax
call _kernel_main
hang:
jmp hang
Code: Select all
void kernel_main (void) {
}
Code: Select all
@echo off
echo.
echo nasm:
bin\nasmw -f elf -o system.o asmsystem.asm
echo done
echo.
echo gcc:
bin\gcc -c -m32 -o system2.o system.c
echo done
echo.
echo ld:
bin\ld -o kernel -Ttext 0x0 -e 0x0 system.o system2.o
echo done
echo.
echo objcopy:
bin\objcopy -R .note -R .comment -S -O binary kernel system.sys
echo done
echo.
echo disasemble kernel:
bin\objdump --disassemble-all kernel >disasm.txt
echo done
echo.
pause