Format: Display memory values in hex

This commit is contained in:
August 2025-07-17 23:28:06 -04:00
parent 74ac9835c3
commit d1ea875699
Signed by: shibedrill
GPG Key ID: 5FE0CB25945EFAA2
5 changed files with 25 additions and 21 deletions

View File

@ -53,7 +53,7 @@ You do not need to clean any files after making changes. The `lib`, `kernel`, an
### Configuration ### Configuration
- Variable `LIMINEDIR`: Location of binary files for limine. Default is `/usr/share/limine`. - Variable `LIMINEDIR`: Location of binary files for limine. Default is `/usr/share/limine`.
- Variable `TARGET`: rustc target triple to compile for. Default is `x86_64-unknown-none`. Options are listed [here](#targets). - Variable `TARGET`: rustc target triple to compile for. Default is `x86_64-unknown-none`. Options are listed [in the targets section](#targets).
- Argument `-p`: Rust build profile to use. Default is `dev`. Options are `dev` and `release`. - Argument `-p`: Rust build profile to use. Default is `dev`. Options are `dev` and `release`.
> [!NOTE] > [!NOTE]

View File

@ -1,8 +1,15 @@
// Copyright (c) 2025 shibedrill // Copyright (c) 2025 shibedrill
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "riscv64", target_arch = "loongarch64")))] #[cfg(not(any(
compile_error!("Gila does not support compiling for this architecture! Supported architectures are: x86_64, aarch64, riscv64, loongarch64"); target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "loongarch64"
)))]
compile_error!(
"Gila does not support compiling for this architecture! Supported architectures are: x86_64, aarch64, riscv64, loongarch64"
);
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
pub mod x86_64; pub mod x86_64;

View File

@ -19,24 +19,16 @@ lazy_static! {
// Recoverable exception: Occurs on division failure. // Recoverable exception: Occurs on division failure.
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
pub extern "C" fn x86_divide_error() { pub extern "C" fn x86_divide_error() {}
}
// Recoverable exception: Occurs on failure in BOUND instruction. // Recoverable exception: Occurs on failure in BOUND instruction.
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
pub extern "C" fn x86_bound_range() { pub extern "C" fn x86_bound_range() {}
}
// Recoverable exception: Invalid opcode. // Recoverable exception: Invalid opcode.
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
pub extern "C" fn x86_invalid_opcode() { pub extern "C" fn x86_invalid_opcode() {}
}
// Recoverable exception: FPU not available or enabled. // Recoverable exception: FPU not available or enabled.
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
pub extern "C" fn x86_device_unavailable() { pub extern "C" fn x86_device_unavailable() {}
}

View File

@ -180,9 +180,14 @@ unsafe extern "C" fn main() -> ! {
log_trace!("{log_msg}"); log_trace!("{log_msg}");
let total = usable + reclaimable + hardware + unusable; let total = usable + reclaimable + hardware + unusable;
log_info!( log_info!(
"Boot: Memory report:\n\t\tFree: {usable}\n\t\tAvailable: {reclaimable}\n\t\tUsable: {}\n\t\tHardware: {hardware}\n\t\tUnusable: {unusable}\n\t\tTotal: {}", "Boot: Memory report:
\tFree: 0x{usable:X}
\tAvailable: 0x{reclaimable:X}
\tUsable: 0x{:X}
\tHardware: 0x{hardware:X}
\tUnusable: 0x{unusable:X}
\tTotal: 0x{total:X}",
usable + reclaimable, usable + reclaimable,
total
); );
} else { } else {
panic!("Memory map contains no entries"); panic!("Memory map contains no entries");