diff options
| author | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:06:33 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:17:15 +0200 |
| commit | 49fc3b6df25bea2aaccbe2b26735204e3ee4b809 (patch) | |
| tree | d16c76f6c62c6e268434efc4945135d431cb3fc2 /src/lib.rs | |
| parent | e148a5e329add10452d86ae8f2da97e545b7ecb2 (diff) | |
dev: add x86 PIT (programmable interrupt timer)
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -55,13 +55,16 @@ pub extern "C" fn _entry() -> ! { bss_start(), bss_end() ); + let interval = interrupt::pit::PIT::set_interval(500000); + println!("[init] timer interrupt set to {} ns", interval); // busy loop query keyboard interrupt::interrupt_enable(); pic_8259::allow(PicDeviceInt::KEYBOARD); let mut test_vec = Vec::<&str>::new(); + _test_proc_switch_to(); + // default test, should not reach test_vec.push("hello "); test_vec.push("world"); - _test_proc_switch_to(); for s in test_vec.iter() { println!("{s}"); } @@ -89,5 +92,6 @@ pub fn _test_proc_switch_to() { SCHEDULER.lock().insert_task(Task::create_dummy(3)); SCHEDULER.lock().insert_task(Task::create_dummy(4)); SCHEDULER.lock().insert_task(Task::create_dummy(5)); + pic_8259::allow(PicDeviceInt::TIMER); Scheduler::kickoff(); } |
