Re: Retrieving BIOS Tick count equivalent
- From: Bob Hauck <postmaster@xxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 22 Jul 2007 20:44:20 -0400
On Sun, 22 Jul 2007 19:51:01 -0000, philbo30 <masferfc@xxxxxxxxx> wrote:
Rewriting old lptcap DOS software for use with Red Hat Linux; looking
for the Linux system call that is equivalent to the old DOS "BIOS tick
count".
There isn't a direct equivalent. OTOH, there are some things that are
probably close enough to do what you need and are also portable.
BIOS tick count is timer ticks (1 tick = 54.9254 ms) since midnight in
the current day.
In Linux it can be one of several different rates depending on the
platform, none of which is 18.2 Hz (usually 100, 250, or 1000 Hz).
Inside the kernel you can obtain "jiffies", or ticks, but in userland
time is measured either from 1 Jan 1970 (the realtime clock) or from
"some unspecified time" that is almost always system boot (the monotonic
clock).
These get the time in different ways:
clock_gettime()
gettimeofday()
These are useful for figuring out the time of the last midnight (do you
want local midnite or GMT midnite?):
localtime()
gmtime()
mktime()
In real-mode, this information appears directly accessible via 0x1A;
not so with protected mode.
Doesn't matter. The hardware clock is programmed differently in Linux
anyway. And, it should be noted, in modern Windows as well. The real-
mode stuff is emulated.
--
-| Bob Hauck
-| "Reality has a well-known liberal bias." -- Stephen Colbert
-| http://www.haucks.org/
.
- References:
- Retrieving BIOS Tick count equivalent
- From: philbo30
- Retrieving BIOS Tick count equivalent
- Prev by Date: Retrieving BIOS Tick count equivalent
- Next by Date: Custom Software Development
- Previous by thread: Retrieving BIOS Tick count equivalent
- Next by thread: Custom Software Development
- Index(es):
Relevant Pages
|