Page 1 of 2

problem with bootloaders

Posted: Sun Sep 28, 2003 2:57 pm
by petasaurius
I had a working bootloader, but recently I discovered it just worked in Bochs :/
So, I went out and hunting bootloaders :)
I found one that seemed to work and my kernel could print out characters to the screen when loaded with that bootloader.
But then I added a line like this to the kernel:
char strOut[256] = "Welcome!";
and everything paniced.

This is how I compiled the kernel:
gcc -nostartfiles -nostdlib -fno-builtin -fwritable-strings -c test.c
ld -o test -Ttext 0x8000 -e main test.o

(test.c is the kernel)

PS: I don't use GRUB because it's too complicated for me ;)

Re:problem with bootloaders

Posted: Mon Sep 29, 2003 12:31 am
by Solar
petasaurius wrote: But then I added a line like this to the kernel:
char strOut[256] = "Welcome!";
and everything paniced.
Sounds very much like this thread... but seeing that you already included -fwritable-strings...

A good rule for debugging is finding the smallest thing that reproduces the error. Strip down your kernel to the barest necessities still coming up with the error. Quite often the search for the minimal reason already solves the problem; if not, post that minimal source so others can have a look at it.
PS: I don't use GRUB because it's too complicated for me ;)
Erm... you're kidding, right? ;-) Check out this tutorial page, sections "Installing GRUB" and "Configuring GRUB"; that's written by me after reading the manuals and trying for five minutes or so... believe me, it's worth it. ;-)

Re:problem with bootloaders

Posted: Mon Sep 29, 2003 4:07 am
by Pype.Clicker
surprisingly enough, i don't see any "-oformat binary" statement. What kind of output format do you use ?
Is your bootloader able to deal with a kernel that has both ".text" and ".data" section ?

Re:problem with bootloaders

Posted: Mon Sep 29, 2003 6:50 am
by petasaurius
I can't compile GRUB, I'm running WinXP, where can I get the stage1 and stage2 files?

// pype: links to GNU ftp available on Solar's tutorial seems broken, indeed

Re:problem with bootloaders

Posted: Mon Sep 29, 2003 7:41 am
by Solar
He, funny. NOT.

The GNU Grub people have a) moved the download page, which in itself isn't bad, and b) removed the precompiled ready-to-install binaries, which - excuse the rant - just fits the overall GNU picture.

I'll provide readily compiled images for download from above tutorial location ASAP.

Re:problem with bootloaders

Posted: Mon Sep 29, 2003 3:58 pm
by df
i had a full cygwin install and could never compile grub. it always complained about something missing in LD (even tho ld was recompiled with all formats and every ooption under the sun...)

had no troubles under freebsd tho :)

Re:problem with bootloaders

Posted: Mon Sep 29, 2003 5:36 pm
by Tim
Until the GRUB people fix their broken build process, which is alienating a large portion of their potential users, the only options I see are:
1. Get a friendly Linux or BSD user to compile GRUB for you
2. Use a Sourceforge compile farm account (though I could never get this working under Windows either)
3. Run Linux or BSD under Bochs or equivalent

Grr, rant, etc.

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 12:50 am
by distantvoices
or you make a grub clone from an existing linux installation which uses grub as boot loader. This way, I got a grub boot disk with ext2 file system.

Have to dig around to find how I've done it for posting it here. This also saves the hassle of ... seldom weird - not to say queer - compiler errors.

But for convenience, I'll also place an empty grub boot disk image on my web site.

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 1:52 am
by Solar
I think I have the 0.93 ready-to-use built of GRUB somewhere on my hard drive. If I find it, I'll provide it for download.

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 2:02 am
by BI lazy
thats a good thing. spreading grub. ;-)

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 3:04 am
by Pype.Clicker
<comment> the embedded discussion about Software Patent in Europe has now been moved into its own thread
</comment>

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 5:43 am
by Tim
The stumbling block I've reached is getting a copy of GRUB with RTL8139 drivers built in. Some guy (I think it was Chris Fallin) kindly built GRUBs with NE2000 and DEC drivers built in.

Maybe we need some kind Linux user to build every possible GRUB image (or at least the common ones) and host a repository for OS developers?

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 6:11 am
by Solar
Tim Robinson wrote: Maybe we need some kind Linux user to build every possible GRUB image (or at least the common ones) and host a repository for OS developers?
How about kicking those {beeep} GNU {beeep} into their {beeep} and make them come down from their {beeep} attitude that anyone willing to use their {beeep} software has the {beeep} time to dig through their {beeep} docs if they {beeep} exist at all, to get a {beeep} binary they very {beeep}ing well could create on their {beeep} own in no time.

{beeep} {beeep}

(Looks like this board has a profanity filter after all... ;-) )

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 6:23 am
by Perica
..

Re:problem with bootloaders

Posted: Tue Sep 30, 2003 6:41 am
by BI lazy
Oh how nice it is to read the words hidden by camouflage... *rofl*

@solar: I've never even dared to imagine that you with your fine language 'd ever thought about using 4-letter words (oh yesss my preciousss it's tricksy it's verrrry tricksy...), oh how embarassed 'thou' i am ... *bg*

regarding grub ... Am I missing there something? They do not distribute binaries for test use anymore but require us to build binaries from ... but so well documented ... sources? Oh sweet gosh a'mighty, they shall hurry up building some.

stay safe ...