From db2814596b85435ca996a8d36fffedcc0344d1c3 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 25 Nov 2023 21:01:46 -0500 Subject: [PATCH] Move PIT test to test module --- src/hulk/hulk.d | 7 +------ src/hulk/test.d | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/hulk/hulk.d b/src/hulk/hulk.d index d59a8db..bc70315 100644 --- a/src/hulk/hulk.d +++ b/src/hulk/hulk.d @@ -93,15 +93,10 @@ void hulk_start() resume_interrupts(); - /* Check that PIT millisecond interrupt is firing. */ - size_t uptime = Time.uptime(); - while (Time.uptime() <= uptime) - { - } + Test.run(); Klog.writefln("\a5HULK Initialization Complete!"); /* Run kernel tests. */ - Test.run(); /* Idle loop. */ Time.msleep(1); diff --git a/src/hulk/test.d b/src/hulk/test.d index bee1b89..1aecdf5 100644 --- a/src/hulk/test.d +++ b/src/hulk/test.d @@ -5,6 +5,7 @@ module hulk.test; import hulk.klog; import hulk.list; +import hulk.time; struct Test { @@ -14,10 +15,21 @@ struct Test public static void run() { Klog.writefln("\a3Running kernel tests"); + test_pit(); test_list(); Klog.writefln("\a3Kernel tests complete"); } + private static void test_pit() + { + Klog.writefln("Testing PIT..."); + /* Check that PIT millisecond interrupt is firing. */ + size_t uptime = Time.uptime(); + while (Time.uptime() <= uptime) + { + } + } + private static void test_list() { Klog.writefln("Testing list...");