Re: overwriting of interrupts

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Fri May 12 2000 - 14:28:46 EST


On Sat, 13 May 2000, S. Arun wrote:

>
> Hi all,
>
> I am trying to write my own bootloader and I would like to know whether
> the kernel, when it boots up, overwrites interrupts before searching for
> the ramdisk. More specifically, I am referring to int13h and int19h. i
> plan to overwrite int13h so that the ramdisk is found from the hardware
> attached to my I/O port before giving the jump to 7c00 where i have
> already loaded the first 512 bytes of the kernel. both the kernel +
> ramdisk reside on the hardware attached to my I/O port.
>
> PS. I am not on the mailing list, so please Cc to me your replies
>
> Thanks in advance
> S. Arun
>

The LILO loader uses software int 0x13 to read the previously-stored
sectors into RAM. Therefore it does not "overwrite" interrupt 0x13.

If the kernel is large, i.e., can't fit into about 512k (the first 64k is
used for the loader and the interrupt/bios-data space), then LILO uses
the protected-mode move routine (int 0x15, function 0x87) to put the
data at 1 megabyte and above.

In all cases, the integrity of the BIOS and its data is preserved until
all the data (which will become code) has been loaded. It is only after
this, that startup code reprograms controllers, etc.

So, you can make a "EEPROM-Disk", driver that "pretends" that it is
a 1.44 Mb floppy disk and the system will boot just as though it was
booting from a floppy. You can also use 'initrd' for a compressed
ramdisk image to be mounted as the root file-system. This gets put
onto this same "phony-floppy-disk" image using LILO, just the same
as if it was a real floppy. Both Linux and LILO are very flexible.

For "deeply-embedded" systems, where you are sure you no longer need
to update and/or modify things, you can use any method available to
make the kernel image appear at 0x00100000 absolute, init the two
interrupt controllers, transition into protected-mode with a
1-megabyte base, and jump through that descriptor to Linux.

Cheers,
Dick Johnson

Penguin : Linux version 2.3.41 on an i686 machine (800.63 BogoMips).

-
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 : Mon May 15 2000 - 21:00:21 EST