GRUB on my USB flash drive

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
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

GRUB on my USB flash drive

Post by Lprogster »

...

Thanks everyone,
Lprogster
Last edited by Lprogster on Tue Oct 23, 2007 11:27 am, edited 1 time in total.
User avatar
Walling
Member
Member
Posts: 158
Joined: Mon Dec 04, 2006 6:06 am
Location: Berlin, Germany

Post by Walling »

Here is an article on setting up GRUB on a flash disc: http://www.freesoftwaremagazine.com/articles/grub_intro However you need a running GRUB to install it on another device.

Maybe you could setup a bootable CD-ROM (do you have CD-RW-ROM in your computer?) with GRUB? This might provide some information: http://www.gnu.org/software/grub/manual ... D-ROM.html
As you see they use a tool called 'mkisofs'. It can be downloaded for Windows: http://smithii.com/files/cdrtools-latest.zip When you have created an .iso file just burn a CD using your favorite burn program. Boot on the CD. You now have a GRUB shell. Then read the flash disc article.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

...

Thankyou,
Lprogster
Last edited by Lprogster on Tue Oct 23, 2007 11:27 am, edited 1 time in total.
User avatar
Walling
Member
Member
Posts: 158
Joined: Mon Dec 04, 2006 6:06 am
Location: Berlin, Germany

Post by Walling »

Maybe WinGRUB can help you? http://grub4dos.sourceforge.net/

AFAIK it is best to run GRUB natively (not in an operating system) when installing it to another device. Natively it accesses devices using BIOS interrupts, so your BIOS have to support transparent read-write access to flash discs. But if it doesn't do that you wouldn't be able to boot your flash disc either.

When running GRUB in an operating system (maybe it only runs on *nix) it uses OS system calls to access devices. But the OS might have drivers for devices, which the BIOS cannot access, and possibly the other way around as well. Correct me if I'm wrong.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

...

Thanks,
Lprogster
Last edited by Lprogster on Tue Oct 23, 2007 11:27 am, edited 1 time in total.
User avatar
Walling
Member
Member
Posts: 158
Joined: Mon Dec 04, 2006 6:06 am
Location: Berlin, Germany

Post by Walling »

Lprogster wrote:Trying WinGRUB...

What root would be the USB drive?

Code: Select all

title My Little OS
root ???
In the article http://www.freesoftwaremagazine.com/articles/grub_intro he is using (hd2,0) to setup GRUB, but I don't know about the root used in the menu.lst file. Try to read it.

As a start you could place your kernel image on the flash disc and try to boot it using the GRUB shell, ex.

Code: Select all

root (hd2,0)
kernel /kernel.bin
boot
GRUB will tell you if (hd2,0) is wrong. Then try with hd1, hd3, etc.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

I must be really nooby - something is wrong, still not booting!

Im gonna leave it for tonight, ty for your help,
Lprogster
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

First do you want to use GRUB, or is it just away of loading your bin file ?.
If you want to use GRUB, then you do not need to read the rest.

But if it just away of loading your OS, i am going to make a bootloader ver of my OS, which can load from many devices including USB fobs, let me know if you interested.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

Ive just managed to get it to work... Wow, lotta work!

Thanks for the everything, but Im fine now :D!

Thanks,
Lprogster
TheQuux
Member
Member
Posts: 73
Joined: Sun Oct 22, 2006 6:49 pm

Post by TheQuux »

How? If you post your solution, others will b able to benifit as well.
My project: Xenon
Post Reply