summaryrefslogtreecommitdiffstats
path: root/bins/info/src/main.rs
blob: cf1bc9fcd7c297491ba6d6d0c0a876c2891e170b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! info — show system information via the exports table.

#![no_std]
#![no_main]

#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
    loop { core::hint::spin_loop(); }
}

fn put(exports: &rsapi::Exports, s: &str) {
    (exports.put_line)(rsapi::Line { ptr: s.as_ptr(), len: s.len() });
}

#[unsafe(no_mangle)]
pub extern "C" fn efi_main(exports: &'static rsapi::Exports, _argc: usize, _argv: *const rsapi::Arg) -> i32 {
    let mut t = rsapi::RtcTime { year: 0, month: 0, day: 0, hour: 0, minute: 0, second: 0, _pad: 0 };
    (exports.rtc_now)(&mut t);
    put(exports, "rs-dos v0.6.0 - external info");
    put(exports, "kernel: rsnix 0.6.0");
    0
}