// #![allow(clippy::print_literal)]
use crate::{logger, SCHEDULER};

use super::{gdt, interrupts};

/// x86_64 initialization
pub fn init() {
   let result = logger::init();
   match result {
      Ok(_) => {}
      Err(err) => error!("{}", err),
   }
   gdt::init();

   use crate::scheduler::Priority;
   let mut scheduler = SCHEDULER.lock();
   use Priority::*;
   let process_0 = scheduler.new_process(High);
   scheduler.add_process(process_0);
   drop(scheduler);

   interrupts::init_idt();

   unsafe { interrupts::PICS.lock().initialize() };
   x86_64::instructions::interrupts::enable();
}
