lkml.org 
[lkml]   [2000]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.100 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site