+ /* Kernel static code and data, in 4 kB pages.
+
+ We can figure this out because the linker records the start
+ and end of the kernel as _start and _end. See
+ kernel.lds. */
+ extern char _start, _end;
+ size_t kernel_pages = (&_end - &_start + 4095) / 4096;
+
+ /* Then we know how much is available to allocate. */
+ uninit_start = ptov (LOADER_KERN_BASE + kernel_pages * PGSIZE);
+ uninit_end = ptov (ram_pages * PGSIZE);
+
+ /* Initialize other variables. */
+ lock_init (&lock, "palloc");
+ list_init (&free_pages);