p15-initproc: First Process Execution with Segmentation-Based Isolation#25
Merged
Merged
Conversation
Author
|
Back-propagated correctness fixes discovered during p19 syscall implementation:
|
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.
p15-initproc First Process Execution
Branch: p14-segments (merged p14 + implemented p15)
Type: Original implementation
Impact: Process management infrastructure with first user-space process
Context:
Built on p14-segments (PR #24). Implements complete process management infrastructure to create and run the first user-space process with proper memory isolation using x86 segmentation and privilege levels.
Changes Made:
Process Management Core (src/proc.rs - 235 lines, NEW)
OnceCell<PTable>(64 processes max)addr_of_mut!()for Rust compatibility (no static mut warnings)Context Switching (swtch.S - 22 lines, NEW)
First User Process (initcode.S - 10 lines, NEW)
x /8xb 0x210001shows incrementing valuesTrap Frame Extension (src/x86.rs)
rcr2(),stosb(),stosl(),loadgs()pdx(),ptx(),pgaddr(),pte_addr(),pte_flags()Trap Assembly Updates (trapasm.S)
Segment Descriptor Updates (src/vm.rs)
Constants Organization (src/constants.rs)
Parameter Updates (src/param.rs)
Debugging Support (src/spinlock.rs - 30 lines, NEW)
Main Control Flow (src/lib.rs)
Timer Configuration (src/lapic.rs)
Build System (Makefile)
Minor Changes
.gdbinit.tmpl: Commented outlayout splitfor cleaner debuggingconsole.rs: Added comment placeholder for future myproc integrationkernel.ld: Whitespace fix (tabs vs spaces)Privilege Level Isolation:
Constraints Met:
#[repr(C)]for hardware-visible structuresTesting:
make clean && makecompletes with 0 warnings, 0 errorsmake qemuboots and enters scheduler