lkml.org 
[lkml]   [2003]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: questions regarding arch/i386/boot/setup.S
On Mon, May 05, 2003 at 01:44:46PM +0200, S-n-e-a-k-e-r@gmx.net wrote:
> I write this to the kernel mailing list, because my question couldn't be
> answered on irc (eg. irc.kernelnewbie.org):
> ____________________________________________________________________________
> arch/i386/boot/setup.S:
>
> 164 trampoline: call start_of_setup
> 165 .space 1024
> 166 # End of setup header
> #####################################################
> 167
> 168 start_of_setup:
> 169 # Bootlin depends on this being done early
> 170 movw $0x01500, %ax
> ____________________________________________________________________________
> my questions are:
>
> -) Why is there a call on line 164 and not a jmp?
> -) Why does line 165 reserve 1024 bytes? what is it for?
> -) On line 170: Why $0x01500 and not $0x1500?
>
> I would appreciate if someone could answer this mail, or if someone can
> provide ressources where I can find detailed description of the kernel code
> (didn't find anything, just overall information)

Andy, "call" pushes �"eip" into the stack, so later on
you can do "mov [esp],edx" and use edx as a pointer
to this 1024-bytes space.

This is a way to perform pc-relative addressing on
architectures which don't allow it directly such as
i386 (if I remember correctly).

Compare this to, for example, m68k, where
you can do "move label(pc),d0" to perform pc-relative
addressing if "label" is located near the current pc.

Greetz, Antonio.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.067 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site