Allocating a memory area for vmalloc
Posted: Wed Mar 27, 2024 3:38 am
I plan to implement vmalloc for the kernel memory, but I can't decide which part of the virtual memory to define for this.
I want to do like Linux, allocate a 128 megabyte virtual memory area from 0xF8000000(3 GB + 896 MB) to 0xFFFFFFFF(3 GB + 1024 MB).
I have a x86 protected mode higher half kernel, in the kernel space VA = PA + 0xC0000000,
which means that if there is memory in the physical memory area from 0x38000000(896 MB) to 0x3FFFFFFF(1024 MB) that I need to put into the kernel (for example ACPI or something like that),
then I will not be able to map it so easily as with all other physical memory related to the kernel.
I will give all the free physical memory from this interval for user applications and there will be no such problems with it.
According to the wiki(https://wiki.osdev.org/Memory_Map_(x86)), the first gigabyte of physical memory will not contain anything that drivers will need.
Can I just hope that the last 128 megabytes of the first gigabyte of physical memory will not contain data that I will have to map for drivers (for example, ACPI and so on)?
I want to do like Linux, allocate a 128 megabyte virtual memory area from 0xF8000000(3 GB + 896 MB) to 0xFFFFFFFF(3 GB + 1024 MB).
I have a x86 protected mode higher half kernel, in the kernel space VA = PA + 0xC0000000,
which means that if there is memory in the physical memory area from 0x38000000(896 MB) to 0x3FFFFFFF(1024 MB) that I need to put into the kernel (for example ACPI or something like that),
then I will not be able to map it so easily as with all other physical memory related to the kernel.
I will give all the free physical memory from this interval for user applications and there will be no such problems with it.
According to the wiki(https://wiki.osdev.org/Memory_Map_(x86)), the first gigabyte of physical memory will not contain anything that drivers will need.
Can I just hope that the last 128 megabytes of the first gigabyte of physical memory will not contain data that I will have to map for drivers (for example, ACPI and so on)?