home *** CD-ROM | disk | FTP | other *** search
- Uptime - A System running timer by Kevin Withnall
- u8902741@wraith.cs.uow.edu.au
- Kevin Withnall 3:712/206.0 Fidonet
-
- This program was written because when trying to modify a cache, its handy to
- know that the stats the cache gives you are valid. ie if the cache has stopped
- 79% of transfers but the machine has only been up for 5 minutes, ten its
- probably not a good number to look at. however, if the machine was up for 2
- days, then its reaonable to use the percentage in attempting to modify the
- cache configuration to improve it.
-
- The way this works is it stays in memory after the first time it is run. ( a
- TSR ) This will from then on, whenever its called, give you a indication of how
- long sonce the program was first run. If you load this in the autoexec.bat file
- it will give you a fairly good estimate of how long the machine has been up.
-
- The output of the program uses dos functions 09h to pring the strings so
- therefore the output it totally re-directable. The program was written totally
- in assembler to make it as small and fast as possible.
-
- It works by looking at the clock about twice a second ( evey 10 times int 1Ch
- is called ) and if the seconds have changed, it will make a note of it and
- increase the number of secods. if this gets to 60, it will increase the minutes
- and reset the seconds etc. It uses a word for each number ( 16 bits ) even
- though its not necessary, its easy. The only limit on this, is when the days
- get to 65536 and then it will wrap around. Thats about 179 years so i dont
- think its a problem.
-
- Programmers can use this by calling interrupt 7Fh ( first make sure its not
- pointing at 0000:0000 in the interrupt table by using dos's function 35h )
- Then, once youre happy that int 7fh is pointing to a iret or another program,
- then call it with ah = 07h ( this programs number ) and al = 05h ( function to
- ask for signature ) After this call, ax should be 0067h to say that the program
- is there.
- Make sure that when you call it, ah is 07h as that is this programs number.
- every tsr i write uses int 7fh and has its own number. if you dont make ah =
- 07h it will ignore you and jump to the next thing in the chain.
-
- some of the other functions available are...
- al = 00h This will cause normal operation. ie if its the 10th time to be
- called like this, check the clock etc. this is called from the
- int 1C handler and you probably wont need to use this.
- al = 01h This gets you the address of the int 7Fh handler, ive never
- needed to use this but i thought it may be handy.
- it returns it in ax:bx
- al = 02h This will get the operation status of the program. ie al = 0 (
- program is disabled ) or al = 1 ( program is enabled )
- al = 03h This enables the timer
- al = 04h This disables the timer
- al = 05h This give a number 0067h in ax to say that the program is
- installed and working.
- al = 06h get the time since installation
- This returns
- ax:sec
- bx:min
- cx:hour
- dx:day
- any other al value will cause the carry flag to be set.
-
-
- If you like this program, please send mail to me at ano of the above addresses.
- Id like to hear if anyone is using this.