ok, quick question regarding my physical memory manger,
now that i have segments with a base of 0x40000000 and kernel is in the higher half. The addresses of the pages that i allocate using my stack will be higher half addresses right? eg. 0xc0101000
And these are logical addresses that are converted to linear addresses using the segment base, correct? And with paging not yet enabled the linear addresses equal the physical address ?
If these are correct, I cant understand why with the higherhalf tutorial in the init_paging function, there is any need to convert the virtual address of the pagedir/table into physical addresses, wont the processor take care of this due to the segment base address?
Code:
unsigned long vpagedir[1024] __attribute__ ((aligned (4096)));
unsigned long vpagetable[1024] __attribute__ ((aligned (4096)));
void
init_paging(multiboot_info_t *mbi, unsigned long end)
{
/* Pointers to the page directory and the page table */
void *ppagedir = 0;
void *ppagetable = 0;
int k = 0; /* counter */
/* Translate the page directory/table from virt to phys address */
ppagedir = (char *)vpagedir + 0x40000000;
ppagetable = (char *)vpagetable + 0x40000000;
/* continued... */
just want to clarify these few points so i can finalise the physical manager and move onto the virtual manager.
thanks in advance.