i made a GRUB image without a floppy ...

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
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

i made a GRUB image without a floppy ...

Post by Pype.Clicker »

for all who wonder how they will OS'dev on their floppyless laptop/imac/pda/whatever, here is *one* solution ...

1. have GRUB tools installed on your host system (this should come with /usr/sbin/grub and the stage1, stage2, etc. files ... )
I had my own stage1, etc. files from an archive named grub-0.92-i386-pc.tar.gz

2. create an empty file of 1.44MB with

Code: Select all

head --bytes=1474560 /dev/zero > grubfd.img
mkdir looppoint
3. become super-user and

Code: Select all

mke2fs grubfd.img
mount grubfd.img looppoint/ -o loop -t ext2
4. create looppoint/boot/grub and copy all the files under your reference /boot/grub there ...

5. umount the looppoint
6. create a 'fake-device.map' file in which you will tell

Code: Select all

(fd0) /dev/loop3
7. invoke '/usr/sbin/grub --device-map=fake-device.map'
8. once in the GRUB shell, issue the following commands:

Code: Select all

device (fd0) grubfd.img
root (fd0)
setup (fd0)
quit
and voil?! your grubfd.img should now be bootable under bochs or any other PC emulator ;)

let me know if it works for you ...
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:i made a GRUB image without a floppy ...

Post by df »

im writing up a tut for the wiki faq on using images on windows/linux/freebsd/macosx.
-- Stu --
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:i made a GRUB image without a floppy ...

Post by Solar »

In the meantime, you might want to point your browser at http://www.pro-pos.org/downloads/grub_disk.zip and download a disk image with GRUB preinstalled. ;-)

I'll try to keep that link updated whenever new GRUB releases appear; currently it's 0.94.
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:i made a GRUB image without a floppy ...

Post by df »

preliminary image thing is up... am busy but it needs expanding..
scroll down the bottom....

http://www.osdev.org/osfaq2/index.php/HomePage
-- Stu --
drizzt

Re:i made a GRUB image without a floppy ...

Post by drizzt »

I use this bash script to create a floppy image with GRUB.

To use this script you need the MTOOLS package and if you allow a user to execute GRUB shell you can create the floppy image without become super-user...

NOTE: first of all you have to configure the GRUB directory (where are the files stage1, stage2 and menu.lst) into the script.



[attachment deleted by admin]
Post Reply