[syslinux] KRNLINUX? CPIOLINUX?

Shao Miller Shao.Miller at yrdsb.edu.on.ca
Fri Aug 19 15:30:51 PDT 2011


On 8/19/2011 17:19, Paul Bolle wrote:
> On Thu, 2011-08-18 at 22:37 -0700, H. Peter Anvin wrote:
>> On 08/16/2011 06:03 PM, Shao Miller wrote:
>>> Does anyone think that it might be a worth-while effort to code a
>>> Syslinux variant which is a "Linux x86 kernel"-format binary and whose
>>> "initrd" is a simple cpio archive which will comprise the root 
>>> filesystem?
>>> [...]
>>
>> There are definitely use cases for this. It would be interesting to have.
>
> Does this have to be a new variant?
>
> Wouldn't it be possible to tweak LDLINUX.SYS just enough so that it
> would also be a Linux (x86) kernel? So you end up with a single binary
> that could either be loaded directly by a boot sector (if installed by
> syslinux itself) or by any bootloader that knows how to load Linux (x86)
> kernels (in which case LDLINUX.SYS would check whether and initrd was
> also loaded by the bootloader).
>
> If I remember correctly grub2 does something similar: it's "core" image
> is also multiboot compliant and can therefore be loaded by any
> bootloader that knows how to handle multiboot images (and not just by
> the boot sector code that the grub2 installer generated).
>
> Even if all that is possible the next question is, of course, whether
> the complications - ie, two code paths for two ways of loading a single
> binary - would be worth the benefits.

If my understanding is correct, GRUB2 doesn't have the modules 
comprising its 'core.img' available as a "filesystem."  I believe that 
all module ('.mod') blobs inside 'core.img' are loaded without option.  
So to get "optional" functionality, GRUB2 people can embed a disk image 
blob and use their (somewhat confusingly-named) 'memdisk.mod' module to 
access it as a virtual disk.

That would be a difference here, where if our Syslinux has a "cpiofs" 
driver for its "initrd," then the root filesystem could really contain 
anything that was passed.

I'm not sure that it'd be useful for 'ldlinux.sys' to be an x86 kernel; 
how would one tell it which filesystem to use in the case where we are 
_not_ using an initrd?  By introducing a kernel command-line parser?

- Shao Miller




More information about the Syslinux mailing list