Mapping physical address to random virtual address?
Posted: Mon May 25, 2009 5:41 am
Hi, I'm trying to use ACPICA in my kernel. However it requires that the OS provides several functions. One of these is
This function should map length bytes starting from physical, in the current Page Directory, and return a pointer to the virtual address.
However I have no idea of where to map those pages. I'm in higher half, and memory from 0xC0000000 to 0xF0000000 is reserved for the kernel executable and Heap. So I thought to map the physical address at 0xF0000000. But if ACPICA calls AcpiOsMapMemory with new datas, before it have Unmapped it through AcpiOsUnmapMemory, it will overwrite the old Page directory, and probably this will cause some problems.
Do I need something like malloc/free for the virtual addresses? Or there is some easier solution to the problem?
Thanks
Code: Select all
void *AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS *physical, ACPI_SIZE length);
However I have no idea of where to map those pages. I'm in higher half, and memory from 0xC0000000 to 0xF0000000 is reserved for the kernel executable and Heap. So I thought to map the physical address at 0xF0000000. But if ACPICA calls AcpiOsMapMemory with new datas, before it have Unmapped it through AcpiOsUnmapMemory, it will overwrite the old Page directory, and probably this will cause some problems.
Do I need something like malloc/free for the virtual addresses? Or there is some easier solution to the problem?
Thanks