AT( ADDR(.__mbHeader) - What should I put in that ?

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
van7hu
Posts: 7
Joined: Wed Aug 04, 2010 10:18 am
Location: Hoà Bình,Việt Nam

AT( ADDR(.__mbHeader) - What should I put in that ?

Post by van7hu »

Hi all,I have read about error 13:http://wiki.osdev.org/Grub_Error_13
Hell,in the last line AT( ADDR(.__mbHeader) - YOUR_KERNEL\'S_VIRTUAL_OFFSET_HERE )
What is "YOUR_KERNEL\'S_VIRTUAL_OFFSET_HERE )" ?
sorry for my stupid question , but I am completely new to Osdev
I will be here quite often !
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: AT( ADDR(.__mbHeader) - What should I put in that ?

Post by gerryg400 »

As an example, you might have something like this

Code: Select all

	.text 0xc0000000 : 
	  AT ( 0x100000 ) ALIGN (0x1000)
	  { *(.text) } 

This means that the code will be loaded by Grub at 0x100000. However, when paging is enabled, the code will actually execute at 0xc0000000. The value of 'YOUR_KERNEL'S_VIRTUAL_OFFSET_HERE' is the address that it is linked at (0xc0000000) minus the address that Grub loads it at (0x100000). In the above example the difference is 0xbff00000.

Code: Select all

YOUR_KERNEL'S_VIRTUAL_OFFSET_HERE = Virtual address - Physical address
If a trainstation is where trains stop, what is a workstation ?
Post Reply