1
0
Fork 0
forked from koniifer/ableos

qprofiler integration

This commit is contained in:
Able 2022-02-07 03:42:57 -06:00
parent 45acef0c97
commit df86c272f3
4 changed files with 61 additions and 1 deletions

3
.gitignore vendored
View file

@ -2,4 +2,5 @@ repbuild/target
ableos/target ableos/target
aos_wasm_stress_test/target aos_wasm_stress_test/target
facepalm/target facepalm/target
shadeable/target shadeable/target
qprofiler

21
ableos/Cargo.lock generated
View file

@ -27,6 +27,7 @@ name = "ableos"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ab_glyph", "ab_glyph",
"acpi",
"bootloader", "bootloader",
"cpuio", "cpuio",
"externc-libm", "externc-libm",
@ -55,6 +56,17 @@ dependencies = [
"y-compositor-protocol", "y-compositor-protocol",
] ]
[[package]]
name = "acpi"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55237649c6e747ea67e5ed45125af5e6a35ea1250c5e44995eb6049a955bd004"
dependencies = [
"bit_field",
"log",
"rsdp",
]
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.7.6" version = "0.7.6"
@ -477,6 +489,15 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "rsdp"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66d3add2fc55ef37511bcf81a08ee7a09eff07b23aae38b06a29024a38c604b1"
dependencies = [
"log",
]
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.9" version = "1.0.9"

View file

@ -32,6 +32,11 @@ run-args = [
# A simple example of a boot image # A simple example of a boot image
"-drive", "-drive",
"file=disk.qcow2,if=none,id=drive0", "file=disk.qcow2,if=none,id=drive0",
# "-qmp",
# "unix:../qmp-sock,server,nowait"
] ]
test-args = [ test-args = [
"-device", "-device",
@ -53,6 +58,9 @@ picorand = "*"
# watson = "0.4" # watson = "0.4"
acpi = "4.1.0"
[dependencies.rdrand] [dependencies.rdrand]
version = "0.8.1" version = "0.8.1"
default-features = false default-features = false

View file

@ -1,5 +1,7 @@
#![allow(clippy::empty_loop)] #![allow(clippy::empty_loop)]
use acpi::AcpiTables;
use { use {
crate::{ crate::{
arch::{init, sloop}, arch::{init, sloop},
@ -72,6 +74,13 @@ pub fn kernel_main() -> ! {
mode.copy_to_buffer(); mode.copy_to_buffer();
} }
} }
if false {
// Currently not implemented
let acpi_handler = ACPI_struct {};
unsafe {
let table = AcpiTables::search_for_rsdp_bios(acpi_handler);
}
}
start_facepalm(); start_facepalm();
@ -112,3 +121,24 @@ pub fn generate_process_pass() -> u128 {
let ret = (gen.try_next_u64().unwrap() as u128) << 64 | (gen.try_next_u64().unwrap() as u128); let ret = (gen.try_next_u64().unwrap() as u128) << 64 | (gen.try_next_u64().unwrap() as u128);
ret ret
} }
// TODO: move to a better place
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct ACPI_struct {}
impl acpi::AcpiHandler for ACPI_struct {
unsafe fn map_physical_region<T>(
&self,
physical_address: usize,
size: usize,
) -> acpi::PhysicalMapping<Self, T> {
info!("PHYS ADDR: {:?}", physical_address);
info!("Size: {:?}", size);
todo!("map_physical_region");
}
fn unmap_physical_region<T>(region: &acpi::PhysicalMapping<Self, T>) {
todo!("unmap_physical_region");
}
}