That... is painful. There's nothing wrong with my tools. I used the same tools for my previous OS. I changed things around and it still works. Bad voodoo. Well either way it's solved, although we didn't get the cause, which I would like to.Combuster wrote:Can't reproduce error. I took the build script, created the missing directories, replaced the harcoded paths to gcc and ld (not good), and replaced qemu with qemu-system-i386. Kernel got started without error but wasn't particularly interesting.
In other words: Go fix your tools.
I used the following tool from my system. Make sure your versions are at least that.
Binutils 2.18
GCC 4.1.2
mkisofs 3.00
qemu 1.0-r3
GRUB Error 25
Re: GRUB Error 25
[nx] kernel: http://github.com/zhiayang/nx
- Kazinsal
- Member
- Posts: 559
- Joined: Wed Jul 13, 2011 7:38 pm
- Libera.chat IRC: Kazinsal
- Location: Vancouver
- Contact:
Re: GRUB Error 25
That doesn't mean you've fixed it. That just means that something happened to stop the bug from occurring. It could resurface at any time down the road, and when it does, you won't have any idea where it is.requimrar wrote:I changed things around and it still works. Bad voodoo. Well either way it's solved, although we didn't get the cause, which I would like to.
I suggest you un-"fix" it, build yourself a brand new set of tools (because, as Combuster says, they're likely broken), and try again. That way, if it fixes it, you've learned a valuable lesson.
Re: GRUB Error 25
Bah. I built the cross compiler from scratch, following the wiki page. I had to change some things; I had to direct CC and stuff to the llvm compiler...Blacklight wrote:That doesn't mean you've fixed it. That just means that something happened to stop the bug from occurring. It could resurface at any time down the road, and when it does, you won't have any idea where it is.requimrar wrote:I changed things around and it still works. Bad voodoo. Well either way it's solved, although we didn't get the cause, which I would like to.
I suggest you un-"fix" it, build yourself a brand new set of tools (because, as Combuster says, they're likely broken), and try again. That way, if it fixes it, you've learned a valuable lesson.
Nope. Used GCC 4.7.1 and binutils 2.22. Took a long time, but still, same error.
[nx] kernel: http://github.com/zhiayang/nx
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: GRUB Error 25
I had to change some things
What exactly did you change?build yourself a brand new set of tools (because, as Combuster says, they're likely broken).
-JL
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: GRUB Error 25
The wiki says not to use the llvm compiler, but all the gcc-4.2 compilers were just aliases to the llvm compiler. so i pointed CC and CPP and CXX and LD to the llvm ones.piranha wrote:I had to change some thingsWhat exactly did you change?build yourself a brand new set of tools (because, as Combuster says, they're likely broken).
-JL
[nx] kernel: http://github.com/zhiayang/nx
Re: GRUB Error 25
Please be precise: Are you saying that the following part of the Wiki does not indeed work on a Mac?requimrar wrote:The wiki says not to use the llvm compiler, but all the gcc-4.2 compilers were just aliases to the llvm compiler.
GCC Cross-Compiler wrote:MacOS users, beware
The makefiles of binutils and GCC use the `$(CC)` variable to invoke the compiler. On MacOS, this resolves to `gcc` by default, which is actually not the "real thing", but `llvm-gcc`. That wouldn't be so bad, but `llvm-gcc` is not able to compile the GCC sources into a functional binary. (Bugs have been reported, but that doesn't help you here and now.)
MacOS does have a "real" GCC installed, too. You just have to tell `make` to use it instead of `llvm-gcc`:
Code: Select all
# This is only necessary for MacOS users. export CC=/usr/bin/gcc-4.2 export CXX=/usr/bin/g++-4.2 export CPP=/usr/bin/cpp-4.2 export LD=/usr/bin/gcc-4.2
Every good solution is obvious once you've found it.
Re: GRUB Error 25
But... it functions! It does, seriously. I used the llvm compiler in all 4 export's and yes, it does compile.Solar wrote:Please be precise: Are you saying that the following part of the Wiki does not indeed work on a Mac?requimrar wrote:The wiki says not to use the llvm compiler, but all the gcc-4.2 compilers were just aliases to the llvm compiler.
GCC Cross-Compiler wrote:MacOS users, beware
The makefiles of binutils and GCC use the `$(CC)` variable to invoke the compiler. On MacOS, this resolves to `gcc` by default, which is actually not the "real thing", but `llvm-gcc`. That wouldn't be so bad, but `llvm-gcc` is not able to compile the GCC sources into a functional binary. (Bugs have been reported, but that doesn't help you here and now.)
MacOS does have a "real" GCC installed, too. You just have to tell `make` to use it instead of `llvm-gcc`:
Code: Select all
# This is only necessary for MacOS users. export CC=/usr/bin/gcc-4.2 export CXX=/usr/bin/g++-4.2 export CPP=/usr/bin/cpp-4.2 export LD=/usr/bin/gcc-4.2
[nx] kernel: http://github.com/zhiayang/nx
Re: GRUB Error 25
That was never in doubt. The tutorial says:requimrar wrote:I used the llvm compiler in all 4 export's and yes, it does compile.
So either you have a non-functional GCC binary (i.e., compiling it worked allright, but the GCC binary you got won't work correctly, if at all). Or llvm resolved the bugs. In the former case, you are working from flawed assumptions, in the latter case our Wiki needs updating. Either way, another round of testing your assumptions is in order.GCC Cross-Compiler wrote:[...] `llvm-gcc` is not able to compile the GCC sources into a functional binary. (Bugs have been reported, but that doesn't help you here and now.)
Every good solution is obvious once you've found it.
Re: GRUB Error 25
Thank you.Solar wrote:That was never in doubt. The tutorial says:requimrar wrote:I used the llvm compiler in all 4 export's and yes, it does compile.
So either you have a non-functional GCC binary (i.e., compiling it worked allright, but the GCC binary you got won't work correctly, if at all). Or llvm resolved the bugs. In the former case, you are working from flawed assumptions, in the latter case our Wiki needs updating. Either way, another round of testing your assumptions is in order.GCC Cross-Compiler wrote:[...] `llvm-gcc` is not able to compile the GCC sources into a functional binary. (Bugs have been reported, but that doesn't help you here and now.)
Just in case you want to replicate my setup, I have Xcode 4.3.3 and used GCC 4.7.1 and binutils 2.22. Also OSX 10.7.4.
[nx] kernel: http://github.com/zhiayang/nx
Re: GRUB Error 25
Can't. I have several x86, one x86_64, one VIA WM8505 ARM926, and hopefully soon a Raspberry Pi, but no Mac.requimrar wrote:Just in case you want to replicate my setup...
Every good solution is obvious once you've found it.
Re: GRUB Error 25
Oh. A quick search for gcc yields a bunch of aliases that all point to a folder:berkus wrote:You might be lying about gcc-4.2 being llvm-gcc though:requimrar wrote:I used the llvm compiler in all 4 export's and yes, it does compile.
What's on yours?Code: Select all
$ /usr/bin/gcc-4.2 --version i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Code: Select all
/usr/llvm-gcc-4.2/bin/
It would appear that I do not have a non-llvm compiler on my system.
running -v on the darwin11 llvm gcc yields:
Code: Select all
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
[nx] kernel: http://github.com/zhiayang/nx
Re: GRUB Error 25
Hehe... bump?
On a serious note. It seems I cannot get away with this for long.
I don't know how to do a complete code rewrite when you can't start from scratch... so my first step was to fix dependencies and only compile the core files.
It however, turns out that... I get error 8 and 25 again.
This is the interesting part: When I link the memory management files, (aka heap.c, paging.c, kmalloc.c and ordered_list.c [from JamesM tutorial V1), it works. Fine and dandy.
All I did in there was some formatting changes and name changes. Other than that, it's a complete rip-off of the tutorial (sorry...)
What gives? I cannot identify, within my limited identification skills, any code that the rest of the kernel would not work without... There's no linking errors or anything, no compilation errors... nothing. It works, then it doesn't.
If someone has the time... and is using OSX (I think berkus?) I don't think that it's the tools that are causing it, but just to make sure, can someone else test them for me? I only have one machine. :/
On a serious note. It seems I cannot get away with this for long.
I don't know how to do a complete code rewrite when you can't start from scratch... so my first step was to fix dependencies and only compile the core files.
It however, turns out that... I get error 8 and 25 again.
This is the interesting part: When I link the memory management files, (aka heap.c, paging.c, kmalloc.c and ordered_list.c [from JamesM tutorial V1), it works. Fine and dandy.
All I did in there was some formatting changes and name changes. Other than that, it's a complete rip-off of the tutorial (sorry...)
What gives? I cannot identify, within my limited identification skills, any code that the rest of the kernel would not work without... There's no linking errors or anything, no compilation errors... nothing. It works, then it doesn't.
If someone has the time... and is using OSX (I think berkus?) I don't think that it's the tools that are causing it, but just to make sure, can someone else test them for me? I only have one machine. :/
[nx] kernel: http://github.com/zhiayang/nx
- Kazinsal
- Member
- Posts: 559
- Joined: Wed Jul 13, 2011 7:38 pm
- Libera.chat IRC: Kazinsal
- Location: Vancouver
- Contact:
Re: GRUB Error 25
I haven't seen any of his posts (or PMs or his forum profile -- I think you get the point) lately. Good luck getting a hold of him.requimrar wrote:If someone has the time... and is using OSX (I think berkus?)
Fire up a VM running Ubuntu and try building on there. If it works, it's your tools. If it doesn't, it's your code.I don't think that it's the tools that are causing it, but just to make sure, can someone else test them for me? I only have one machine. :/
Ten bucks says it's the tools.
Re: GRUB Error 25
I'm broke, sorry. :/Blacklight wrote: Fire up a VM running Ubuntu and try building on there. If it works, it's your tools. If it doesn't, it's your code.
Ten bucks says it's the tools.
Code: Select all
Why do we need one?
Creating a dedicated (cross-)compiler for your OS development work can save you many headaches. If
...
... your bootloader stubbornly insists that it can't read your kernel binary...
Code: Select all
TARGET=i586-elf
Also when I want to switch to a long mode (64-bit) OS, is
Code: Select all
TARGET=x86_64-elf
You can't actually do the latter on a 32-bit system, can you?
[nx] kernel: http://github.com/zhiayang/nx
- 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: GRUB Error 25
On what machine was the first 64-bit compiler built?requimrar wrote:You can't actually do the latter on a 32-bit system, can you?
I tested your configuration on a non-mac machine earlier and it worked for me. So obviously your mac binaries are not doing what they should, and I'm getting rather annoyed trying to get that point across.I don't think that it's the tools that are causing it, but just to make sure, can someone else test them for me? I only have one machine. :/