Messages in this thread | | | Date | Sun, 27 Feb 2000 05:58:01 -0500 | From | Dan Malek <> | Subject | Re: Load linux...from linux? |
| |
Lars Kellogg-Stedman wrote: > > For instance, it would be nice if the last action when rebooting a linux > system were (optionally) to load and execute a new kernel image, rather > than reset the system.
I do this quite frequently on embedded systems. Rather than try to write boot roms with network protocols, I just put a Linux kernel in the flash rom. They can boot up using diskless NFS (or whatever you want), and are hacked to reserve a chunk of contiguous physical memory for loading the new kernel. I have a rather trivial program that will mmap() the memory and copy a kernel file there. Then I modified the machine_restart() to take a reboot command with a starting address. The "gorom" function then disables interrupts, mmu, cache, and jumps to the starting address of the new code.
The kernels I boot are all Linux/PPC compressed zImage. Since they relocate themselves and uncompress the kernel to the proper memory location, it doesn't matter where they are initially loaded in physical memory. Works very well.
I chose to reserved a big piece of physical memory because it was easy to do. There are several variations on allocating memory for the new kernel, with associated modifications to boot loader wrappers. I am sure you could write a driver that would coalesce memory for the new image that would work with any kernel, so from one kernel you could just boot another.
-- Dan
- 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/
| |