Invalid partition entry number (another question)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
lweb20
Member
Member
Posts: 39
Joined: Tue Jul 23, 2013 12:54 pm

Invalid partition entry number (another question)

Post by lweb20 »

All right .. :)

Reformulating my question:

I have problem with the number of partition entry in a bootloader.

VMware return 0x0:0x7CE (ds:si) in a second partition.
VirtualBox return 0x0:0x7BE (ds:si) in a first partition.

As you can see the values ​​are not expected or not I'm interpreting well.

I expected 0x1BE in first partition and 0x1CE in second partition.

Please help me.

References:
http://wiki.osdev.org/MBR_(x86)
http://wiki.osdev.org/Partition_Table

PD. Sorry for my very bad english. I'm not kidding..
User avatar
iansjack
Member
Member
Posts: 4709
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Invalid partition entry number (another question)

Post by iansjack »

What do you mean "return". What code returns these values?
Octocontrabass
Member
Member
Posts: 5590
Joined: Mon Mar 25, 2013 7:01 pm

Re: Invalid partition entry number (another question)

Post by Octocontrabass »

lweb20 wrote:or not I'm interpreting well
This is your problem.

When this article says "offset 0x1be, 0x1ce, 0x1de, and 0x1ee", it is referring to the offset relative to the start of the MBR.
lweb20
Member
Member
Posts: 39
Joined: Tue Jul 23, 2013 12:54 pm

Re: Invalid partition entry number (another question)

Post by lweb20 »

Thanks for the responses.
iansjack wrote:What do you mean "return". What code returns these values?
At booting VMWare and VirtualBox have these values in "ds:si".
Octocontrabass wrote:When this article says "offset 0x1be, 0x1ce, 0x1de, and 0x1ee", it is referring to the offset relative to the start of the MBR.
MBR starting in 0x0 (sector zero) right? then relative offset are 0x1BE, ... right? if not, I don't understand. :?
User avatar
Minoto
Member
Member
Posts: 89
Joined: Thu May 12, 2011 7:24 pm

Re: Invalid partition entry number (another question)

Post by Minoto »

lweb20 wrote: MBR starting in 0x0 (sector zero) right? then relative offset are 0x1BE, ... right? if not, I don't understand. :?
http://wiki.osdev.org/MBR_(x86) wrote:The MBR that FDISK uses is coded to:
  • relocate itself to 0x0000:0x0600
  • examine the byte at offset 0x1be, 0x1ce, 0x1de, and 0x1ee to determine the active partition
Yes, the MBR is located in sector 0 of the disk. However, the article is talking about the location of the MBR in memory, after it's relocated itself to 0x0000:0x0600. 0x0600 + 0x01be = 0x07be, and so on.
Those who understand Unix are doomed to copy it, poorly.
lweb20
Member
Member
Posts: 39
Joined: Tue Jul 23, 2013 12:54 pm

Re: Invalid partition entry number (another question)

Post by lweb20 »

Minoto wrote:
lweb20 wrote: MBR starting in 0x0 (sector zero) right? then relative offset are 0x1BE, ... right? if not, I don't understand. :?
http://wiki.osdev.org/MBR_(x86) wrote:The MBR that FDISK uses is coded to:
  • relocate itself to 0x0000:0x0600
  • examine the byte at offset 0x1be, 0x1ce, 0x1de, and 0x1ee to determine the active partition
Yes, the MBR is located in sector 0 of the disk. However, the article is talking about the location of the MBR in memory, after it's relocated itself to 0x0000:0x0600. 0x0600 + 0x01be = 0x07be, and so on.
:o Ahh how silly of me. I thought it was the offset on the disk, but it was in the memory. Thank you very much friend. Thank you so much. :D
Post Reply