I've done like this
http://wiki.osdev.org/Bare_bones
And it keep popping to my face like this
undefined reference to 'kmain' ?
undefined reference to 'kmain' ?
"Programmers are tools for converting caffeine into code."
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: undefined reference to 'kmain' ?
Did you name the function kmain?
I just tested it out here, works perfectly. Did you copy the code exactly?
edit: Damn, duh, that makes sense JamesM. Waste of a post...
-JL
I just tested it out here, works perfectly. Did you copy the code exactly?
edit: Damn, duh, that makes sense JamesM. Waste of a post...
-JL
Last edited by piranha on Fri Nov 28, 2008 11:18 am, edited 1 time in total.
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: undefined reference to 'kmain' ?
Change your compile line to "-fno-leading-underscores" instead of "-fleading-underscores". All C functions will have been compiled with a leading underscore, so to access them properly from asm you would have had to add one there, too, e.g. "global _kmain; call _kmain". The easiest way is to change the flag.
Re: undefined reference to 'kmain' ?
Err, I have cross-compiler. Oh hell no, I called 'gcc', not 'i586-elf-gcc' => is that the problem ?
From 'Same mistakes' - James Blunt
"I wonder where (hooo...)
Did I go wrong?"
From 'Same mistakes' - James Blunt
"I wonder where (hooo...)
Did I go wrong?"
"Programmers are tools for converting caffeine into code."
Re: undefined reference to 'kmain' ?
The problem solved: I should call 'i586-elf-gcc' etc instead of 'gcc'
"Programmers are tools for converting caffeine into code."
Re: undefined reference to 'kmain' ?
Did anyone try: ld -T linker.ld -o kernel.bin kernel.o loader.o
rather than : ld -T linker.ld -o loader.o kernel.o
with this I get the same error
may be it will be useful for someone from Google
rather than : ld -T linker.ld -o loader.o kernel.o
with this I get the same error
may be it will be useful for someone from Google
I will be here quite often !