Skip to content

Commit

Permalink
feat(x86_64): add dump arch idt shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Dec 1, 2022
1 parent df97153 commit bfa098c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions hal-x86_64/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ static INTERRUPT_CONTROLLER: InitOnce<Controller> = 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<H: Handlers<Registers>>() {
tracing::info!("intializing IDT...");
Expand Down
16 changes: 8 additions & 8 deletions src/arch/x86_64/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit bfa098c

Please sign in to comment.