Page 2 of 2

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 5:33 am
by montrom
My fault. I thought once you switched over to i586-elf-gcc that you started getting compiler errors. I guess I better leave this one to someone who is actually writing an elf kernel. I use coff, sorry. In parting, I suppose I could leave you this: http://sourceware.org/binutils/docs-2.19/as/Type.html -- it might help.

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 5:51 am
by HitmanYesman
Oh, I wasn't trying it with the i586-elf-gcc. I tried again, and now I have the junk at the end of the file thing...

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 2:50 pm
by HitmanYesman
Common.h is included inside screen.h because screen.c needs common.h So it gets it from screen.h.

berkus: Yeah, it has always worked fine up until this point

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 2:54 pm
by Combuster
HitmanYesman wrote:Common.h is included inside screen.h because screen.c needs common.h So it gets it from screen.h
So everything that needs screen.h gets the pointless payload of common.h even if some other file doesn't need it? For the record, I blame you for the world's inefficiency :wink:

Have you checked that the includes are the ones you wrote, and not something from /usr/include? (you are not using a crosscompiler, for one thing). Also, have you checked the PATH variable before using the cross-compiler?

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 3:29 pm
by Gigasoft
I suggest uploading kernel.bin, maybe the problem will be obvious from looking at it.

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 4:13 pm
by HitmanYesman
Combuster: Oh no, I'm not saying that. I meant that every header file for each object file will include common.h. Must have misunderstood what a cross-compiler is. Yeah, the PATH is set correctly to cygwin/bin.

As for the files. Here's floppy.img and kernel.bin: http://www.mediafire.com/?sharekey=87a5 ... d2eb488dac

I'm sure I'm missing something obvious.

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 4:34 pm
by Combuster
HitmanYesman wrote:Yeah, the PATH is set correctly to cygwin/bin.
I bet 50 invisible tokens that that PATH does not contain cygwin/bin, and another 50 that it does not contain only that. Please be accurate when you claim something.
Which brings us to the original point, have you read the tutorial PROPERLY before using the cross-compiler? it includes instructions for the PATH variable as well.

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 4:42 pm
by HitmanYesman
It does contain cygwin/bin. It also contains usr/cross/bin and some other directories.

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 4:52 pm
by JackScott
It might be helpful at this stage if we determine a few things for certain. Could you please post your complete $PATH variable, and whether or not you've built a cross-compiler (and if so, what $TARGET it is for)?

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 5:05 pm
by HitmanYesman
Yes, I've built a cross-compiler. $TARGET = i586-elf .

$PATH = "/bin:/usr/local/bin:/usr/bin:/bin"

That's what it says...
Thought there was more

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 5:15 pm
by Combuster
You failed your polygraph test.

I suggest that you go back and read what you said. They don't add up. I hope that when you realize that, you see the conclusion.

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 5:29 pm
by HitmanYesman
I see where it doesn't add up, but don't understand how that makes the CPU fault...

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 5:32 pm
by JackScott
The earth is turtles all the way down, and one of your turtles is broken. Put another way, you can't build a castle on a foundation of quicksand.

It might be completely unrelated, but how do we know for sure?

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 7:04 pm
by Gigasoft
Looks like an incorrect relocation has been applied to the call _cls instruction. Either the addend was 6 instead of -5, or the linker neglected to subtract the r_offset field. Somehow, the call to _kmain was relocated correctly.

Re: Having trouble with header fiels

Posted: Sun May 23, 2010 8:12 pm
by HitmanYesman
How do I fix that? Change the linker script?