UPTIME (English) 
Saturday, November 18 2017 . 06:42 AM


Introduction
UPTIME is a 16 bit DOS utility that display system uptime by automatically detecting when it was firstlyby automatically detecting when it was firstly booted. It replicates *NIX uptime, one of the basic UNIX commands which allows you to quickly confirm how long your system has been up and running since it was last rebooted or powered on.




Usage
UPTIME [-h|-r]


Examples:
UPTIME
Display current system uptime.

UPTIME -h
Shows this help screen.

UPTIME -r
Forces reseting the counter. Useful if it is not automatically detected properly during startup.


Technical details
UPTIME uses CMOS data area to retrieve current system date/time using the RTC (Real Time Clock). Since CMOS area is persistent, it uses CMOS alarm registers, to store when the system was first startedup. Almost no DOS programs use alarm capabilities, but if so, running UPTIME, will overwrite them.

There are different approaches to UPTIME in DOS, such as UPTIME 7.02 by Mark Aitchison. His approach is to get system boottime, by reading NUL: file timestamp. Unfortunately, this approach is not working in DOSBox and other emulators.

UPTIME has been specially optimized to run on pure DOS enviroments, no matter if the are on the top of physical machines, or virtual machines. It is written using JWASM 2.12 beta, with x86 assembly using DOS tiny memory model in order to keep it compact.


Requirements
- MS-DOS 2.0 compatible or later.
- 8088 CPU or later.
- 2 Kb. of free disk space.
- 4 Kb. of free available memory.



Sponsors



Download
- DOS binaries and source code (5 Kb. in ZIP format.


History
2.60 - 2017/08/13
- Added -r errorlevel (1).
- More 386 optimizations. Size reduced from 1,318 bytes to 1,314 bytes.
- Upgraded to ASMC to 2.25H.

2.50 - 2017/08/07
- More 386 optimizations. Size reduced from 1,330 bytes to 1,318 bytes.

2.40 - 2017/06/08
- 8086, 186 and 386 optimized versions.

2.30 - 2017/06/07
- Switched to ASMC 2.24.
- Added uppercase switches: -h, -H, -?, -r, -R, ...
- Added dash (-) and slash (/) switches separator: -h, /H.

2.20 - 2017/06/07
- Take advantage of proc uses to simplify code
- Remove GetAlarm time unused procedure.
- Other minor optimizations. Size reduced from 1.310 to 1.284 bytes.

2.10 2017/06/06
- Switch to UASM 2.35.
- Fixed waiting for key pressed in help.
- Size reduced from 1.312 to 1.310 bytes.

2.00 2017/06/06
- Totally rewritten in x86 assembler (JWASM 2.12).
- .COM size reduced in 40%.
- Added -r to force uptime reset.
- Improved CMOS check.

1.10 2017/06/02
- Formated output to mimic UNIX uptime.
- Added -h, -/, --help for help.
- Check CMOS is available.
- Increased capacity to 2147483648 seconds instead of 65535.
- Fixed uptime calculation.

1.00 2017/05/31
- First initial version.


License
UPTIME is provided free of charge covered by the GNU Lesser General Public License (LGPL).


Links
- Official UPTIME's website: nikkhokkho.sourceforge.net/static.php?page=UPTIME.

- Official author's website: www.javiergutierrezchamorro.com.