Re: i386 bootsect.S & setup.S

From: jjore@imation.com
Date: Thu Jun 22 2000 - 13:05:36 EST


Since arch/i386/boot/bootsect.S is only used when the kernel is located at
0/0/0 and the BIOS is looking for something to transfer control to I'm
sure that in 97% of the cases that something like LILO is a much better
solution. The outlying 3% are probably just going to be used for boot
disks where the kernel is the only data on the disk or boot/root disks
where the kernel starts the disk and looks for the root filesystem at some
specified offset from 0. In this case I'll guess that the root finding
code can be dispensed with since I think that we can expect that the root
device has already been set at either compile time or later through rdev.

So ... that yields a little space. I'm attempting to (1) do 'dd if=bzImage
of=/dev/hdc' where hdc is my ATA SuperDisk floppy. Once (1) works
correctly then I'd like to add a file system right after the kernel and
just tell it to mount / at a specified offset.

The problem I'm encountering appears to have two issues.

#1 arch/i386/boot/bootsect.S expects the boot media to have two heads. In
cases where the media is large (like 120MB) then the heads will be some
other number like 8. I'm adding a heads detection routine and then read_it
needs to actually step through them. Maybe there's enough space for this.
I'll see.

#2 doing a 'dd if=bzImage of=/dev/hdc' when 1.44MB media is in the drive
(80/2/18) should write to the disk as if it's /dev/fd0. When attempting to
boot from the 1.44 disk I'm getting errors so that leads me to think that
the geometry at boot time is different that the geometry while everything
is loaded. I'm not sure how to resolve this right now. I've been able to
boot ok from slack 7's bare.i disk so... I'll still be poking at it.

Of course, installing lilo doesn't work either. The errors I've seen are:
scrolling "01 "'s when booting from a disk with LILO installed. (1.44MB &
120MB) and

Loading..................
Uncompressing...

  - System error (err=1)_

when the kernel has been copied directly to the disk.

Are there any problems with what I'm doing here? I will be contacting
lilo's maintainer about it's problems. I know that's off-topic for here.

Joshua Jore
(not speaking for my employer)

"H. Peter Anvin" <hpa@zytor.com>
Sent by: owner-linux-kernel@vger.rutgers.edu
06/21/00 10:45 AM

 
        To: linux-kernel@vger.rutgers.edu
        cc:
        Subject: Re: i386 bootsect.S & setup.S

Followup to: <OF77FAC7FD.C5D605FA-ON86256905.005462EB@imation.com>
By author: jjore@imation.com
In newsgroup: linux.dev.kernel
>
> I'm looking to add bootable support for ATA floppies to bootsect.S but
it's
> currently chock full. Is there any reason why the code for deciding on a
> root device is in bootsect.S and couldn't be moved to setup.S? Here's
the
> relevant code:
>

a) ATA floppies with standard geometries should work just fine with
   the existing bootsect.S as long as they speak BIOS properly.
b) For larger floppies, you really want a proper boot loader anyway.
c) The old code you're listing is so hideously obsolete. It really
   doesn't make sense to have at all.

Personally, I'd really prefer if bootsect.S went away. It was a neat
feature in the old days, but with no access to the command lines and
the hideous games it has to play to get the geometry, I don't think
it's a good idea anymore.

        -hpa

--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:24 EST