linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aleph One <amerei@gmail.com>
To: Ricardo Nabinger Sanchez <rnsanchez@terra.com.br>
Cc: linux-assembly@vger.kernel.org
Subject: Re: grub thing
Date: Thu, 2 Mar 2006 06:49:55 +0000	[thread overview]
Message-ID: <20060302064955.7de89dd0.amerei@gmail.com> (raw)
In-Reply-To: <20060301103411.10ac083e.rnsanchez@terra.com.br>

On Wed, 1 Mar 2006 10:34:11 -0300
Ricardo Nabinger Sanchez <rnsanchez@terra.com.br> wrote:

~Quoting  Aleph One <amerei@gmail.com>
~Sent on  Wed, 1 Mar 2006 07:10:33 +0000
~
~> i'm looking at a disassembly of grub's stage 1. and i wanna know why it
~> need's to CLI before setting up the environment?? i tried to interpret it
~> line by line and this is what i have so far
~
~I'm not an expert, but interruptions must be disabled.  I believe grub
~doesn't install interrupt handlers, and thus a single interrupt would lock
~the machine (as the appropriate handler would likely point to garbage).
~
~would the BIOS (or similar in other architectures) give the processor to
~the bootloader with interrupts disabled already?
~
~> also, since the origin is at 0000:7c00h i figured that must imply that
~> "mov sp, 0x2000" means that the stack starts at 0x7c00+0x2000 = 9c000
~> right?
~
~I guess not.  to get what you described, I would do:
~
~	mov sp, 0x2000
~	add sp, 0x7c00
~
~from your disassembly, I'd expect SP to be 0x2000, counting from 0x0000.

groovy! thanks for clarifying this to me. i kinda got messed up thinking about relating the stack with the 7c000 start address :(

~-- 
~Ricardo Nabinger Sanchez
~GNU/Linux #140696 [http://counter.li.org]
~Slackware Linux + FreeBSD
~
~  Left to themselves, things tend to go from bad to worse.
~-
~To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
~the body of a message to majordomo@vger.kernel.org
~More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2006-03-02  6:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-22 21:26 nasm -f bin / Elf format Thiago Silva
2006-02-23  0:32 ` Brian Raiter
2006-03-01  7:10 ` grub thing Aleph One
2006-03-01 13:34   ` Ricardo Nabinger Sanchez
2006-03-02  6:49     ` Aleph One [this message]
2006-03-01 14:42   ` Marcin Kościelnicki
2006-03-01 18:08     ` Ricardo Nabinger Sanchez
2006-03-02  6:46     ` Aleph One

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=20060302064955.7de89dd0.amerei@gmail.com \
    --to=amerei@gmail.com \
    --cc=linux-assembly@vger.kernel.org \
    --cc=rnsanchez@terra.com.br \
    /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;
as well as URLs for NNTP newsgroup(s).