[syslinux] Boot Linux ram disk image from DOS prompt

Alexander Foken alexander at foken.de
Thu Jan 31 22:27:54 PST 2013


On 31.01.2013 18:02, Leandro Becker wrote:
> Hello Alexander,
>   
> Loadlin finally worked! There are some missing parameters to boot the
> Linux :( In the rush to test, I forgot to put then from my syslinux.cfg
> file.
Ah, those self-made bugs are the best. Hard to debug, because you are 
100% sure that there can't be a problem. Happens to every one, more than 
once.
>   
> loadlin bz initrd=init.gz rw root=/dev/ram0 vesafb:mtrr,ywrap vga=785
> ramdisk_size=40960
ramdisk_size is the important one here.

vga and vesafb just control how the VGA console is used. If you want to 
run Linux without user interaction, you probably don't need them. 
Depending on your hardware, they may cause trouble (especially with 
ancient low-end VGAs). vga=0 uses the old 80x25 text mode and should 
work with every vga card.

If you use a custom kernel, you can set the ramdisk_size in the kernel 
configuration.

But modern Linux kernels (>=2.6.0) have another nice feature: initramfs. 
Essentially, you pack your initial RAM disk in a cpio archive, and 
compile it into the kernel. You do not need an external ramdisk image. 
The kernel sources contain a usr/gen_init_cpio program that can create a 
custom cpio archive with different uid and gid even without root 
permissions. You can even just specify a directory where all files for 
your initramfs reside, and the build process will automatically create 
the cpio archive for you. See 
Documentation/filesystems/ramfs-rootfs-initramfs.txt in the kernel 
sources for details.

Alexander

>   
> Right now I'm also having fun with COM32 modules. Very nice indeed!
>   
> Thank you,
>   
> Leandro
>
>>>> Em Quarta, 30 de Janeiro de 2013 às 17:34, na mensagem
> <510975DE.3070806 at foken.de>, Alexander Foken <alexander at foken.de>
> gravou:
>
>
> On 30.01.2013 19:17, Leandro Becker wrote:
>> I'm using the 16f version. The error messages are not confidential,
> but
>> hard to get from the screen.
> Write them down. Or use a digital camera and take a (literal) screen
> shot. Then type them into your mail program.
>
>> If you think it should be working, maybe
>> I'm configuring the command line wrongly. Right now, the commands
> I'm
>> using are:
>>    
>> loadlin bzImage initrd=init.gz rw root=/dev/ram0
> I didn't use loadlin for several years, but I see no obvious errors.
>
> Are you sure your combination of bzImage, init.gz, and root device
> parameter don't cause any errors? Try loading them using Syslinux. If
> that works, but using loadlin fails, you have probably found a loadlin
>
> bug. If using Syslinux also fails, the problem is probably with the
> kernel image, the ramdisk, or the root device parameter.
>
>>    
>> But got errors telling that the RAM disk is smaller that the kernel
>> think.
> Exact error message?
>>    
>> Right now I will follow you advice and check the comboot approach.
>>    
>> Do you think is possible when booting a DOS image with ramdisk make
>> some configuration in syslinux to allow the fresh booted DOS see and
>> also "mount" my USB media device like an drive B: or something?
> DOS does not know about USB devices. Unless the BIOS or some special
> DOS
> device driver offers legacy support, DOS won't be able to use them.
>
>> Thus I
>> can manipulate the syslinux.cfg in the DOS to decide what to boot
> next.
>
> I would try to get rid of DOS. While DOS *can* still be booted on
> modern
> machines, it does not mean it *should* be booted. Many legacy programs
>
> have problems with current high speed CPUs and large disks, and more
> and
> more devices lack DOS drivers or legacy emulations from BIOS.
>
> Automatically editing files from DOS is possible, but ugly. I thing you
>
> need a port of sed or awk for DOS for that job, or you create two
> configuration files and copy them over the actually used configuration
> file.
>
>>    
>> One thing I'm starting to consider is the new lua support. I will
> check
>> the docs more deply if is possible to use it to check for and create
>> files on my usb memory stick. If possible, I can resolve my needs
> with
>> it.
> Syslinux mutates more and more from a linux loader to a small operating
>
> system, so your chances are getting better from day to day.
>
> What is the purpose of the "test program"?
>
> Can you rewrite it to use the COMBOOT API or to run on bare hardware or
>
> to use only the common API subset of Syslinux and DOS (the first few
> INT
> 0x21 functions)?
>
> Alexander
>
>>    
>> Thank you!
>>
>>>>> Em Quarta, 30 de Janeiro de 2013 às 12:33, na mensagem
>> <51092F4C.5070605 at foken.de>, Alexander Foken <alexander at foken.de>
>> gravou:
>>
>> On 01/30/2013 12:04 PM, Leandro Becker wrote:
>>> Hello,
>>>     
>>> There is a way to boot a ram disk Linux from DOS prompt like the
> old
>>> tool loadlin.exe? I tried it, but getting errors.
>>>     
>> Check the loadlin version. Loadlin 16f, released 2012-09-17, is the
>> current one, it should be able to boot recent kernels. 16e, released
>> 2010-08-25, may damage the initial ramdisk when loading Linux. 16d,
>> released 2009-02-08, contains code to boot Linux >= 2.6.23, but it
>> probably does not boot recent linux kernels.
>>
>> Alexander
>>


-- 
Alexander Foken
mailto:alexander at foken.de  http://www.foken.de/alexander/



More information about the Syslinux mailing list