root/core/bios.inc

Revision 75d4dec2f651c9f25fa95d6b6960db7c4dcfd7a0, 1.2 KB (checked in by H. Peter Anvin <hpa@…>, 3 years ago)

core: hook INT 1Ch for a simple monotonic timer

The BIOS_timer variable at 4C6h is somewhat unreliable... it is
documented to wrap at "midnight", norminally after 1627419 ticks
(0x18d51b), which is a rather awkward number to deal with modulo.
Instead, hook the INT 1Ch secondary timer interrupt and just count a
simple incrementing variable.

Signed-off-by: H. Peter Anvin <hpa@…>

  • Property mode set to 100644
Line 
1;; -----------------------------------------------------------------------
2;;
3;;   Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
4;;
5;;   This program is free software; you can redistribute it and/or modify
6;;   it under the terms of the GNU General Public License as published by
7;;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8;;   Boston MA 02111-1307, USA; either version 2 of the License, or
9;;   (at your option) any later version; incorporated herein by reference.
10;;
11;; -----------------------------------------------------------------------
12
13;;
14;; bios.inc
15;;
16;; Header file for the BIOS data structures etc.
17;;
18
19%ifndef _BIOS_INC
20%define _BIOS_INC
21                global BIOS_fbm, BIOS_timer
22
23                ; Interrupt vectors
24                absolute 4*1Ch
25BIOS_timer_hook resd 1
26
27                absolute 4*1Eh
28fdctab          equ $
29fdctab1         resw 1
30fdctab2         resw 1
31
32                absolute 0400h
33serial_base     resw 4                  ; Base addresses for 4 serial ports
34                absolute 0413h
35BIOS_fbm        resw 1                  ; Free Base Memory (kilobytes)
36                absolute 0462h
37BIOS_page       resb 1                  ; Current video page
38                absolute 046Ch
39BIOS_timer      resw 1                  ; Timer ticks
40                absolute 0472h
41BIOS_magic      resw 1                  ; BIOS reset magic
42                absolute 0484h
43BIOS_vidrows    resb 1                  ; Number of screen rows
44
45%endif ; _BIOS_INC
Note: See TracBrowser for help on using the browser.