Justin Florentine
2003-Oct-16 14:31 UTC
[syslinux] relationship between syslinux and loadlin
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Could someone possibly clarify the relationship between these 2 programs? I am in a situation where I am developing for an embedded system, and I need to rewrite my CMOS before I actually boot into linux. ~ The only tools for manipulating my cmos happen to be DOS utilities, and I was hoping that I could script their use in autoexec.bat or somewhere similar. I noticed that neither autoexec or linux.bat are executed. It seems that the syslinux bootloader bypasses any use of loadlin, is this correct? My other option would be not to use syslinux, but to boot into DOS and script a call to loadlin. The problem is that I haven't been able to create (and more importantly automate) the creation of a partition that will boot into DOS. I'm using a compact flash card as my media, but that shouldn't be any different than any other IDE device. I use sfdisk to create 2 partitions, the first one DOS and bootable, the second one Linux. I mkdosfs and mke2fs the respective partitions, and copy over command.com, dos.sys, autoexec.bat, blah blah blah, but I still get missing OS messages. Any ideas? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/jqvHu7srlnPHEE8RAklOAKCVsds9V9vQK+qFvJeAtKTLxqaD+gCfclwF zU6qfP163gDO+7dXwG+qcAM=pym4 -----END PGP SIGNATURE-----
Justin Florentine wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Could someone possibly clarify the relationship between these 2 > programs? I am in a situation where I am developing for an embedded > system, and I need to rewrite my CMOS before I actually boot into linux. > ~ The only tools for manipulating my cmos happen to be DOS utilities, and > I was hoping that I could script their use in autoexec.bat or somewhere > similar. I noticed that neither autoexec or linux.bat are executed. It > seems that the syslinux bootloader bypasses any use of loadlin, is this > correct? > > My other option would be not to use syslinux, but to boot into DOS and > script a call to loadlin. The problem is that I haven't been able to > create (and more importantly automate) the creation of a partition that > will boot into DOS. I'm using a compact flash card as my media, but > that shouldn't be any different than any other IDE device. > > I use sfdisk to create 2 partitions, the first one DOS and bootable, the > second one Linux. I mkdosfs and mke2fs the respective partitions, and > copy over command.com, dos.sys, autoexec.bat, blah blah blah, but I > still get missing OS messages. >You need the equivalent of the DOS "SYS" command, which installs the boot sector for the particular version of DOS you're running. Furthermore, io.sys and msdos.sys have special requirements -- for most versions of DOS, io.sys need to be contiguous and not cross track boundaries for the first four sectors, and many versions of DOS require that io.sys and msdos.sys are the first two entries in the root directory. Both syslinux and loadlin boots from a DOS FAT filesystem, but syslinux doesn't use DOS to do it -- it just uses the same filesystem format. It can, however, execute some very simple .com programs that can also work under DOS. Programming the CMOS is relatively easy if you know what your utilities actually do, so you might be able to port your program to DOS. Loadlin, on the other hand, actually runs from within DOS. The biggest problem with Loadlin is that it seems to be abandoned. -hpa