From owner-freebsd-hackers@FreeBSD.ORG Wed May 24 14:20:40 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C0E616A4E4 for ; Wed, 24 May 2006 14:20:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8042743D91 for ; Wed, 24 May 2006 14:20:39 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k4OEKWgD091853; Wed, 24 May 2006 10:20:32 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 24 May 2006 09:55:19 -0400 User-Agent: KMail/1.9.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200605240955.19370.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1479/Wed May 24 01:17:23 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: "R. Tyler Ballance" Subject: Re: Kernel call stack for dummies. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2006 14:20:40 -0000 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: > http://www.ertos.nicta.com.au/software/kenge/iguana-project/latest/) >=20 > 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. >=20 > 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_() (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). =2D-=20 John Baldwin =A0<>< =A0http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org