On Wed, 1 Mar 2006 10:34:11 -0300 Ricardo Nabinger Sanchez <rnsanchez@xxxxxxxxxxxx> wrote: ~Quoting Aleph One <amerei@xxxxxxxxx> ~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. ~- ~: send the line "unsubscribe linux-assembly" in ~the body of a message to majordomo@xxxxxxxxxxxxxxx ~More majordomo info at http://vger.kernel.org/majordomo-info.html - : send the line "unsubscribe linux-assembly" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
- References:
- nasm -f bin / Elf format
- From: Thiago Silva
- grub thing
- From: Aleph One
- Re: grub thing
- From: Ricardo Nabinger Sanchez
- nasm -f bin / Elf format
- Prev by Date: Re: grub thing
- Next by Date: PS/2 Mouse
- Previous by thread: Re: grub thing
- Next by thread: Re: grub thing
- Index(es):