summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2001-05-22 11:33:38 +0000
committertg <tg@FreeBSD.org>2001-05-22 11:33:38 +0000
commitd3711647e272442b95dbbceb1d2f4e0a7d19274a (patch)
tree6119cf6b6cde4a7a4ab607a3142e82a6a571b309 /usr.bin/doscmd
parent39e8f234c4a8cadbc8180764a202446bd1ed8f9b (diff)
downloadFreeBSD-src-d3711647e272442b95dbbceb1d2f4e0a7d19274a.zip
FreeBSD-src-d3711647e272442b95dbbceb1d2f4e0a7d19274a.tar.gz
Update BIOS time.
Submitted by: Igor Serikov <bt@turtle.pangeatech.com>
Diffstat (limited to 'usr.bin/doscmd')
-rw-r--r--usr.bin/doscmd/timer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/usr.bin/doscmd/timer.c b/usr.bin/doscmd/timer.c
index 41b3019..a91c8d1 100644
--- a/usr.bin/doscmd/timer.c
+++ b/usr.bin/doscmd/timer.c
@@ -8,6 +8,17 @@
static void
int08(regcontext_t *REGS)
{
+ struct timeval tv;
+ time_t tv_sec;
+ struct timezone tz;
+ struct tm tm;
+
+ gettimeofday(&tv, &tz);
+ tv_sec = tv.tv_sec;
+ tm = *localtime(&tv_sec);
+ *(u_long *)&BIOSDATA[0x6c] =
+ (((tm.tm_hour * 60 + tm.tm_min) * 60) + tm.tm_sec) * 182 / 10;
+
softint(0x1c);
}
OpenPOWER on IntegriCloud