diff --git a/rust_experiments/src/lib.rs b/rust_experiments/src/lib.rs index 257d36e..6faa7a9 100644 --- a/rust_experiments/src/lib.rs +++ b/rust_experiments/src/lib.rs @@ -60,11 +60,13 @@ pub extern fn rust_main() { timer = 0; } - if count > 200 && count < 300 { + /* + if count > 200 && count % 3 == 0 { unsafe { call_interrupt(); } } + */ } loop {} diff --git a/rust_experiments/src/long_mode_init.asm b/rust_experiments/src/long_mode_init.asm index 393458a..a09ac67 100644 --- a/rust_experiments/src/long_mode_init.asm +++ b/rust_experiments/src/long_mode_init.asm @@ -24,7 +24,7 @@ long_mode_start: hlt spin_loop_64: - mov rcx, 0xffff_fff + mov rcx, 0xffff_ff .loop: dec rcx cmp rcx, 0 @@ -71,7 +71,7 @@ get_rdtsc: ret call_interrupt: - int 5 + int 9 ret sample_handler: @@ -98,7 +98,7 @@ sample_handler: call spin_loop_64 iretq -%define int_num 5 +%define int_num 9 setup_IDT: lidt [idt64.pointer] mov rax, sample_handler @@ -112,6 +112,11 @@ setup_IDT: ret setup_PIC: + mov al, 0xfd + out byte 0x21, al + mov al, 0xff + out byte 0xa1, al + sti ret idt64: