LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-09-2006, 04:06 PM   #1
d1s4st3r
Member
 
Registered: May 2004
Location: Italy
Posts: 70

Rep: Reputation: 16
Problem with booting a self-made floppy distro


Hi everyone,
I just tried to make my very own first distro (mainly following this guide: http://www.creo.hu/~csaba/lowlife/).
I made it entirely in a chrooted environment (to prevent any kind of trouble ), and I use Debian GNU/Linux.
Now, the floppy image is ready and I tried to run it with QEmu, but I got the following problems:
QEmu says that "direct booting from floppy is no longer supported. Please use a boot loader program instead.". That's ok because my floppy image ("x86 boot sector") just contains the kernel in the first kbytes, and the gzipped root filesystem just after.
Now the problem is that I don't know how to configure a valid boot loader (such as LILO or Grub or SysLinux) and write it to the first 512 bytes of the floppy image to make it boot. I already tried to fetch a floppy distro from the Internet, dd the MBR from it and then catting it before the floppy image to a new one (I mean, "cat MBR FLOPIMG > NEWIMG"), but no way to make it boot anyway (quite reasonable, after all ).
I'm trying this stuff with QEmu because the distro doesn't fits very good on a floppy (a total of 1,8MB against 1,44MB), and, if things will work, I'm planning to add more features and burn it on a pocket 8cm CD.
Does anyone know how can I add a bootloader to this floppy image so that it can boot correctly (with both QEmu and... PC!)? Please note that I'm working on the image, so many programs say that "it's not a valid block device" (infact it's not /dev/fd0).
Many thanks for any help!
Cheers!

Last edited by d1s4st3r; 01-09-2006 at 04:07 PM.
 
Old 01-09-2006, 04:34 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Can't be much help except to point out that you can't write to the mbr with your "cat" command. You need to use dd.
For example, the grub manual will tell you how to install grub to the floppy---but I dont know if you need stage 1 or more.

If you know what you need in the mbr (eg bootfile), and the size (typically 446* bytes), then do this:
dd if=bootfile of=/dev/fd0 bs=446 count=1

*A boot sector is 512 bytes, including 4 16-byte partition table entries and a 2-byte "signature". This leaves 446 bytes for boot code.
 
Old 01-11-2006, 07:22 AM   #3
d1s4st3r
Member
 
Registered: May 2004
Location: Italy
Posts: 70

Original Poster
Rep: Reputation: 16
I realized that the boot problem is due to the 2.6.* Linux kernel.
With 2.4.* kernel, it boots perfectly.
I'm still failing in installing a bootloader on the floppy image to boot with kernel 2.6.*.
pixellany's suggestion is good, but it's not working, basically for the reasons:
1) my kernel image should have the exact name of the one that the "grabbed" bootloader expects to find to make it boot
2) I'm working on a file, not a block device, and this causes some problems (maybe because bootloader wants "/dev/fd0" to write MBR and/or to boot, but can't find it)
Hope to find a solution asap.
I you have any kind suggestion, I'm glad to hear about!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
custom-made redhat distro srns Red Hat 1 12-15-2004 08:15 PM
booting a distro within an already booted distro webwolf70 Linux - General 4 06-30-2004 08:10 AM
Why is boot floppy disk made in RawWriteWin for Mandrake doesn't work? jkdouglasusa Linux - Software 6 01-25-2004 02:16 PM
Has anybody successfully made a bootable floppy diskette during installation? shawhu Fedora - Installation 2 01-21-2004 10:10 PM
Partition check problem when booting with a Debian Distro. ashgrim Linux - Newbie 3 10-22-2003 06:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration