Kernel call stack for dummies.
jhb at freebsd.org
Wed May 24 07:20:40 PDT 2006
On Wednesday 24 May 2006 03:05, R. Tyler Ballance wrote:
> I've started the uphill battle to port FreeBSD's kernel to run
> "paravirtualized" (<--note the smart sounding vocabulary) on top of
> the L4/Iguana OS (Iguana is a very barebones OS developed by NICTA:
> On of the first steps is basically porting the lowest of low kernel
> calls such as those in sys/i386 sys/arm and sys/amd64 for example
> into sys/iguana to talk to iguana instead of actual hardware.
> One of the things I need to figure out is the order in which kernel
> calls are made on boot, so I can go through and reimplement them one
> by one (in order to spend as little time as possible going back and
> fixing other problems of mine), as suggested by Ben Leslie at NICTA.
> Is there a good overview of what's happening directly after boot in
> terms of the procedure in which functions are called right after the
> bootloader finishes it business?
The boot loader hands off execution to locore.S. The entry point in
there sets up various things and then calls init_<arch>() (such as
init_i386() in sys/i386/i386/machdep.c). When init_i386() returns,
locore then calls mi_startup() which runs through all of the SYSINITs
and never returns (the last SYSINIT kicks off the swapper kthread
using the boot stack).
John Baldwin <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the freebsd-hackers