From a107c7acfc0e4dd34e55a3e43a9f48bda9644393 Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Fri, 25 Oct 2019 21:16:04 +0200 Subject: Create a print function --- kernel/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'kernel/src/lib.rs') 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 {} } -- cgit v1.2.3-70-g09d2