What does this line in grub legacy do?

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
arunsk
Posts: 5
Joined: Fri May 27, 2011 5:50 pm

What does this line in grub legacy do?

Post by arunsk »

Hi,

I am reading the legacy grub source code and I found the below line :

https://github.com/aszeszo/pv-grub/blob ... age1.S#L65

What does this piece of code do ? Is this part of 'as' syntax ? I couldn't google it for the string pattern.

Thanks,
Arun
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: What does this line in grub legacy do?

Post by jnc100 »

The 'jmp after_BPB' instruction could be encoded as either a 8-bit or 16-bit relative jump (opcodes 0xeb and 0xe9 respectively) and the assembler is actually free to choose whichever it likes. Generally, most compilers will choose the smallest possible, but there is never any guarantee of this. What the line you've highlighted does is ensure that the BPB starts at the appropriate address, regardless of which jmp opcode is chosen.

Regards,
John.
Post Reply