The identity-mapped page directory and page table you build here is the exact bootstrap step every real kernel — Linux's arch/x86/mm/init.c included — performs so the CPU keeps executing its own code the instant CR0.PG flips on. Skipping the identity map of the currently-running code is a classic bug: the very next instruction after enabling paging triple-faults because its physical address is no longer mapped to any virtual address.