Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands NovaOS’s early-boot platform support by introducing MMU translation-table setup/mapping utilities and wiring them into the AArch64 boot/exception path, alongside a few supporting tooling and minor runtime changes.
Changes:
- Add an MMU/paging implementation (
src/aarch64/mmu.rs) plus configuration constants and translation-table initialization (src/configuration.rs,link.ld,src/vector.S,src/main.rs). - Improve interrupt/exception diagnostics and low-level helpers (vector table entries, ELR logging, UART inlining, panic message output).
- Update developer tooling (QEMU VSCode tasks/launch configs, simulator scripts) and minor cleanups (heap tests, README roadmap).
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| workspace/nova_error/src/lib.rs | Adds new NovaError variants used by MMU/paging code. |
| workspace/heap/src/tests.rs | Cleans up unused locals / reduces unnecessary unsafe in tests. |
| tools/start_simulator.sh | Adds set -e to fail fast during build/run. |
| tools/start_simulator_debug.sh | Adds set -e to fail fast during debug build/run. |
| src/vector.S | Updates vector table and adds EL1 MMU configuration routine. |
| src/pi3/power_management.rs | Adjusts PERIPHERAL_BASE typing and silences empty-loop lint. |
| src/peripherals/uart.rs | Adds #[inline(always)] to several UART helpers. |
| src/main.rs | Integrates heap init + MMU table setup/mapping into boot flow and updates demo drawing/logging. |
| src/logger.rs | Updates access pattern for the global logger static mut. |
| src/lib.rs | Changes PERIPHERAL_BASE to usize and improves panic output. |
| src/interrupt_handlers.rs | Improves sync exception logging and adjusts handler-vector access pattern. |
| src/framebuffer.rs | Adds bounds check in draw_pixel and changes framebuffer fields visibility. |
| src/configuration.rs | Adds SCTLR/TCR configuration constants and translation-table initialization helpers. |
| src/aarch64/registers.rs | Adds SCTLR_EL1 accessor macro entry. |
| src/aarch64/mmu.rs | Replaces previous stub with a full translation-table + paging bitmap implementation. |
| README.md | Updates roadmap items (MMU/SVC). |
| link.ld | Aligns sections for MMU usage and adjusts heap/stack placement/sizing. |
| .vscode/tasks.json | Adds an additional QEMU run task and background problem matchers. |
| .vscode/launch.json | Adds a “no window” QEMU attach debug configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+447
to
+466
| fn find_unallocated_page() -> Option<usize> { | ||
| for (i, entry) in unsafe { PAGING_BITMAP }.iter().enumerate() { | ||
| if *entry != u64::MAX { | ||
| for offset in 0..64 { | ||
| if entry >> offset & 0b1 == 0 { | ||
| return Some((i * 64 + offset) * GRANULARITY); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| None | ||
| } | ||
|
|
||
| fn find_contiguous_free_bitmap_words(required_words: usize) -> Option<usize> { | ||
| let mut run_start = 0; | ||
| let mut run_len = 0; | ||
|
|
||
| for (i, entry) in unsafe { PAGING_BITMAP }.iter().enumerate() { | ||
| if *entry == 0 { | ||
| if run_len == 0 { |
| IRQSource::UartInt => clear_uart_interrupt_state(), | ||
| _ => {} | ||
| _ => { | ||
| todo!() |
Comment on lines
23
to
29
| pub struct FrameBuffer { | ||
| pixel_depth: u32, // Bits per pixel | ||
| pitch: u32, // Pixel per row | ||
| rows: u32, // Rows | ||
| start_addr: *mut u32, | ||
| size: u32, //Bytes | ||
| pub start_addr: *mut u32, | ||
| pub size: u32, //Bytes | ||
| } |
Comment on lines
+17
to
18
| "command": "llvm-objcopy -O binary target/aarch64-unknown-none/debug/nova target/aarch64-unknown-none/debug/kernel8.img && echo Starting QEMU&qemu-system-aarch64 -M raspi3b -cpu cortex-a53 -serial stdio -sd sd.img -kernel ${workspaceFolder}/target/aarch64-unknown-none/debug/kernel8.img -S -s -m 1024", | ||
| "isBackground": true, |
Comment on lines
+1
to
3
| set -e | ||
|
|
||
| cargo build --target aarch64-unknown-none --release |
Comment on lines
+1
to
3
| set -e | ||
|
|
||
| cargo build --target aarch64-unknown-none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.