diff options
author | natrixaeria <upezu@student.kit.edu> | 2019-10-25 21:16:04 +0200 |
---|---|---|
committer | natrixaeria <upezu@student.kit.edu> | 2019-10-25 21:16:04 +0200 |
commit | a107c7acfc0e4dd34e55a3e43a9f48bda9644393 (patch) | |
tree | 4a4d04dc7dad3e9683dd9eef2802686885374f6e /kernel/src/lib.rs | |
parent | 9a21c47ff84eed1001acec3b492105cdc2d9220b (diff) |
Create a print function
Diffstat (limited to 'kernel/src/lib.rs')
-rw-r--r-- | kernel/src/lib.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index a27f0a7..48cb93d 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,6 +1,6 @@ +#![no_main] #![feature(compiler_builtins_lib)] #![no_std] -#![no_main] extern crate compiler_builtins; @@ -11,11 +11,16 @@ 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 {} } |