From owner-freebsd-hackers Fri Jun 14 2: 6:57 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from goose.mail.pas.earthlink.net (goose.mail.pas.earthlink.net [207.217.120.18]) by hub.freebsd.org (Postfix) with ESMTP id 94D9337B401 for ; Fri, 14 Jun 2002 02:06:52 -0700 (PDT) Received: from pool0278.cvx22-bradley.dialup.earthlink.net ([209.179.199.23] helo=mindspring.com) by goose.mail.pas.earthlink.net with esmtp (Exim 3.33 #2) id 17In2E-0003N7-00; Fri, 14 Jun 2002 02:06:23 -0700 Message-ID: <3D09B1E2.71DD6BF3@mindspring.com> Date: Fri, 14 Jun 2002 02:05:38 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Sergey Lyubka Cc: hackers@freebsd.org Subject: Re: locore.s quiestion References: <20020614115010.B20213@oasis.uptsoft.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Sergey Lyubka wrote: > Hello, > I am writing an article about FreeBSD's startup > and kernel init > (it is at http://oasis.uptsoft.com/~devnull/dh/boot.html > for whom it may be interesting) This link is broken. > I am stucked at two lines in locore.s (IA 32 arch) > > /usr/src/sys/i386/i386/locore.s: > > pushl $begin /* jump to high virtualized address */ > ret > > /* now running relocated at KERNBASE where the system is linked to run */ > begin: > /* set up bootstrap stack */ > > My question is: > why this is done. My understanding was that the loader > loaded the kernel at high virtual address already, > so there's no need to jump. From my own notes: The address of the "begin" symbol is pushed onto the stack, and the btext() function returns ...not to its caller, but to the begin() funcion, in the relocated address space. This is one of those "You are not expected to understand this" things. Probably, you would benefit from reading: Protected Mode Software Architecture Tom Shanley Mindshare, Inc. Addison-Wesley Publishing Company ISBN 0-201-5447-X -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message