summaryrefslogtreecommitdiffstats
path: root/bins/info/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bins/info/src/main.rs')
-rw-r--r--bins/info/src/main.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/bins/info/src/main.rs b/bins/info/src/main.rs
new file mode 100644
index 0000000..cf1bc9f
--- /dev/null
+++ b/bins/info/src/main.rs
@@ -0,0 +1,22 @@
1//! info — show system information via the exports table.
2
3#![no_std]
4#![no_main]
5
6#[panic_handler]
7fn panic(_info: &core::panic::PanicInfo) -> ! {
8 loop { core::hint::spin_loop(); }
9}
10
11fn put(exports: &rsapi::Exports, s: &str) {
12 (exports.put_line)(rsapi::Line { ptr: s.as_ptr(), len: s.len() });
13}
14
15#[unsafe(no_mangle)]
16pub extern "C" fn efi_main(exports: &'static rsapi::Exports, _argc: usize, _argv: *const rsapi::Arg) -> i32 {
17 let mut t = rsapi::RtcTime { year: 0, month: 0, day: 0, hour: 0, minute: 0, second: 0, _pad: 0 };
18 (exports.rtc_now)(&mut t);
19 put(exports, "rs-dos v0.6.0 - external info");
20 put(exports, "kernel: rsnix 0.6.0");
21 0
22}