[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] How do i tell QEMU that memory i've have mapped is co
From: |
Peter Fillmore |
Subject: |
Re: [Qemu-discuss] How do i tell QEMU that memory i've have mapped is code? |
Date: |
Tue, 13 Jan 2015 10:18:31 +1100 |
The setup code is <edited for brevity>:
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *iap = g_new(MemoryRegion, 1);
//create pointer for region
memory_region_init_ram(iap, NULL, "vivotech.iap", 0x1000,&error_abort);
//init 0x1000 bytes of ram
vmstate_register_ram_global(iap);
//register with qemu
memory_region_add_subregion(sysmem, 0x7FFFFFF0, iap);
//add to the sysmem
I have also previous allocated 512KB of pflash at 0x00 and 64KB of RAM at
0x40000000
The code starts fine - i just get an access violation at 0x7FFFFFF0 when it
jumps to that point. Dumping memory contains the correct instructions.
Regards,
-------------------------------------------------------
Peter Fillmore
Principle Consultant, CISSP
Payment Security Consulting
On 13 Jan 2015, at 8:22 am, Peter Maydell <address@hidden> wrote:
> On 12 January 2015 at 00:44, Peter Fillmore <address@hidden> wrote:
>> heres the code which creates the memory (contained in a custom driver):
>>
>>> memory_region_init_ram(&s->iomem, OBJECT(dev), "arm-lpc213x-iap", 0x1000,
>>> NULL);
>>> sysbus_init_mmio(sd, &s->iomem);
>>> char *memptr = memory_region_get_ram_ptr(&s->iomem) ;
>>> memcpy(memptr,iapcode, sizeof(iapcode));
>
> Have you remembered to actually map the RAM MemoryRegion into
> system memory at the right address?
>
> -- PMM
signature.asc
Description: Message signed with OpenPGP using GPGMail