diff options
| author | Miguel <m.i@gmx.at> | 2018-08-21 01:24:14 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-21 01:24:14 +0200 |
| commit | 8a5fbdabb24250a76feed770bce64d7e3e4f61de (patch) | |
| tree | 4e2aa197e160357a68dbf1d7b3853963b7f1caac /asm/pit.h | |
| parent | 690403fc51ecb51689cb72f224fccc0d301b7f7d (diff) | |
adding new pit code
Diffstat (limited to 'asm/pit.h')
| -rw-r--r-- | asm/pit.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/asm/pit.h b/asm/pit.h new file mode 100644 index 0000000..0bec3c4 --- /dev/null +++ b/asm/pit.h @@ -0,0 +1,25 @@ +/** + * @file + * + * PIT - Programmable Interval Timer + * + * config out timer on channel 0 : mode 2 (sys timer) + * * http://en.wikipedia.org/wiki/Intel_8253#Control_Word_Register + * * http://www.brokenthorn.com/Resources/OSDevPit.html + * int0 will be triggered ~25 times a second. + * + * The most magic is performed in pit_interrupt_handler which calls + * the c function responsible for task switching doing vary bad ass + * magic... + */ + +#include <stdint.h> + +/** Init PIT - 25 times a second*/ +void pit_init(); + +/** install this interrupt handler to your Interrupt Vector Table */ +void pit_interrupt_handler(); + +/** get number of ticks */ +uint32_t pit_get_ticks(); |
