message: make sure that the IDT is aligned to a page boundary
diff: @@ -97,7 +97,16 @@ impl IdtEntry {
  /// an "Unhandled Interrupt" exception.
  pub const IDT_ENTRIES: usize = 256;
  -static mut IDT: [IdtEntry; IDT_ENTRIES] = [IdtEntry::MISSING; IDT_ENTRIES];
  +#[repr(align(4096))]
  +struct IdtArray([IdtEntry; IDT_ENTRIES]);
  +
  +impl IdtArray {
  + pub const fn new() -> Self {
  + IdtArray([IdtEntry::MISSING; IDT_ENTRIES])
  + }
  +}
  +
  +static mut IDT: IdtArray = IdtArray::new();
  static mut IDTP: DescriptorTablePointer<IdtEntry> = DescriptorTablePointer {
  base: 0 as *const IdtEntry,
  limit: 0,
  @@ -110,9 +119,11 @@ pub fn install() {
  let is_init = IDT_INIT.swap(true, Ordering::SeqCst);
  if !is_init {
  + debug!("IDT address: 0x{:x}", &IDT.0 as *const _ as usize);
  +
  // TODO: As soon as https://github.com/rust-lang/rust/issues/44580 is implemented, it should be possible to
  // implement "new" as "const fn" and do this call already in the initialization of IDTP.
  - IDTP = DescriptorTablePointer::new_from_slice(&IDT);
  + IDTP = DescriptorTablePointer::new_from_slice(&IDT.0);
  };
  dtables::lidt(&IDTP);
  @@ -138,6 +149,6 @@ pub fn set_gate(index: u8, handler: usize, ist_index: u8) {
  );
  unsafe {
  - IDT[index as usize] = entry;
  + IDT.0[index as usize] = entry;
  }
  }
  