I'm studying how to enable paging in Linux kernel but I didn't understand how the kernel can address from 8 MB to 1 GB of virtual memory. I mean, in the boot phase the kernel comes with a very minimal page table encoded into the image. This page table (pointed by swapper_pg_dir) allows you to write only the first two entries of the page table. Each entry points to a page of 4 MB. So in total the kernel can address only 8 MB of virtual memory. Then the kernel has to instore the second level of the page table in order to drive all its 1 GB of virtual memory. In order to resolve that, it must rely in some memory allocator which allow to retrieve buffers where to put the entries of the second level page table: this is the bootmem allocator.
So my question is: how can the kernel address from 8 MB to 1 GB of virtual memory?