Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2002 02:05:38 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Sergey Lyubka <devnull@uptsoft.com>
Cc:        hackers@freebsd.org
Subject:   Re: locore.s quiestion
Message-ID:  <3D09B1E2.71DD6BF3@mindspring.com>
References:  <20020614115010.B20213@oasis.uptsoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D09B1E2.71DD6BF3>