flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Problem with c-kernel.

Author
Thread Post new topic Reply to topic
Nyrre



Joined: 26 Feb 2006
Posts: 13
Nyrre
Hi. I read a tutorial from this page: http://www.osdever.net/tutorials/brunmar/tutorial_03.php. It contained valuable information, if you would like to program your kernel with c.
After reading it, I downloaded .zip that contained sourcefiles and I tried to compile those files and this error showed up:

Code:
Compiling command:
ld -e _main -Ttext 0x1000 -o kernel.o main.o video.o ports.o
Error:
main.o(.text+0x21):main.c: undefined reference to '_alloca'
main.o(.text+0x26):main.c: undefined reference to '__main'
    


Any idea what this means?
Post 19 Mar 2006, 14:07
View user's profile Send private message Reply with quote
j.vimal



Joined: 19 Mar 2006
Posts: 4
j.vimal
That simply means that the external referenced function __alloca and __main are not found in the file that occur 'before' it.

Try putting the .o files in the order of priority, the highest first. Like:

ld -Ttext 0x1000 ports.o video.o main.o -o kernel.o
And of course to define the entry function as _main.

I would suggest you make an assembly wrapper for your code... Thats what I did, and it worked fine Smile

About _alloca, have you defined it anywhere in your header files? If it is in video.o, then this should work fine.
Post 21 Mar 2006, 06:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.