Problems with grub

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.
Post Reply
MadZarx
Member
Member
Posts: 85
Joined: Mon Apr 01, 2013 5:06 am
Location: CMOS :D

Problems with grub

Post by MadZarx »

Hello everyone. This is my first post in osDev so I'm so sorry if I have asked this in wrong forum.
I have two very simple kernels one is written in C++ and other in Assembly and the images are ready but I don't have time to learn how to build a bootloader so I decided to use an existing one, like GRUB.
I have downloaded the lastest version but I can't find any bootloader binary files to put it in the bootsector. I thought that I should build it myself but I don't know how.
Can someone tell me how can I boot one of my kernels from GRUB? :D :D
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Problems with grub

Post by Mikemk »

Firstly, there are tutorials throughout the wiki.
That aside, you never specified which version of grub...
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
MadZarx
Member
Member
Posts: 85
Joined: Mon Apr 01, 2013 5:06 am
Location: CMOS :D

Re: Problems with grub

Post by MadZarx »

I know but that's all about the structure of grub (I think :mrgreen: ) I couldn't see anything about compiling in Table of contents. :oops:
Btw can I build it in windows??
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Problems with grub

Post by Mikemk »

MadZarx wrote:I couldn't see anything about compiling in Table of contents. :oops:
Do you mean the menu? That's built at boot time based on config files on the hard drive.
Btw can I build it in windows??
Not very likely. I had to switch to linux because most this stuff can't be done in windows. I actually like it better (faster, more stable, free, less buearocratic...)
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
MadZarx
Member
Member
Posts: 85
Joined: Mon Apr 01, 2013 5:06 am
Location: CMOS :D

Re: Problems with grub

Post by MadZarx »

Oh too bad cuz my old PC is too slow for any linux distro with desktop environments. I've even tried lxde but its not as fast as windows for me :cry:
Btw is there any other bootloaders except GRUB? can they boot any images?
osdog
Posts: 19
Joined: Wed May 01, 2013 2:59 am

Re: Problems with grub

Post by osdog »

MadZarx wrote:Oh too bad cuz my old PC is too slow for any linux distro with desktop environments. I've even tried lxde but its not as fast as windows for me :cry:
Btw is there any other bootloaders except GRUB? can they boot any images?
How old is your PC?! I was running Ubuntu 10.04. Desktop (with GNOME) recently on a P II 233 MHz and it ran without hiccups. Granted I wouldn't want to compile anything on it but it will be capable of running "sudo grub-install --root-directory=/media/$name /dev/sdx"

Anyway if you have an up to date Windows machine you can just grab VirtualBox and install a Debian or Ubuntu in it.
Actually the Ubuntu Live CD comes with a VM built in so you can install it within Windows. Though I've never tried that.

Lastly I also recommend using Linux or another *nix variant for Kernel and OS development because it comes with all the tools and is way more friendly to this kind of activity while Windows is very locked down in that regard.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Problems with grub

Post by jnc100 »

If you want to stick with Windows, then Cygwin includes a 'grub' package. Simply install that and then you can use 'grub-mkrescue --output=image.iso <dir>' to create a bootable iso image. Put your kernel somewhere underneath <dir> and a valid grub.cfg in <dir>/boot/grub first.

Regards,
John.
MadZarx
Member
Member
Posts: 85
Joined: Mon Apr 01, 2013 5:06 am
Location: CMOS :D

Re: Problems with grub

Post by MadZarx »

osdog wrote:
MadZarx wrote:Oh too bad cuz my old PC is too slow for any linux distro with desktop environments. I've even tried lxde but its not as fast as windows for me :cry:
Btw is there any other bootloaders except GRUB? can they boot any images?
How old is your PC?! I was running Ubuntu 10.04. Desktop (with GNOME) recently on a P II 233 MHz and it ran without hiccups. Granted I wouldn't want to compile anything on it but it will be capable of running "sudo grub-install --root-directory=/media/$name /dev/sdx"
My PC has an Intel pentium 4 Single core and clocked at 2.8GHz and a DDR 1GiB memory with a 128MiB VGA card but it lags when I want to run any linux distro. It's not as fast as Windows XP. My PC can't even run windows 8 :shock: !!

Anyway I can use linux shell for my development.
Thanks for your help :D :D
jnc100 wrote:If you want to stick with Windows, then Cygwin includes a 'grub' package. Simply install that and then you can use 'grub-mkrescue --output=image.iso <dir>' to create a bootable iso image. Put your kernel somewhere underneath <dir> and a valid grub.cfg in <dir>/boot/grub first.

Regards,
John.
Thank you too John :D :D
Rhoin
Posts: 1
Joined: Mon Jan 28, 2013 9:00 am

Re: Problems with grub

Post by Rhoin »

MadZarx wrote:
osdog wrote:
MadZarx wrote:Oh too bad cuz my old PC is too slow for any linux distro with desktop environments. I've even tried lxde but its not as fast as windows for me :cry:
Btw is there any other bootloaders except GRUB? can they boot any images?
How old is your PC?! I was running Ubuntu 10.04. Desktop (with GNOME) recently on a P II 233 MHz and it ran without hiccups. Granted I wouldn't want to compile anything on it but it will be capable of running "sudo grub-install --root-directory=/media/$name /dev/sdx"
My PC has an Intel pentium 4 Single core and clocked at 2.8GHz and a DDR 1GiB memory with a 128MiB VGA card but it lags when I want to run any linux distro. It's not as fast as Windows XP. My PC can't even run windows 8 :shock: !!

Anyway I can use linux shell for my development.
Thanks for your help :D :D


You can use lightweight distros like Lubuntu, Crunch Bang..etc(if you want of course).I have a test machine with nearly same specs.Even Ubuntu's Unity works with some lag.
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Problems with grub

Post by iansjack »

GRUB is OS agnostic. It's nothing to do with Windows, Linux, BSD, or any other OS. It lets you boot any of these OSs. I despair at the level of knowledge demonstrated on this site recently.

http://sourceforge.net/projects/grub4dos/
osdog
Posts: 19
Joined: Wed May 01, 2013 2:59 am

Re: Problems with grub

Post by osdog »

iansjack wrote:http://sourceforge.net/projects/grub4dos/
Great. Now the OP can try if this DOS port of GRUB works on his Windows machine.

Also it is very unfortunate that I first had to aggravate you, with my lack of knowledge about which platforms the GNU GRUB user land configuration tools have been ported to by which project, before you came forward with your knowledge.
I think the OP will really appreciate your help!
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Problems with grub

Post by iansjack »

That's OK. :)
MadZarx
Member
Member
Posts: 85
Joined: Mon Apr 01, 2013 5:06 am
Location: CMOS :D

Re: Problems with grub

Post by MadZarx »

Rhoin wrote: You can use lightweight distros like Lubuntu, Crunch Bang..etc(if you want of course).I have a test machine with nearly same specs.Even Ubuntu's Unity works with some lag.
Okay I will give these distros a try but I think ubuntu lags for me.
Thanks guys I didn't know that I should build grub and other important things only in nix OSs I thought that windows is poweful enough to be able to do these all but now I see windows is only good for gamming!!
Thank you guys for your help. My problem only was with a bootloader and now I got it : D

Sorry for my bad English
MadZarx
Member
Member
Posts: 85
Joined: Mon Apr 01, 2013 5:06 am
Location: CMOS :D

Re: Problems with grub

Post by MadZarx »

Rhoin wrote: You can use lightweight distros like Lubuntu, Crunch Bang..etc(if you want of course).I have a test machine with nearly same specs.
Thanks man I have downloaded and installed #! (crunchbang). Its the fastest OS I have ever used. It feets my PC and my needs. Today I have built grub for my kernel images and it worked well. Thanks Rhoin :D :D :D 8)
Post Reply