Re: Retrieving BIOS Tick count equivalent



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/
.



Relevant Pages

  • Re: [SLE] Partition Magic vs. Linux partitioner
    ... drive is multiboot it only boots it is a LINUX system only ... and was created as a LINUX system. ... 2.the Windows partition is larger than about 8 GB (more ...
    (SuSE)
  • Re: ELF loading
    ... Is there anything like ActiveX on a Linux system, ... a data source and can convert from one data source to another transparently? ...
    (alt.lang.asm)
  • Re: How to cancel printing or to delete a print job that is stuck
    ... printer that is on the linux system? ... Jobs get a reference count associated with them from the spooler and the ...
    (microsoft.public.windowsxp.print_fax)
  • Re: how to produce cross-platform exe file?
    ... In linux system, I can launch the app by this commmand: ... I can launch the app by this command: ... I want to make a exe file, so that by double clicking the exe file, ...
    (Debian-User)
  • Re: Mac OS Trojan, will this affect Linux?
    ... there's bound to be some users that swap over to a Linux system and ... including Linux. ... I assume when you are talking registry you are referring to Windows, ...
    (alt.os.linux.suse)