feat: fireworks!

This commit is contained in:
Loïc Grégoire
2026-04-18 20:44:52 -04:00
parent 712a8012af
commit 8fc133cc3c
18 changed files with 186 additions and 127 deletions
+5 -9
View File
@@ -3,11 +3,10 @@ const r = @import("root");
const pl = r.pl;
const ke = r.ke;
const mm = r.mm;
const ex = r.ex;
const amd64 = @import("arch");
fn callback(_: ?*anyopaque) void {
std.log.info("Timer callback called", .{});
}
var thread0: ke.Thread = undefined;
pub fn init(boot_info: *pl.BootInfo) void {
mm.init(boot_info);
@@ -16,12 +15,9 @@ pub fn init(boot_info: *pl.BootInfo) void {
mm.late_init();
ke.sched.late_init();
var timer: ke.Timer = undefined;
var dpc: ke.Dpc = .init(callback);
timer.init();
ke.timer.set(&timer, std.time.ns_per_ms * 50, &dpc);
const sp = mm.heap.alloc(r.kib(16)) catch @panic("oom");
thread0.init(@intFromPtr(sp), r.kib(16), ex.fireworks.start, boot_info);
ke.sched.enqueue(&thread0);
while (true) {
std.atomic.spinLoopHint();