[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

umm

I was reading a page from
    www.ice-digga.com/programming/vul-2.html
which says a bit into the tutorial,
'When a boot disk is booted, the boot sector (1,0,0) is loaded at 0:7C00h'.
What is that?

0
bod_1
Asked:
bod_1
  • 4
  • 3
1 Solution
 
cookreCommented:
I presume the question is about the 0:7c00h - that's the address that the BIOS loads the boot sector into then transfers control to.

When the processor comes alive, it's in an addressing mode that only sees the first meg of RAM.  In that mode, addresses are defined in two parts - a segment (also called paragraph) address and an offset.

The segment address specifies a particular 16 byte clump of RAM and the offset specifies how many bytes past the beginning of that 16 byte clump to go.

The standard way of presenting such addresses is <Segment>:<Offset>.  In the case above, 0:7c00 specifies 31,744 bytes past the beginning of the first segment.  An alternate way of specifying that address would be 07c0:0000.

An interesting question would be "Why that particular address?"  Now, I don't know the history of the matter, but I would suspect that somebody had a sense of humor - 07c0:000 in decimal is the segment 1984.

0
 
bod_1Author Commented:
It would copy the boot sector into that address, set CS:IP=0000:7c00 and begin execution?

0
 
cookreCommented:
In effect.  The exact mechanism for transferring control may vary from BIOS to BIOS.  For example, one just might push the address to the stack then do a retf.
0
SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

 
bod_1Author Commented:
Adjusted points to 300
0
 
bod_1Author Commented:
Yup, I'd assume that the offset used for the IPL is some sort of egg.  Maybe so the programmer could remember what year it was? :)
Well, you've answered my question but I'm still a bit foggy about the procedure.  If I raise another hundred points could you walk me through a bit more?

IP now addresses the beginning of the master boot record (now in RAM).
It sounds from the tutorial, that the first 3 bytes of the MBR (00, 01, 02) can be used to address your bootstrap code and jump execution there.  I suppose that the jmp instruction (1 byte) with a 2 byte address should make up these first 3 bytes?
0
 
cookreCommented:
Once the code is loaded and jumped to, it's all up to the code - there is no requirement that offset 0 have a jump.

That said, in the DOS world, there is, indeed, a short jump around the DOS ID string and a table describing the disk.  If you look at a DOS MBR you'll see an EB as the first byte - that's the short jump around the table.

In general though, what happens now is entirely up to the OS writter.
0
 
bod_1Author Commented:
cool.  Thanks for your help cookre.
I understand up to that part now and can continue reading.
Cheers
0

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now