message: add gap to avoid the usage of the APIC region as common memory
diff: @@ -62,14 +62,28 @@ fn detect_from_multiboot_info() -> Result<(), ()> {
  }
  fn detect_from_limits() -> Result<(), ()> {
  + let apic_gap = 0xFE000000;
  let limit = get_limit();
  if limit == 0 {
  return Err(());
  }
  + // add gap for the APIC
  + if limit > apic_gap {
  + let entry = FreeListEntry::new(mm::kernel_end_address().as_usize(), apic_gap);
  + PHYSICAL_FREE_LIST.lock().list.push_back(entry);
  + if limit > 0x100000000 {
  + let entry = FreeListEntry::new(0x100000000, limit - 0x100000000);
  + PHYSICAL_FREE_LIST.lock().list.push_back(entry);
  + TOTAL_MEMORY.store(limit - (0x100000000 - apic_gap), Ordering::SeqCst);
  + } else {
  + TOTAL_MEMORY.store(apic_gap, Ordering::SeqCst);
  + }
  + } else {
  let entry = FreeListEntry::new(mm::kernel_end_address().as_usize(), limit);
  - TOTAL_MEMORY.store(limit, Ordering::SeqCst);
  PHYSICAL_FREE_LIST.lock().list.push_back(entry);
  + TOTAL_MEMORY.store(limit, Ordering::SeqCst);
  + }
  Ok(())
  }
  