//! The PC's side of the `arch` interface (see src/arch/mod.rs). Stage 22 //! adds no new code for x86_64: these are thin names for the pieces that //! already exist elsewhere in src/, which stay exactly where they were. /// Text out: COM1, the serial port (src/serial.rs). pub mod console { pub fn write_str(s: &str) { crate::serial::_print(format_args!("{}", s)); } } /// GDT, IDT, the PICs, then `sti` (lib.rs's `init`). pub mod interrupts { pub fn init() { crate::init(); } pub fn enable() { ::x86_64::instructions::interrupts::enable(); } } /// The PIT tick count (src/interrupts.rs). pub mod timer { pub fn ticks() -> u64 { crate::interrupts::ticks() } } /// Paging: the bootloader turned it on; src/memory.rs takes over. pub mod paging { pub use crate::memory::init; } /// End the QEMU run: 0 -> exit code 33, anything else -> 35 (isa-debug-exit). pub fn exit(code: u32) -> ! { crate::exit_qemu(if code == 0 { crate::QemuExitCode::Success } else { crate::QemuExitCode::Failed }); crate::hlt_loop() } /// Stop this CPU for good. pub fn halt() -> ! { crate::hlt_loop() }