Too late but it kinda works

This commit is contained in:
2026-02-11 15:19:10 +01:00
parent 53043fd3cd
commit 6fc08b5dbb
9 changed files with 570 additions and 59 deletions

View File

@@ -1,10 +1,10 @@
use core::time::Duration;
use alloc::format;
use log::info;
use crate::{
set_csr,
vga::{Color, Vga, FONT_WIDTH, WIDTH},
process::ExecutionContext, scheduler::scheduler, set_csr, vga::{Color, FONT_WIDTH, Vga, WIDTH}
};
pub const IRQ_M_TIMER: u8 = 1 << 7;
@@ -30,7 +30,7 @@ pub fn setup_next_timer_interrupt() {
);
}
}
pub fn timer_interrupt() {
pub fn timer_interrupt(interrupt_state: ExecutionContext) -> usize {
let current_time = elapsed_time_since_startup();
let seconds = current_time.as_secs();
let minutes = seconds / 60 % 60;
@@ -46,6 +46,7 @@ pub fn timer_interrupt() {
Color::BLACK,
)
};
scheduler(interrupt_state)
}
pub fn elapsed_time_since_startup() -> Duration {