コード例 #1
0
ファイル: ac_init.c プロジェクト: winksaville/sadie
void ac_init(ac_uptr ptr, ac_uint word) {
  ac_printf("ac_init: flags=0x%x\n", get_flags());

#if 1
  // Usng the multiboot2 header conflicts with
  // ACPI so for now just map the first 3Gib+.
  // I can't map all of it because the default
  // for my local APIC is 0xfee00000, will look
  // at moving it above 4Gib so we can map all
  // of the lower 4Gib as RAM.
  init_early_page_tables(0ll, 0xE0000000);
#else
  // Create initial page table
  initial_page_table(ptr, word);
#endif

  // Initialize interrupt descriptor table and apic since
  // they are not done by default, yet.
  initialize_intr_descriptor_table();

  // Initialize receptor module
  AcReceptor_early_init();

  // Initialize Advanced Programmable Interrupt Controller
  if (apic_early_init() != 0) {
    /** reset */
    ac_printf("ABORTING: file ac_init; initialize_apic failed\n");
    reset_x86();
  }

  // Initialize tsc
  ac_tsc_init();

  // Initialize perf and power msrs
  msr_perf_power_x86_init();

  // Initialize threading module
  ac_thread_early_init();

  // Initialize ioapic
  ioapic_early_init();

  // Initialize keyboard module
  ac_keyboard_early_init();

  // Initialize ac_time
  AcTime_early_init();

  // Enable interrupts
  sti();

  ac_printf("ac_init:-flags=0x%x\n", get_flags());
}
コード例 #2
0
ファイル: test.c プロジェクト: cci-smoketests/sadie
int main(void) {
  ac_bool error = AC_FALSE;

  initialize_intr_descriptor_table();

  error |= test_interrupts();

  if (!error) {
    ac_printf("OK\n");
  }

  return error;
}