1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! AArch64 architecture support for RuVix Cognition Kernel
//!
//! This crate provides low-level AArch64 support including:
//! - Boot sequence and early initialization
//! - Memory Management Unit (MMU) configuration
//! - Exception handling (sync, IRQ, FIQ, SError)
//! - System register access
//!
//! # Memory Layout
//!
//! ```text
//! 0x0000_0000_0000_0000 - 0x0000_FFFF_FFFF_FFFF: User space (TTBR0_EL1)
//! 0xFFFF_0000_0000_0000 - 0xFFFF_FFFF_FFFF_FFFF: Kernel space (TTBR1_EL1)
//! ```
//!
//! # Boot Sequence
//!
//! 1. Assembly entry point (`_start`) disables interrupts
//! 2. Stack pointer initialized
//! 3. BSS section cleared
//! 4. `early_init()` called to set up MMU
//! 5. Exception vectors configured
//! 6. Jump to `kernel_main()`
// Re-export key types
pub use ;
pub use Mmu;
pub use *;
/// AArch64 page size (4KB)
pub const PAGE_SIZE: usize = 0x1000;
/// AArch64 page shift (log2 of page size)
pub const PAGE_SHIFT: usize = 12;
/// Kernel virtual base address (upper half)
pub const KERNEL_VIRT_BASE: usize = 0xFFFF_0000_0000_0000;
/// Physical RAM base (platform-specific, QEMU virt = 0x4000_0000)
pub const PHYS_RAM_BASE: usize = 0x4000_0000;
pub const PHYS_RAM_BASE: usize = 0x0000_0000;
/// Exception vector alignment requirement (2KB = 0x800)
pub const VECTOR_ALIGNMENT: usize = 0x800;
/// Convert virtual address to physical (simple offset for identity mapping)
pub const
/// Convert physical address to virtual (simple offset for identity mapping)
pub const