Re: overwriting of interrupts

From: David Woodhouse (dwmw2@infradead.org)
Date: Mon May 15 2000 - 06:07:49 EST


arun@ee.iitm.ernet.in said:
> 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.

Unless you mean an initrd, then yes, the kernel is fully up and running
before trying to load the ramdisk. There's almost no chance of getting it
to use INT 13h for disk I/O - although there are patches to a 1.0 kernel
somewhere which do switch back to real mode and do that.

> 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.

If you fool the kernel into thinking it's being loaded from a floppy disc
without a bootloader present, then you'll probably get it to load the rest
of itself via your INT 13h handler, but I don't think you'll get the root
filesystem to load like that very easily.

Your best option is either to provide a bootloader which loads both the
kernel and initrd into memory before starting, or to add a driver to the
kernel which is capable of driving your hardware directly.

If the hardware you're talking about is actually flash memory attached via
an I/O port, see www.linux-mtd.infradead.org - if you're using any
well-known flash filing system on it, then it should be quite simple to add
a driver for your specific hardware, and get it working. We also have Grub
loading from flash devices; although we have yet to finish teaching it how
to load a kernel from them so it's not wonderfully useful yet :)

--
dwmw2

- 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:25 EST