Problem loading OS image with Grub2

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
chauhanjpr
Posts: 9
Joined: Tue Feb 28, 2012 6:14 am

Problem loading OS image with Grub2

Post by chauhanjpr »

Hi,

I am working on a open source type 2 bare metal hypervisor for Intel 64. I am currently writing the bootstrapper for it. I am successfully able to kick into 64-bit mode with paging enabled. But I am seeing a problem. I am seeing wrong data in the section I have linked by 64-bit code. I am linking the image at 0xC0109000 but the load address is 0x109000. While attached to GDB when I dump address 0x109000, I see wrong data which is not code of the function linked at this address.

I also did a pmemsave from qemu to dump the physical memory (guest physical for qemu), I see the same wrong data in the dump as well. I am wondering if Grub is actually loading all the data.

If you want to take a look at the code its lying at:

https://github.com/hschauhan/xvisor-x86 ... cpu/x86_64

Any pointers will be helpful.

Thanks
= Himanshu =
chauhanjpr
Posts: 9
Joined: Tue Feb 28, 2012 6:14 am

Re: Problem loading OS image with Grub2

Post by chauhanjpr »

[correction] Its a Type 1 (as I said bare metal) hypervisor.
chauhanjpr
Posts: 9
Joined: Tue Feb 28, 2012 6:14 am

Re: Problem loading OS image with Grub2

Post by chauhanjpr »

Hi,

My grub header had a problem which caused Grub to load my image incompletely (as I expected).

Thanks, anyways,

= Himanshu =
Post Reply