Re: boot loader that can read from partition?



On Sat, 14 Oct 2006 16:40:44 -0700 John Reiser <jreiser@xxxxxxxxxxxx> wrote:
| phil-news-nospam@xxxxxxxx wrote:
|> On Sat, 14 Oct 2006 10:14:29 -0700 John Reiser <jreiser@xxxxxxxxxxxx> wrote:
|> | phil-news-nospam@xxxxxxxx wrote:
|> |> Is there a boot loader than can read a kernel in from a raw partition?
|
|> PC x86, DOS style partitions.
|
|> | For i386 with the usual BIOS and DOS-style ("basic") partitions:
|> |
|> | http://bitwagon.com/ftp/mbr03.tgz
|> | http://bitwagon.com/ftp/e2boot4c.tgz
|
|> Is there any way to combine these? Since I don't need the ext2 code
|> at all, and loading from a partition is always purely sequential,
|> would it be possible to get the partition boot loader to load from
|> the partition directly? It should just be a matter of reading the
|> partition table to get the partition loadcation that mbr03 knows to
|> do, load the image sequentially from start to end of the partition
|> (it may be more sectors than needed) by simple sector increment by
|> one, and then pass control to the kernel? Would it fit? Since at
|> least sector 0 is never assigned to a partition, could additional
|> unassigned sector be used to cheat for space on the boot loader?
|
| The request "boot from a raw disk partition" [i.e., a marked extent
| of contiguous sectors] is somewhat strange. Unless there will be
| _no_ filesystem of any kind after boot, then put the kernel and initrd
| into a filesystem. Using the two .tgz above works for ext2/ext3.
| Syslinux works for FAT. loadlin also works on FAT, and will even
| boot linux from inside a running DOS. The OS/2 boot loader runs
| with upto 15 extents; you might try it.

For loading from index sectors I have LILO. For loading from files in
a filesystem, I have GRUB. Either of these should have been able to
load from a partition mostly because it should be easy. Or what would
be hard about it?


|> I don't have sufficient x86 assembly knowledge plus the spare machine
|> needed to experiment with coding x86 assembly at the boot loader level
|> to be able to put this together myself.
|
| Use qemu. http://fabrice.bellard.free.fr/qemu/
|
| Explain enough about the need to use a raw disk partition, in order to
| convince other hackers to join you. Until then, qemu + {syslinux,
| loadlin, mbr03+e2boot4c, possibly others} is what you get.

It's a system that will be dynamically built each time it boots up.
But it also needs to be able to reboot in certain cases where it is
not rebuilt for whatever reason. I can't rely on a filesystem being
buildable. This also involves a small flash disk.

This probably should have been the basic way to boot a system from
early on. It would have, for example, avoided the need to store an
array of indexes by LILO. It would have been easy to update the
kernel. With two partitions, there could also be a fallback. I do
not think it is strange at all. It's booting the KISS way. But if
people don't like partitions, then I guess that might be the real
reason.

Does QEMU pass a whole disk device from the real machine into the
virtual machine it emulates, at a different position ... e.g. can
it make all of /dev/hdc appear as IDE primary master and then run
a boot loader that uses BIOS for initial I/O?

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2006-10-14-1958@xxxxxxxx |
|------------------------------------/-------------------------------------|
.



Relevant Pages

  • Re: boot loader that can read from partition?
    ... |> enough space in the MBR to store that there. ... Or even less space is needed to store and index into the partition ... the first possible partition in the next track is at most 63 sectors ... |> | length of the linked kernel image. ...
    (comp.os.linux.development.system)
  • Re: boot loader that can read from partition?
    ... You could copy most of the LILO code and simply ... | references to sectors somewhere else. ... As long as you use one partition per kernel and have all your boot ... If the value is coded into the boot loader in the same format as ...
    (comp.os.linux.development.system)
  • Re: boot loader that can read from partition?
    ... loader storing anything it needs in any filesystem. ... to zero-out and reformat every filesystem and still have the boot loader ... But you obviously can't zero-out and reformat every partition. ... configuration file, and kernel images. ...
    (comp.os.linux.development.system)
  • Re: how to tell if a specific data block is sparse?
    ... | The MBR, the very first sector of the drive, is outside any filesystem. ... | The e2fs boot block is just the first two sectors of its partition. ... a boot loader, unless the boot loader is made to be part of the image ... that goes into a partition meant to hold the kernel. ...
    (comp.os.linux.development.system)
  • Re: Installing a second operating system on a second drive
    ... But he wants to install Windows 2000 on ... Remember a 3rd party boot loader alone will NOT provide the second ... When you do that guess which partition will show as C in Windows 2000 Setup? ...
    (microsoft.public.win2000.general)