mm: add a warning in map_page if a page is already mapped

This commit is contained in:
2025-11-05 21:03:06 +03:00
parent 57d2931b96
commit ccf954e1d6
+5
View File
@@ -70,6 +70,11 @@ void map_page(void *physaddr, void *virtualaddr, unsigned int flags) {
// Here you need to check whether the PT entry is present.
// When it is, then there is already a mapping present. What do you do now?
if(pt[ptindex] & 0x1)
{
printf("this page 0x%X is already mapped\n", virtualaddr);
}
pt[ptindex] = ((unsigned long)physaddr) | (flags & 0xFFF); // Present
// Now you need to flush the entry in the TLB