BBS水木清华站∶精华区
寄信人: linuxrat (竹剑居士*农大历史上最差的学生)
标 题: 一个没有1024问题的引导器nuni[FWD]
发信站: BBS 水木清华站 (Thu Feb 3 13:08:22 2000)
来 源: 202.112.168.253
其实有很多的bootloader的. 不过大家使用lilo习惯了也就不怎么关心其他的
bootloader. 在sunsite上面多的是啦.
URL:http://www.linuxforum.com/plug/articles/nuni.html
===Begin===
A "New-ni" Bootloader
Neil Koozer of Roseburg, Oregon has created nuni, a boot loader for a
Linux system that uses the ext2 file system and IDE drives. nuni
handles various ext2 block sizes, and handles both small and large
kernels.
The nuni program was inspired by a long-standing need. When he
discovered Linux some 5 years ago, there were many people having those
bios-related problems in booting Linux. Instead of getting better, the
problem has gotten worse due to the proliferation of larger drives
(with the accessible zone already occupied). Neil felt that this
problem would become a serious blemish on Linux when Linux becomes
more exposed to the public. What if MS Windows would freeze with "WI"
instead of booting? For a long time Neil had the idea that a minimal
IDE driver & loader would fit in one sector, and when he discovered
the nasm assembler, just had to give it a try. This loader is seeded
with hardware addresses at install time just like LILO, but it doesn't
use a map; it uses the inode to find the data blocks at boot time. You
can look at the C code and the assembler code in a funky html format
(the sources are in the downloadable file).
So, the reason for this particular loader is to avoid bios limitations
by not using the bios. There is no 1024 cylinder problem because the
concept of cylinders is not used. There is also no problem with a
difference in geometry between the bios and Linux because the concept
of geometry is not used. We can boot from any place on the drive, up
to 128GB. This is also handy for older BIOSes that don't support
larger hard drives.
Neil was so pleased with this program, he wanted to give it a good
name. Needing something pronounceable with two syllables, and not
starting with "G" or "K" (and mercifully not "Win"), he had to get
creative. When he was born, his brother could not pronounce "Neil",
and what he came up with was "nuni" (or "noonie"), so that was Neil's
name until his brother was 5 years old. And now it's the name of
Neil's program.
Any drive from hda to hdh can be used. If you have drives above hdh
with custom major numbers, you can add an additional 'case' line to
the 'switch (major)' statement.
If you have an add-on IDE interface, its i/o ports may not be the same
as those assumed in nuni.c. You can edit the port addresses in nuni.c.
For example, if your card is to host hde & hdf, find the statement
that starts with 'switch (major)' and put your port addresses in the
line containing the 'e'.
Multi-booting is not yet supported, but you can boot multiple
installation of Linux on the same machine using nuni on a boot floppy.
Since nuni is designed so that it loads the kernel from the hard drive
partition instead of the floppy, it boots much faster.
Nuni also accepts kernel parameters as described in the BootPrompt
HOWTO.
The file nuni.asm is the boot loader which resides in the boot sector
of a floppy or a hard drive; nuni.c passes some data to nuni.asm by
means of 'equ' statements. Therefore, nuni.asm must be assembled every
time a boot record is created and it is assembled with the nasm
assembler.
This version is a little too fat to be placed in the MBR, so it is
normally placed on a floppy boot sector or in any non-MBR partition
boot sector where any boot manager can execute it.
Installation Instructions:
(1) put the nuni-0.04.tar.gz file in a convenient place
(2) tar zxf nuni-0.04.tar.gz
(3) cd nuni-0.04
(4) gcc nuni.c -o nuni.elf
Configuration and Execution Instructions:
(1) cd /path/nuni-0.04
(2) edit nuni to set the following items:
(a) path to kernel image
(b) target partition for installing the boot loader
(c) command line for kernel
(3) ./nuni
Additional editing instructions are imbedded in the nuni script.
Progress Indicator:
When nuni is loading the kernel, it prints a string of '.........'
one for each ext2 block that is loaded.
Kernel command line:
Nuni accepts file-based and interactive input for the kernel
command line. These are concatenated at boot time. The file-based
kernel parameters are placed in the nuni script. Editing
instructions are included in the script. The parameters or commands
can be placed on separate lines for readability if desired. To
obtain a prompt at boot time, hold down any shift, control, or alt
key while the bios boot sequence is proceeding. A prompt of the
form:
Cmd:
will appear. Type any desired kernel parameters using the syntax
described in the BootPrompt HOWTO.
Errors:
If nuni receives an error code from the drive, it prints an 'E' and
halts. Nuni can't really tell the difference between garbage and
correct data. In the case of garbage, it will happily load blocks
until it happens to attempt to fetch a block beyond the end of the
drive. Then it will get an error code form the drive.
Multi-booting:
If you have a boot manager, you can put nuni in the boot sector of
each Linux system to be booted. Without a boot manager, you can put
nuni on a different floppy for each Linux system to be booted. This
method is fast and may be more convenient than administering a
multi-booting loader.
Ontrack Disk Manager:
If you have Ontrack on the drive, use this in nuni.c
#define ontrack 63
If Ontrack is not present use
#define ontrack 0
Real-soon-now this will be made automatic.
Verbosity:
The verbosity can be turned on and off by editing this line in
nuni.c:
#define verbose 1
About the Author of nuni:
Neil writes:
"I have been an assembly language junkie since the days of the TRS-80
Model 1. I used to write cpm bios's and assemblers & cross-assemblers
for Z80 and NS32000 machines. Around 1986 I wrote a 32-bit (single
user) operating system for the NS32000. I was a performance junkie,
too, and my system compiler would compile a program in less time than
it took to just make a copy of the source. "
"After MS Windows took over, I was a man without a country for many
years. Coming to Linux is like coming home, but what a transition;
Linux has more files than my old system had bytes. This boot loader is
a nice exercise for breaking the ice; some nice easy assembly coding
together with a little sprinkling of C and script."
Neil has also submitted nuni to Mandrake for possible inclusion in the
Linux-Mandrake distribution. They are also considering GRUB, the
bootloader from the GNU project. A selection of non-LILO interactive
boot programs that included GRUB, chos and syslinux are available at
metalab.
Files Needed
nuni
nuni-0.04.tar.gz
nasm
RPM nasm-0.98-1.i386.rpm
SOURCE http://www.web-sites.co.uk/nasm/ver.html
===End=====
--
//sigh, 签名档太长会浪费空间, 所以放到个人说明档里面去了。呵呵...
我转载的一切文章, 版权归相应的作者所有。
BBS水木清华站∶精华区