candiedoperation / tacos

🌮 tacOS is a hobby OS kernel with documentation. It's 64-Bit (x86), created from scratch with documentation for aspiring OS developers.
GNU General Public License v3.0
0 stars 1 forks source link

Fatal if Identity Mapped Region exceeds 1024M address #3

Open candiedoperation opened 3 months ago

candiedoperation commented 3 months ago

Issue Description

In the current implementation, BootMem::PhysicalMemoryAllocateIDMappedBlock routine identity maps more memory if we run out of them for creating page tables. However, we never check if the next Identity Mapped Address exceeds 1024M and keep mapping more memory. This would become fatal as when were > 1024M we move to the next PDT which might not exist.

Troubleshooting

This is a known issue and was left out for a future implementation. See Line 174/175 in kernel/mem/bootmem.cpp.

Recommendations

  1. Use the BootMem::PhysicalMemoryMapToOffset(...) routine to map the memory instead as it automatically creates page tables if they do not exist.