Skip to content

Pie, Interrupts, Symmetric MultiProcessing#6

Open
GglLfr wants to merge 79 commits into
masterfrom
pie
Open

Pie, Interrupts, Symmetric MultiProcessing#6
GglLfr wants to merge 79 commits into
masterfrom
pie

Conversation

@GglLfr

@GglLfr GglLfr commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make the kernel compile with -fPIE
  • Increased amount of stack pages (very important)
  • Bootloader no longer controls higher-half addressing
  • Virtual mapping is now done completely by the kernel, making the bootloader significantly leaner; see next point
  • Kernel now has a "setup" phase: after jumping from bootloader, it enters setup_identity_mapped which maps the kernel ELF segments, boot info page, and stack pages into higher-half (starts at 0xffff_8000_0000_0000); then it enables virtual-mapping via cr3, and enters setup_virtual_mapped which sets logger up and physical page allocator; finally, it moves on to main
  • BOOT_INFO is no longer a static, but a reference pass through rdi
  • Symbol relocations is done twice; once in the bootloader for adjusting to physical addresses returned by UEFI, and once more in the kernel (relocates itself, Elf64_Rela information relayed by the bootloader) after higher-half mapping
  • Virtual mapper is now accessible as a global static reference
  • Added a global physical page allocator

To-do

  • Unmap the identity virtual addresses
  • Add a kernel "stack guard," i.e. an unmapped page as the bottom-most page in higher-half addressing to "catch" kernel stack overflows by page faulting
  • The page allocator can't deallocate yet

@GglLfr GglLfr marked this pull request as draft June 30, 2026 11:31
@GglLfr

GglLfr commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Drafted, because I forgot that the framebuffer isn't mapped yet

@GglLfr GglLfr marked this pull request as ready for review June 30, 2026 12:30
@GglLfr

GglLfr commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author
image Framebuffer is now mapped!

@GglLfr GglLfr changed the title Pie Pie, Interrupts, Symmetric MultiProcessing Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant