problem with bootloaders

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
petasaurius

problem with bootloaders

Post 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 ;)
User avatar
Solar
Member
Member
Posts: 7632
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:problem with bootloaders

Post 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. ;-)
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:problem with bootloaders

Post 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 ?
petasaurius

Re:problem with bootloaders

Post 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
User avatar
Solar
Member
Member
Posts: 7632
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:problem with bootloaders

Post 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.
Every good solution is obvious once you've found it.
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:problem with bootloaders

Post 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 :)
-- Stu --
Tim

Re:problem with bootloaders

Post 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.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:problem with bootloaders

Post 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.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Solar
Member
Member
Posts: 7632
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:problem with bootloaders

Post 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.
Every good solution is obvious once you've found it.
BI lazy

Re:problem with bootloaders

Post by BI lazy »

thats a good thing. spreading grub. ;-)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:problem with bootloaders

Post by Pype.Clicker »

<comment> the embedded discussion about Software Patent in Europe has now been moved into its own thread
</comment>
Tim

Re:problem with bootloaders

Post 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?
User avatar
Solar
Member
Member
Posts: 7632
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:problem with bootloaders

Post 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... ;-) )
Every good solution is obvious once you've found it.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:problem with bootloaders

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 9:19 pm, edited 1 time in total.
BI lazy

Re:problem with bootloaders

Post 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 ...
Post Reply