uefi stuff
This commit is contained in:
parent
6d74772961
commit
fde952a383
21
ableos/Cargo.lock
generated
21
ableos/Cargo.lock
generated
|
@ -53,6 +53,7 @@ dependencies = [
|
||||||
"vga",
|
"vga",
|
||||||
"volatile 0.2.7",
|
"volatile 0.2.7",
|
||||||
"wasmi",
|
"wasmi",
|
||||||
|
"x86",
|
||||||
"x86_64",
|
"x86_64",
|
||||||
"y-compositor-protocol",
|
"y-compositor-protocol",
|
||||||
]
|
]
|
||||||
|
@ -419,6 +420,15 @@ version = "0.6.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
|
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "raw-cpuid"
|
||||||
|
version = "10.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "929f54e29691d4e6a9cc558479de70db7aa3d98cd6fe7ab86d7507aa2886b9d2"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rdrand"
|
name = "rdrand"
|
||||||
version = "0.8.1"
|
version = "0.8.1"
|
||||||
|
@ -739,6 +749,17 @@ dependencies = [
|
||||||
"parity-wasm",
|
"parity-wasm",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "x86"
|
||||||
|
version = "0.46.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6297379090b1be212a2d59dd57708c99b42b4bcbeee2ce6fb80babbe7b63e89a"
|
||||||
|
dependencies = [
|
||||||
|
"bit_field",
|
||||||
|
"bitflags",
|
||||||
|
"raw-cpuid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "x86_64"
|
name = "x86_64"
|
||||||
version = "0.14.7"
|
version = "0.14.7"
|
||||||
|
|
|
@ -50,6 +50,7 @@ log = "*"
|
||||||
pretty-hex = "0.2.1"
|
pretty-hex = "0.2.1"
|
||||||
unicode-width = "0.1.7"
|
unicode-width = "0.1.7"
|
||||||
picorand = "*"
|
picorand = "*"
|
||||||
|
x86 = "*"
|
||||||
# watson = "0.4"
|
# watson = "0.4"
|
||||||
|
|
||||||
[dependencies.rdrand]
|
[dependencies.rdrand]
|
||||||
|
|
|
@ -73,6 +73,16 @@ fn main(_handle: Handle, mut system_table: SystemTable<Boot>) -> Status {
|
||||||
warn!("UEFI Graphics Output Protocol is not supported");
|
warn!("UEFI Graphics Output Protocol is not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use uefi::proto::pi::mp::MpServices;
|
||||||
|
if let Ok(mp) = system_table.boot_services().locate_protocol::<MpServices>() {
|
||||||
|
let mp = mp.expect("Warnings encountered while opening GOP");
|
||||||
|
let mp = unsafe { &mut *mp.get() };
|
||||||
|
|
||||||
|
info!("Found MP Services");
|
||||||
|
// info!("{:?}", mp.get_number_of_processors().unwrap_success());
|
||||||
|
// info!("{:?}", mp.get_processor_info(0).unwrap_success());
|
||||||
|
}
|
||||||
|
|
||||||
// */
|
// */
|
||||||
// exit boot services
|
// exit boot services
|
||||||
kernel_main();
|
kernel_main();
|
||||||
|
@ -166,3 +176,5 @@ pub fn file_system() -> Result<SimpleFileSystem, Status> {
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
pub fn mp_handle() {}
|
||||||
|
|
|
@ -51,7 +51,9 @@ pub fn kernel_main() -> ! {
|
||||||
vterm0.set_cursor_position(60, 40);
|
vterm0.set_cursor_position(60, 40);
|
||||||
vterm0.characters[0][0].character = 'a';
|
vterm0.characters[0][0].character = 'a';
|
||||||
|
|
||||||
// start_facepalm();
|
//
|
||||||
|
|
||||||
|
start_facepalm();
|
||||||
sloop()
|
sloop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,10 @@ fn main() -> anyhow::Result<()> {
|
||||||
MachineType::Uefi86 => {
|
MachineType::Uefi86 => {
|
||||||
xshell::cmd!("cargo build --release --target=x86_64-unknown-uefi").run()?;
|
xshell::cmd!("cargo build --release --target=x86_64-unknown-uefi").run()?;
|
||||||
|
|
||||||
xshell::cmd!("uefi-run -b src/arch/uefi_86/firmware/OVMF-pure-efi.fd target/x86_64-unknown-uefi/release/ableos.efi").run()?;
|
xshell::cmd!(
|
||||||
|
"uefi-run -b src/arch/uefi_86/firmware/OVMF-pure-efi.fd target/x86_64-unknown-uefi/release/ableos.efi"
|
||||||
|
)
|
||||||
|
.run()?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue