Re: boot loader that can read from partition?



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?
|
| Which architecture(s)? What environment (BIOS, OpenFirmware, etc.)
| for I/O? What disk layout for partitions (PC-DOS, Sun, BSD, Apple, ...)?

PC x86, DOS style partitions.

Other architectures would be interesting, too, such as Sun Sparc.
But for now, it is the commodity PC.


| For i386 with the usual BIOS and DOS-style ("basic") partitions:
|
| http://bitwagon.com/ftp/mbr03.tgz
| List partitions to console, select which partition using console
| (with user-defined labels, timeout, default), boot that partition.
| Fits in 446 bytes (512 - 2 - 16*4) of Master Boot Record (MBR).
|
| http://bitwagon.com/ftp/e2boot4c.tgz
| Boots named kernel and initrd and commandline from ext2 (also ext3)
| filesystem that uses 1KB blocksize [which is the default blocksize
| for "small" partitions; includes 100MB, for instance]. Fits in
| 1024 - 2*2 bytes boot block of ext2/3 filesystem; requires mbr03
| [above] to provide "read block" subroutine.

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?

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. So I was hoping there would
be something already out there for what I think is a very straight
forward way to boot load a kernel (if one is willing to chop up their
space in partitions to hold a kernel someone). The kernel I have has
a size of 4679831 right now. I figure an partition just shy of 8 MB
would be well more than enough to hold a future kernel, and not too
much for a boot loader to "over load" (e.g. it won't know anything
more about the image size unless there is a field in the image that
gives the size).

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



Relevant Pages

  • Re: [PATCH 1/1] filesystem: Disk Errors at boot-time caused by probe of partitions
    ... disks were incorrectly handling illegal sector numbers? ... Without this patch during boot the kernel log is full of Disk ... You can see the original bug report in the Ubuntu bug-tracker where I've ... Comparing those 8 unique sector addresses with the known partition ...
    (Linux-Kernel)
  • Re: [OT] SATA 3TB: unsupported sector size -1548812288.
    ... upgrading the kernel will fix the OP's problem. ... I also assumed from his posting history that the OP didn't need me to tell him about the limitations of partition types - so I 'assumed' it was either a software issue related to handling a disk that size, or an issue related to the large sector sizes of some of the new, very large, SATA drives. ...
    (Debian-User)
  • Re: Command Line Partitioning
    ... it seems when I get CF disks they have an MS-DOS partition ... Both lilo and extlinux can be ... The down side of lilo is that the boot loader ... Linux kernel. ...
    (Debian-User)
  • Re: Setup problems - fdisk, overlapping sectors?
    ... Can we infer that the disk interface ... You use fdisk => meaning you have booted some kernel and are ... and readto read the second and the last sector of the disk. ... the disk had no extended partition. ...
    (comp.os.linux.setup)
  • Re: how to tell if a specific data block is sparse?
    ... |> | The MBR, the very first sector of the drive, is outside any filesystem. ... | of the first sector of the partition) is passed in %eax. ... |> itself before the kernel eventually releases the memory involved). ...
    (comp.os.linux.development.system)