Skip to content

Commit

Permalink
refactor boot stubs to allow the kernel to return execution back to b…
Browse files Browse the repository at this point in the history
…oot stage during test runs
  • Loading branch information
Qix- committed Nov 23, 2023
1 parent 32862ad commit ae8fc93
Show file tree
Hide file tree
Showing 3 changed files with 376 additions and 162 deletions.
9 changes: 9 additions & 0 deletions oro-arch-x64/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ pub const ORO_BOOT_PAGE_TABLE_INDEX: u16 = 258;
///
/// Boot stages MUST NOT populate any memory in this region. The kernel
/// expects this region is completely empty.
#[cfg(not(oro_test))]
pub const KERNEL_SECRET_HEAP_PAGE_TABLE_INDICES: (u16, u16) = (259, 383);
#[cfg(oro_test)]
pub const KERNEL_SECRET_HEAP_PAGE_TABLE_INDICES: (u16, u16) = (259, 382);
/// During kernel tests, bootloader and kernel shared memory lives here
/// and must NOT be reclaimed or unmapped.
#[cfg(oro_test)]
pub const KERNEL_TEST_SHM_PAGE_TABLE_INDEX: u16 = 383;
/// All public heap allocations can be safely put here; inclusive.
///
/// Boot stages MUST NOT populate any memory in this region. The kernel
Expand All @@ -56,6 +63,8 @@ pub const KERNEL_PUBLIC_HEAP_PAGE_TABLE_INDICES: (u16, u16) = (384, 447);
/// initializing. Boot stages SHOULD utilize this region for any temporary
/// trampolines, memory maps, etc.
pub const USER_PAGE_TABLE_INDICES: (u16, u16) = (2, 255);
/// All kernel modules and code shall exist in this region.
pub const KERNEL_MODULE_PAGE_TABLE_INDICES: (u16, u16) = (448, 511);

#[derive(Ser2Mem, Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
Expand Down
Loading

0 comments on commit ae8fc93

Please sign in to comment.