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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to