summaryrefslogtreecommitdiff
path: root/kernel/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/lib.rs')
-rw-r--r--kernel/src/lib.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs
index 8ec68e5..15f027b 100644
--- a/kernel/src/lib.rs
+++ b/kernel/src/lib.rs
@@ -26,6 +26,7 @@ pub fn test_runner(tests: &[&dyn Fn(&mut OStream)]) {
#[no_mangle]
pub extern "C" fn _start() -> ! {
+ interrupts::gdt::init();
interrupts::table::init();
if cfg!(test) {
#[cfg(test)]
@@ -37,10 +38,19 @@ pub extern "C" fn _start() -> ! {
stdout.clear();
panic!("panic! at the disco");
- core::iter::successors(Some(0), |n| Some(n + 1))
- .for_each(|n| write!(&mut stdout, "hello world {}!", n).unwrap());
-
- x86_64::instructions::interrupts::int3();
+ /// TODO: write test
+ ///fn _loop(i: u64) -> u64 {
+ /// if i > 0b1010101001101101 {
+ /// return i;
+ /// }
+ /// let n = i;
+ /// let mut stdout = OStream::new();
+ /// write!(&mut stdout, "{:x}", &n as *const u64 as u64).unwrap();
+ /// _loop(i + 1)
+ ///}
+ ///_loop(0);
+ /// TODO: write test
+ ///x86_64::instructions::interrupts::int3();
loop {}
}
@@ -72,7 +82,6 @@ pub extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! {
info.message()
.unwrap_or(&format_args!("no panic information obtainable"))
);
- //loop{}
stderr.set_centered(false);
if cfg!(test) {
write!(serial::SerialStream::new(), "Testing failed\n").unwrap();