public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Antonio Vargas <wind@cocodriloo.com>
To: S-n-e-a-k-e-r@gmx.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: questions regarding arch/i386/boot/setup.S
Date: Mon, 5 May 2003 19:15:01 +0200	[thread overview]
Message-ID: <20030505171501.GL1074@wind.cocodriloo.com> (raw)
In-Reply-To: <23912.1052135086@www4.gmx.net>

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.


      parent reply	other threads:[~2003-05-05 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-05 11:44 questions regarding arch/i386/boot/setup.S S-n-e-a-k-e-r
2003-05-05 13:12 ` Richard B. Johnson
2003-05-05 17:15 ` Antonio Vargas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030505171501.GL1074@wind.cocodriloo.com \
    --to=wind@cocodriloo.com \
    --cc=S-n-e-a-k-e-r@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox