diff --git a/hal-x86_64/src/interrupt.rs b/hal-x86_64/src/interrupt.rs index b46f13ebc..85f885a0b 100644 --- a/hal-x86_64/src/interrupt.rs +++ b/hal-x86_64/src/interrupt.rs @@ -100,6 +100,10 @@ static INTERRUPT_CONTROLLER: InitOnce = InitOnce::uninitialized(); impl Controller { // const DEFAULT_IOAPIC_BASE_PADDR: u64 = 0xFEC00000; + pub fn idt() -> spin::MutexGuard<'static, idt::Idt> { + IDT.lock() + } + #[tracing::instrument(level = "info", name = "interrupt::Controller::init")] pub fn init>() { tracing::info!("intializing IDT..."); diff --git a/src/arch/x86_64/shell.rs b/src/arch/x86_64/shell.rs index aea6dcf2f..1d488d6e6 100644 --- a/src/arch/x86_64/shell.rs +++ b/src/arch/x86_64/shell.rs @@ -7,16 +7,16 @@ pub const DUMP_ARCH: Command = Command::new("arch") .with_help("print the global descriptor table (GDT)") .with_fn(|_| { let gdt = super::interrupt::GDT.get(); - tracing::info!(?gdt); + tracing::info!(GDT = ?gdt); + Ok(()) + }), + Command::new("idt") + .with_help("print the interrupt descriptor table (IDT)") + .with_fn(|_| { + let idt = super::interrupt::Controller::idt(); + tracing::info!(IDT = ?idt); Ok(()) }), - // Command::new("idt") - // .with_help("print the interrupt descriptor table (IDT)") - // .with_fn(|_| { - // let gdt = super::interrupt::GDT.get(); - // tracing::info!(?gdt); - // Ok(()) - // }), ]); pub fn dump_timer(_: &str) -> Result<(), shell::Error> {