rust-kernel
Rustbelt: a hobby x86_64 kernel written in Rust
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | //! QEMU's `virt` board (`qemu-system-aarch64 -M virt -cpu cortex-a53`).
//!
//! Its memory map (QEMU's hw/arm/virt.c), all inside the first 2 GiB:
//!
//! ```text
//! 0x0800_0000 GICv2 distributor (GICD) } the first GiB:
//! 0x0801_0000 GICv2 CPU interface (GICC) } devices
//! 0x0900_0000 PL011 UART }
//! 0x0a00_0000 32 virtio-mmio slots, 0x200 each
//! 0x4000_0000 RAM (128 MiB by default) } the second GiB: RAM
//! QEMU puts the device tree here for an ELF kernel;
//! we load at 0x4020_0000 (link.ld)
//! ```
//!
//! `configure` reads the real addresses from the device tree; the constants
//! below are only the fallback (and what the first line is printed with).
use Pl011;
use ;
use crateFdt;
use crateGicV2;
use format;
use String;
use Vec;
use ;
pub const UART_BASE: usize = 0x0900_0000;
pub const GICD_BASE: usize = 0x0800_0000;
pub const GICC_BASE: usize = 0x0801_0000;
/// The EL1 virtual timer: PPI 11 = INTID 27.
pub const TIMER_IRQ: u32 = 27;
pub const RAM_BASE: u64 = 0x4000_0000;
pub static VIRT: Virt = Virt ;
/// First GiB devices, second GiB RAM (QEMU allows more RAM above, but the
/// bring-up only maps the first GiB of it).
static MAP: = ;
|