| news - about me - my system - columns - blackbox styles - projects - licenses - the curse - contact | |||
|
Booting with Loadlin |
|
||
|
path xlife columns 20011210 |
|||
Booting with LoadlinXlife column for December 10, 2001:Summary:
1 Why do we need bootloaders?When you have several operating systems on the same computer you need to tell it which one to use. This is done usually at boot time, right after the computer's low level diagnostics and setup have ended. At that moment it is custom standard that control is passed to a small program located at the very beginning of the first hard-disk, called a bootloader. This is just custom standard. You can tell your BIOS to check for a bootloader on the floppy-disk, on the CD-ROM or on another hard-disk. But in my setup I have two operating systems on the same hard-disk, so I need a bootloader that would allow me to choose between them. The "regular" bootloader I had so far, the one installed by Windows, would load Windows from the first partition. I can go about this issue two ways:
2 How does Loadlin work?First of all, you need to know what a kernel image is: it's a file which contains the core of the Linux operating system, the kernel, in packed form so it takes up less space. This kernel is basicly a program which LILO or loadlin load into memory and pass all control to it. What I have to do is tell loadlin a few important things:
What LILO does is first hook up to the main Linux partition, look into the /boot directory and get the kernel image it finds there. Loadlin, on the other side, needs a kernel image first of all. So I'll need a kernel image. 3 Setting up LoadlinI choose to put Loadlin in C:\loadlin. You can find loadlin.exe on the first Red Hat CD, in the dosutils directory. There's also a tarball there (a Tar/GZip archive) called lodlin16.tgz, which contains more, like documentation and examples. WinZip knows tarballs. I pass info to Loadlin through a configuration file, let's say C:\loadlin\linux.par. So what we've got so far is Loadlin itself and a configuration file. We really need a kernel image now. 4 Getting a kernel imageYou don't just need a kernel image, you need the right kernel image. Once the image loads and takes over, it will load drivers (or "modules"); if they're not appropriate some things (hardware or applications) won't work properly or even at all. Remember this in the future. If you have a Linux boot floppy disk, check it out. There's a file called vmlinuz on it. That's the kernel image. Copy it into C:\loadlin and give it a suggestive name (I call it 242-2.z, because it contains kernel version 2.4.2-2, and "z" because it was compressed with GZip). 5 The Loadlin configuration fileHere's what I have in mine: c:\loadlin\242-2.z # the kernel image; must be on the first line -v # be verbose; I wanna see what goes on root=/dev/hda6 # which is the main Linux partition ro # mount the main Linux partition read-only console=tty1 # output messages to the first console vga=normal # regular VGA text mode mem=128M # I have 128 MB of RAM idebus=66 # the mainboard can take 66 bus transfer ide0=ata66 # ide0 (the hard-disk) knows ATA66/100 hdc=ide-scsi # hdc (the CD-writer) uses the ide-scsi interface Actually, you can do without most of these options, except the kernel image location and the root option. I let the others in just so I can explain them and, again, you'll end up smarter thant the average newbie. That read-only stuff is not what it seems, the partition must be read-only in the beginning so it can be checked for errors; if everything's fine the kernel will make it read-write later during the startup process. Linux has "consoles"; by using Alt+F1 through 6 you can switch between separate screens. The console option tells the kernel which console to write it's messages to. Also, the vga option sets up a VGA mode. I don't really need to tell Linux how much RAM I've got. It can detect it just fine. However, in some rare cases it doesn't, so this is a way to patch things up. I got this option there back when I bought some new RAM and I wanted to make sure it works the first time. The idebus and ide0 options are a trick I use to switch my hard-drive into "high gear" and get top performance out of it. Finally, with the hdc option I tell the kernel that my CD-writer unit will be using the ide-scsi interface. No, it's not SCSI, it's just an IDE drive, but this interface (emulated by the kernel) is better that plain IDE, and I need it in order to actually use the writer for writing. 6 Actually using LoadlinYou run Loadlin like this: C:\loadlin> loadlin.exe @linux.par Next thing you know, you're in Linux. 7 An even nicer way to use LoadlinIt would be really nice though if, upon computer start, I'd get a nice little menu allowing me to choose between Linux and Windows. OK, we can do that by using the startup menu facility of config.sys. Check out this config.sys: [menu] menuitem=win,win menuitem=linux,linux menudefault=linux,10 [win] [linux] shell=C:\LOADLIN\LOADLIN.EXE @C:\LOADLIN\LINUX.PAR That's it, you're all set up. Every time the computer reboots you get a menu with two entries, win and linux. If you don't press a key for ten seconds linux gets chosen automatically. 8 I don't wanna use loadlin!So don't. Use GRUB or a newer LILO. < Back to the top | Read other columns | Choose what column I should write next! > |
|||
|
Xlife ©2001-2009 Zuavra. All rights reserved. You are welcome to link to this site's text pages, but you must get explicit permission before you may reproduce or quote their contents. You may not link directly to binary files, such as images or tarballs. I do keep logs, you know, and offending sites will get their links redirected to shameful error messages. |
|||