PDA

View Full Version : HOWTO: Booting Knoppix from a DOS floppy



pestie
08-05-2005, 04:18 AM
Introduction
It's been suggested that this information may be useful to others, so I've decided to write a quick HOWTO on booting Knoppix from a DOS floppy. Some of you may be wondering why the heck you'd ever want to do that, but as it turns out, there are quite a few reasons. Mine happens to be the fact that I have an old (P-166, 64M of RAM) but rock-solid IBM Thinkpad laptop I wanted to run Knoppix on. But it's so old that the BIOS doesn't support booting from a CD-ROM whatsoever, so I had no choice but to boot from floppy.

In this HOWTO I refer to the Knoppix CD-ROM, but in reality you could use this process to boot Knoppix from any media for which DOS drivers are available but Knoppix/Linux doesn't natively support. This includes PCMCIA CD-ROM's, various USB devices (yes, USB drivers for DOS (http://www.stefan2000.com/darkehorse/PC/DOS/Drivers/USB/) actually exist!) including "thumb drives," USB CD-ROM's and hard drives, flash card readers, etc., ancient parallel-port ZIP drives, various weird boot-from-network setups (Novell Netware, Windows NT DOS client)... the list goes on. But it's most likely to be useful to people who can't, for one reason or another, boot from their otherwise-perfectly-functional CD-ROM drive.

Note: If you have a reasonably modern BIOS that has an option to boot from CD, but for some reason your PC refuses to do so, there may be hope! I've personally seen this happen quite a bit and it's always had one of two causes: either the CD-ROM drive is a very, very old one, or the CD-ROM is configured as an IDE slave rather than a master. If you have an ancent drive, for God's sake, upgrade - you can get a plain ol' CD-ROM for next to nothing these days. If the drive is reasonably new (like, not from the mid-late 90's), it's probably just not booting because it's configured as an IDE slave. I know that doesn't make much sense, but I've seen it happen more times than I can count, and configuring the drive as a master, either on the primary or secondary IDE channel, has allowed it to boot every time. Give it a try; you might be surprised.

So how do I do it?
The basic process is this:

Download a copy of loadlin (http://elserv.ffm.fgan.de/~lermen/)
Make a DOS boot floppy with CD-ROM drivers
Insert Knoppix CD and use loadlin to boot the kernel

Not enough detail for you? Read on...

loadlin
loadlin (http://elserv.ffm.fgan.de/~lermen/) is a tremendously cool/useful little utility that allows you to boot a Linux kernel from DOS. It's the key to this whole process. The loadlin package comes with a bunch of files, but the only one you need is loadlin.exe.

Making DOS boot floppy
At this point you're going to need to decide how much of a Free software purist you are. Those of you who just want to get to the point with minimal hassle will go dig out your old MS-DOS boot floppy, fire it up, and move on to step two. Those of you who are more purist will want to get a copy of FreeDOS (http://www.freedos.org/) and use that. I'll warn you, though - FreeDOS can be a serious pain in the ass. I experimented quite a bit with it and had it do charming things like lock up hard, completely at random. To further complicate things, you'll still need a low-level CD-ROM device driver, as the one that comes with FreeDOS (at least as of earlier this year) was unstable to the point of being useless. Read the FreeDOS docs and decide for yourself. This is the route I ultimately took, though, so I'll describe the DOS disk specifics in terms of FreeDOS. A discussion of installing FreeDOS, though, is outside the scope of this document (I've always wanted to say that).

The files you'll need:

KERNEL.SYS - installed when you make a FreeDOS bootable disk
COMMAND.COM - also installed when you make a FreeDOS bootable disk
HIMEM.EXE - High memory driver (HIMEM.SYS is the MS-DOS equivalent)
SHSUCDX.EXE - FreeDOS high-level CD-ROM support (MSCDEX.EXE is the MS-DOS equivalent)
EDIT.EXE - Not necessary for boot, but useful as hell for editing config files
CONFIG.SYS - See below
AUTOEXEC.BAT - See below
LOADLIN.EXE - loadlin executable
VIDE-CDD.SYS - This is the low-level CD-ROM device driver I used. It's one I've been using for years, as it seems to support just about any and every IDE CD-ROM I've come across. It is not Free software, though! So be aware of this fact if you intend to distribute your boot disk, especially in a business context. Even in this day and age, if you buy a retail-boxed CD-ROM drive, it very well might come with a similar driver for DOS.

The contents of CONFIG.SYS should look something like this:


device=himem.exe
device=vide-cdd.sys /d:mscd001 /p:1f0,14 /p:170,15 /p:1e8,12 /p:168,10


The first line loads the high memory driver. The second loads the low-level CD-ROM device driver. The command line itself is specific to the driver being used, so if you're not using VIDE-CDD.SYS, you'll probably need another command line. Check any documentation or example configuration files that come with your driver.

AUTOEXEC.BAT looks like this:


shsucdx /d:mscd001 /v


Now, I like to pretty up my AUTOEXEC.BAT with things like "@echo off" and "prompt $p$g" but that's hardly necessary. The line above is the only one that's really necessary. It loads the FreeDOS high-level CD-ROM device driver and assigns it a drive letter. The "/v" option means "verbose" and should tell you, among other things, which drive letter was assigned. You'll need to know that.

Booting Knoppix
Now you're ready for the fun part - booting Knoppix. You'll use loadlin to boot the Knoppix kernel, at which point it will take over, DOS will vanish from memory, and with any luck you'll have a fully-functional Knoppix boot on the first try! Hahahaha... Yeah, right! So, what I like to do is create a file called K.BAT to save me having to type the whole loadlin command line every time (and when you see it, you'll know why). Remember when I told you to pay attention to the drive letter assigned to the CD-ROM drive when SHSUCDX ran? This is where you'll need that. Replace D: in the batch file below with the drive letter assigned by SHSUCDX.

A K.BAT with the default boot options of Knoppix 3.9 looks like this:


D:
cd \boot\isolinux
a:\loadlin linux ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce quiet BOOT_IMAGE=knoppix


Ack! That's quite a loadlin command line, eh? I told you you'd want to create a batch file for this. But this brings us to another problem: the COMMAND.COM command-line length limitation. I think it's 128 characters or so, and if you need to pass a bunch of cheat codes to make Knoppix work right, you're going to need to shorten that up a bit. I've found that Knoppix will boot quite nicely like this:



D:
cd \boot\isolinux
a:\loadlin linux ramdisk_size=100000 lang=us initrd=minirt.gz


That's a little better, isn't it? Some parameters you might want to add are vga=791 for 1024x768 framebuffer mode and vga=788 for 800x600 framebuffer mode, or vga=extended for 80x50 text mode. I don't know about you, but I can't stand working in an 80x25 text console. You'll want to start tacking on your own cheat codes and kernel parameters from that point on. All the standard Knoppix cheatcodes work, as do all standard Linux kernel parameters.

When booting Knoppix directly from CD you can type things like "fb800x600" to get an 800x600 framebuffer, or "expert" and/or "failsafe" if things aren't working and you want to figure out why. Well, these options are all loading the same kernel, they're just passing a different set of parameters. To see what those parameters are, look in [/b]\BOOT\ISOLINUX\ISOLINUX.CFG[/b]. Copy what you need from there.

Conclusion
At this point you should at least be seeing the Knoppix kernel boot on your previously-un-Knoppixable machine, so that about wraps it up for me. It may take some tweaking and a whole buttload of reboots to get your configuration exactly right, but you'll get the hang of it real quickly, I'm sure. And you'll probably learn a few things about Knoppix in the process. So, I hope this HOWTO is useful to someone! Feel free to leave any comments, suggestions, updates, corrections (even spelling/grammar mistakes), flames & hate mail, etc. in this thread and I'll keep an eye on it. Happy Knoppixing!

maxIT
08-05-2005, 09:34 AM
As good integration of this topic I would suggest this thread:
http://www.knoppix.net/forum/viewtopic.php?t=12520
8)

sakiZ
09-16-2005, 09:26 PM
Loadlin provides an alternative way to use it to get around the command line limitaton. One more reasone Loadlin is really great.

Create a batch file with this line in it: Call it Linux.bat or whatever you want.

Loadlin @options.txt

Create a text file called options.txt with all the boot options and cheatcodes you want. For
example: (Purely an arbitrary example of options.txt contents:)

linux24
initrd=minirt24.gz
init=/etc/init
fromhd
root=/dev/hda
rw
ramdisk_size=100000
lang=us
noapm
noapic
quiet
BOOT_IMAGE=/dev/hda/knoppix/k*.iso

As you can see you can put quite a lot info in an options.txt file. No more command line limitation.

sakiZ

gjhicks
12-01-2005, 12:14 AM
Hi,

Whilst a little off topic for this thread, I have been looking for some help in getting knoppix to boot from a pcmcia cdrom.

Some time ago, a floppy image of the pcmcia modules was available on various sites. Despite many searches, I can no longer find it.

I am hoping that one of the contributors to this thread might have the pcmcia modules floppy image.

If so, please let me know a link or email same to me at gjh3124 at yahoo.com.au

Thanks,

Geoff

sakiZ
12-01-2005, 03:03 AM
I can't help you with your pcmcia question. Sorry.

Best to create a new post for it.

sakiZ

gjhicks
12-01-2005, 05:31 AM
Hi,

Thanks for the quick reply!

Will take your advice and start a new topic.

Geoff