Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
VocalFan committed Nov 14, 2023
1 parent 74ebf82 commit fc794d3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
steps:
- name: Download LLVM
run: |
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.2/llvm-project-17.0.2.src.tar.xz" -OutFile llvm.tar.xz
$hash = (Get-FileHash llvm.tar.xz).Hash
$llvmurl = "https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.5/llvm-project-17.0.5.src.tar.xz"
Invoke-WebRequest -Uri $llvmurl -OutFile llvm.tar.xz
unxz llvm.tar.xz
tar -x --strip-components=1 -f llvm.tar
echo "hash=$hash" >> $env:GITHUB_OUTPUT
echo "hash=$llvmurl" >> $env:GITHUB_OUTPUT
id: download
- name: Generate cache keys
run: echo "dist=${{ runner.os }}-llvm-${{ steps.download.outputs.hash }}" >> $env:GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ endif()

if(OB_BUILD_LLVM)
ExternalProject_Add(llvm
URL https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.2/llvm-project-17.0.2.src.tar.xz
URL_HASH SHA256=351562b14d42fcefcbf00cc1f327680a1062bbbf67a1e1ca6acb64c473b06394
URL https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.5/llvm-project-17.0.5.src.tar.xz
URL_HASH SHA256=95d7eff82945cf05c16a1851d7b391fc2da726b87c1138125e3b6e4d300ab834
DOWNLOAD_NO_PROGRESS true
CMAKE_ARGS -Wno-dev
CMAKE_CACHE_ARGS ${LLVM_OPTS}
Expand Down
1 change: 1 addition & 0 deletions src/kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ param = { path = "../param" }
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9"
sha1 = "0.10"
sysinfo = "0.29.10"
termcolor = "1.2.0"
thiserror = "1.0"
tls = { path = "../tls" }
Expand Down
9 changes: 9 additions & 0 deletions src/kernel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use std::path::PathBuf;
use std::process::ExitCode;
use std::sync::Arc;
use std::time::SystemTime;
use sysinfo::{CpuExt, System, SystemExt};

mod arch;
mod arnd;
Expand Down Expand Up @@ -117,7 +118,9 @@ fn main() -> ExitCode {

// Show basic infomation.
let mut log = info!();
let hwinfo = System::new_all();

// Init information
writeln!(log, "Starting Obliteration Kernel.").unwrap();
writeln!(log, "System directory : {}", args.system.display()).unwrap();
writeln!(log, "Game directory : {}", args.game.display()).unwrap();
Expand All @@ -126,9 +129,15 @@ fn main() -> ExitCode {
writeln!(log, "Debug dump directory: {}", v.display()).unwrap();
}

// Param information
writeln!(log, "Application Title : {}", param.title()).unwrap();
writeln!(log, "Application ID : {}", param.title_id()).unwrap();

// Hardware information
writeln!(log, "Operating System : {} {}", hwinfo.long_os_version().unwrap_or_else(|| "Unknown OS".to_string()), hwinfo.kernel_version().unwrap_or_else(|| "Unknown Kernel".to_string())).unwrap();
writeln!(log, "CPU Information : {}", hwinfo.cpus()[0].brand()).unwrap();
writeln!(log, "Memory Available : {}/{} MB", hwinfo.available_memory()/1048576, hwinfo.total_memory()/1048576).unwrap(); // Convert Bytes to MB

print(log);

// Initialize foundations.
Expand Down

0 comments on commit fc794d3

Please sign in to comment.