Bran's Kernel Development Tutorial (need help linking!)
Posted: Tue Jul 24, 2007 9:01 am
I was working through Bran's Kernel Development Tutorial, and as i was doing this i came to the point of putting text on the screen. So, following the tutorial i did what it said and had all the code in files that stuff. When i tried to compile and link the code it said:
C:\djgpp\bin\ld.exe link.ld -o main.o ostest.o scrn.o
main.o is the first object to be linked. When it gets to scrn.o it created the errors seen above. Can anyone tell me what i've done wrong? and btw, what does the linker do anyway (for this)?
according to my linker callLinker wrote: c:/djgpp/bin/ld.exe: section .data [00100400 -> 001013ff] overlaps section .text [00100000 -> 0010072f]
ostest.o(.text+0x2d): undefined reference to `main'
scrn.o(.text+0xef):scrn.c: undefined reference to `memcpy'
scrn.o(.text+0x108):scrn.c: undefined reference to `memsetw'
scrn.o(.text+0x136):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x147):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x156):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x16a):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x1b9):scrn.c: undefined reference to `memcpy'
scrn.o(.text+0x1d2):scrn.c: undefined reference to `memsetw'
scrn.o(.text+0x208):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x219):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x228):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x23c):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x276):scrn.c: undefined reference to `memsetw'
scrn.o(.text+0x2a8):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x2b7):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x2c6):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x2d5):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x30a):scrn.c: undefined reference to `strlen'
scrn.o(.text+0x378):scrn.c: undefined reference to `memsetw'
scrn.o(.text+0x3aa):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x3b9):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x3c8):scrn.c: undefined reference to `outportb'
scrn.o(.text+0x3d7):scrn.c: undefined reference to `outportb'
C:\djgpp\bin\ld.exe link.ld -o main.o ostest.o scrn.o
main.o is the first object to be linked. When it gets to scrn.o it created the errors seen above. Can anyone tell me what i've done wrong? and btw, what does the linker do anyway (for this)?