// virt_to_phys: Converts virtual address into physical address
// for the current address space
// Returns physical address or 0 on error
long int virt_to_phys(long int virtual)
{
if (virtual >= 0xC0000000 && virtual <= 0xC03FFFFF) { // If located in special 4MB kernel memory page,
return (virtual - 0xC0000000 + 0x400000); // then we dont need to bother with the page tables
}
return 0;
}