summaryrefslogtreecommitdiff
path: root/kernel/src/lib.rs
blob: 48cb93dd209e446261ff7c666c57f1414cabafaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#![no_main]
#![feature(compiler_builtins_lib)]
#![no_std]

extern crate compiler_builtins;

mod vga_text;

use core::fmt::Write;


#[no_mangle]
pub extern "C" fn _start() -> ! {
    let mut stdout = vga_text::OStream::new();
    stdout.clear();

    write!(&mut stdout, "hello world!");

    core::iter::successors(Some(0), |n| Some(n + 1))
        .for_each(|n|
            write!(&mut stdout, "hello world {}!", n).unwrap()
        );

    loop {}
}

#[panic_handler]
#[no_mangle]
pub extern "C" fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
    loop {}
}