Having trouble with header fiels
Re: Having trouble with header fiels
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.
Visit the Montrom user page for more info.
-
- Member
- Posts: 47
- Joined: Fri Apr 23, 2010 8:27 am
Re: Having trouble with header fiels
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...
-
- Member
- Posts: 47
- Joined: Fri Apr 23, 2010 8:27 am
Re: Having trouble with header fiels
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
berkus: Yeah, it has always worked fine up until this point
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Having trouble with header fiels
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 inefficiencyHitmanYesman wrote:Common.h is included inside screen.h because screen.c needs common.h So it gets it from screen.h
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
I suggest uploading kernel.bin, maybe the problem will be obvious from looking at it.
-
- Member
- Posts: 47
- Joined: Fri Apr 23, 2010 8:27 am
Re: Having trouble with header fiels
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.
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.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Having trouble with header fiels
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.HitmanYesman wrote:Yeah, the PATH is set correctly to cygwin/bin.
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.
-
- Member
- Posts: 47
- Joined: Fri Apr 23, 2010 8:27 am
Re: Having trouble with header fiels
It does contain cygwin/bin. It also contains usr/cross/bin and some other directories.
- JackScott
- Member
- Posts: 1032
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- GitHub: https://github.com/JackScottAU
- Contact:
Re: Having trouble with header fiels
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)?
-
- Member
- Posts: 47
- Joined: Fri Apr 23, 2010 8:27 am
Re: Having trouble with header fiels
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
$PATH = "/bin:/usr/local/bin:/usr/bin:/bin"
That's what it says...
Thought there was more
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Having trouble with header fiels
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.
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.
-
- Member
- Posts: 47
- Joined: Fri Apr 23, 2010 8:27 am
Re: Having trouble with header fiels
I see where it doesn't add up, but don't understand how that makes the CPU fault...
- JackScott
- Member
- Posts: 1032
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- GitHub: https://github.com/JackScottAU
- Contact:
Re: Having trouble with header fiels
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?
It might be completely unrelated, but how do we know for sure?
Re: Having trouble with header fiels
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.
-
- Member
- Posts: 47
- Joined: Fri Apr 23, 2010 8:27 am
Re: Having trouble with header fiels
How do I fix that? Change the linker script?