Autor Thema: Compilieren / Linken  (Gelesen 2598 mal)

zacK

  • Beiträge: 216
    • Profil anzeigen
    • http://www.domae.ch
Gespeichert
« am: 17. January 2005, 15:23 »
Hallo Leute,

ich habe das gefühl, dass mein Link / Compile - Script irgendwie nicht stimmt / fehler hat....

könnte das jemand kurz für mich überprüfen?

mein kernel besteh wie bei tj aus drei teilen:
kernel16.asm
kernel32.asm
kernel.c

der kernel lade ich ins ram an die adresse: 0x1000:0

nun meine batchs/scripts zum linken und compilieren:

compile.bat

@ echo off
nasm -f bin -o kernel16.bin kernel16.asm
nasm -f aout -o kernel32.o kernel32.asm
nasm -f aout -o isr.o isr.asm
make all
..\tools\mergekernel kernel.sys kernel16.bin kernelc.bin
del *.o
del *.bin
pause
exit


Makefile

SRC     =       kernel.c video.c pic.c io.c pit.c idt.c system.c fdc.c kbc.c mouse.c

OBJ     =       kernel32.o kernel.o video.o pic.o io.o pit.o idt.o isr.o system.o fdc.o kbc.o mouse.o

LD_OPTIONS=-T linkfile.ld -o kernelc.bin



all: asm c link
asm:

c:
gcc -ffreestanding -fno-builtin -nostdinc -c $(SRC) -I include

link:
ld $(LD_OPTIONS) $(OBJ)



linkfile.ld

OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
  .text 0x10200 : {
    *(.text)
  }
  .data : {
    *(.data)
  }
  .bss :  {
    *(.bss)
  }
}



vielen dank! grunz

 

Einloggen