os_delay with HPET interrupt #80
Replies: 4 comments 4 replies
-
|
Thanks! I've updated the I'll try the periodic HPET interrupt code you provided as well. |
Beta Was this translation helpful? Give feedback.
-
|
I've added the one shot timer code you provided - ReturnInfinity/BareMetal@ab6eed0 Legacy replacement mode is enabled in Pure64 now so HPET timer 0 maps to IRQ 2 and HPET timer 1 maps to IRQ 8 by default. |
Beta Was this translation helpful? Give feedback.
-
|
Tried this code on my own bare metal and it didn't worked. |
Beta Was this translation helpful? Give feedback.
-
|
Here's C code to initialize the APIC timer. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I changed os_hpet_read / os_hpet_write. One of the two was clobbering a register and now both use less instructions. os_hpet_read only changes the output register.
Add a dummy hpet interrupt (IRQ 5, INT 0x23). os_delay halts between checks, otherwise the loop should be the same.
I intended this code to match the project's style. If there's anything different, or other changes, please send me a note, I'll edit the post until we're in sync.
BareMetal really needs an IRQ and INT allocator, so different drivers avoid stepping on each other.
Commented is the code to activate a periodic HPET interrupt. Eventually should be a separate routine that takes the interval in microseconds instead of a hardcoded value.
Beta Was this translation helpful? Give feedback.
All reactions