Move PIT test to test module

This commit is contained in:
Josh Holtrop 2023-11-25 21:01:46 -05:00
parent 8cfa7bc009
commit db2814596b
2 changed files with 13 additions and 6 deletions

View File

@ -93,15 +93,10 @@ void hulk_start()
resume_interrupts(); resume_interrupts();
/* Check that PIT millisecond interrupt is firing. */ Test.run();
size_t uptime = Time.uptime();
while (Time.uptime() <= uptime)
{
}
Klog.writefln("\a5HULK Initialization Complete!"); Klog.writefln("\a5HULK Initialization Complete!");
/* Run kernel tests. */ /* Run kernel tests. */
Test.run();
/* Idle loop. */ /* Idle loop. */
Time.msleep(1); Time.msleep(1);

View File

@ -5,6 +5,7 @@ module hulk.test;
import hulk.klog; import hulk.klog;
import hulk.list; import hulk.list;
import hulk.time;
struct Test struct Test
{ {
@ -14,10 +15,21 @@ struct Test
public static void run() public static void run()
{ {
Klog.writefln("\a3Running kernel tests"); Klog.writefln("\a3Running kernel tests");
test_pit();
test_list(); test_list();
Klog.writefln("\a3Kernel tests complete"); 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() private static void test_list()
{ {
Klog.writefln("Testing list..."); Klog.writefln("Testing list...");