Wrong Time
Hi
I'm using dosemu and i'm getting four hours ahead report when i use TIME at the DOS prompt...
I'm sure it's something stupid but i can't figure it out so far ... HELP PLEASE ...
thanks in advance
Signature · 1 line
Guillermo Gomez <[email protected]>
Quoted 2 lines · Guillermo Gomez
I'm using dosemu and i'm getting four hours ahead report when i use TIME at the DOS prompt...
Looking at your email headers you're in the EST5EDT timezone area (like me) and are currently four hours off of UTC - which you probably keep on your hardware clock. dosemu probably uses the hardware clock.
Most obvious solution is to store localtime in the hardware clock instead of UTC.
Signature · 10 lines
Ross Vandegrift [email protected] A Pope has a Water Cannon. It is a Water Cannon. He fires Holy-Water from it. It is a Holy-Water Cannon. He Blesses it. It is a Holy Holy-Water Cannon. He Blesses the Hell out of it. It is a Wholly Holy Holy-Water Cannon. He has it pierced. It is a Holey Wholly Holy Holy-Water Cannon. He makes it official. It is a Canon Holey Wholly Holy Holy-Water Cannon. Batman and Robin arrive. He shoots them.
Quoted 1 line · Ross Vandegrift
dosemu probably uses the hardware clock.
no it doesn't. Well if you run dosemu as root, enable direct port i/o to the cmos and install appropriate BIOS handlers, then, with quite a bit of effort it could use the hardware clock.
Otherwise it doesn't, and DOSEMU operates an emulated RTC and CMOS that return the local Linux time. And that local time was wrong because of a misconfiguration in some Linux distributions wrt libc5 binaries, that causes DOSEMU to believe that its timezone is UTC.
Bart
Quoted 2 lines · Guillermo Gomez
I'm using dosemu and i'm getting four hours ahead report when i use TIME at the DOS prompt...
which version of DOSEMU? Which Linux distribution?
Quoted 2 lines
I'm sure it's something stupid but i can't figure it out so far ... HELP PLEASE ...
I guess that gettimeofday() thinks it's GMT for some reason. Possibly you're using the dosemu 1.0.2.x binary which is statically linked to libc5.
Try
TZ=UTC-4 xdosemu
or
TZ=UTC-4 dosemu
alternatively check this symbolic link:
ls -l /usr/share/zoneinfo/localtime /usr/share/zoneinfo/localtime -> /etc/localtime if it doesn't exist then do
ln -s /etc/localtime /usr/share/zoneinfo/localtime (as root)
Bart