We had/have this functionality in the Amiga port of NetBSD.
It is implemented as `/dev/reload` device and you copy a kernel image to it. In locore.s there's code that copies the kernel image over top of the running kernel and then restarts. I believe for it to work nothing below the copy code in locore.s can change :)
Thanks,
Chris.
Phil Budne <phil@ultimate.com> writes:
> ron minnich wrote:
>> But I'm wondering: is Ed's work in 1977 the first "kernel boots kernel" or
>> was there something before?
>
> There was! The PDP-7 UNIX listings contain a program trysys.s
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/sys/trysys.s
> that reboots the system by reading a.out into user memory (in the high
> 4K of core), then copies it to low memory and jumping to the entry
> point. The name suggests its original intended use was to test a new
> system (kernel).
>
> P.S.
> Normal bootable system images seem to have been stored in reserved
> tracks of the (fixed head) disk (that are inacessible via system calls):
>
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/sys/maksys.s
> reads a.out and uses I/O instructions to write it out.
>
> P.P.S.
> Accordingly, I put together a "paper tape" for booting the system:
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/other/pbboot.s
>
> P.P.P.S.
> The system (kernel) is 3K words, the last 1K of low memory
> used for the character table for the vector graphics controller.
>
> The definitions for the table are compiled by
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/cmd/cas.s
> from definition file
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/sys/cas.in
> (after, ISTR, figuring out the ordering of the listing pages!)
>
> I don't think we ever figured out how the initial character table
> is loaded into core. One thing that was missing from the table
> was the dispatch array, which I recreated:
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/other/chrtbl.s
>
> The system (kernel) could be built for a "cold start", reloading the
> disk (prone to head crashes?) from paper tape? But I don't think
> anyone ever reconstructed the procedure for rebuilding a disk that way.
>
> The disk was two sided, and the running system only used one side:
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/cmd/dsksav.s
> https://github.com/DoctorWkt/pdp7-unix/blob/master/src/cmd/dskres.s
> appear to be programs to save and restore the filesystem from the
> "other" side of the disk.