www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/28/15:31:53

From: <OneClickAway AT worldnet DOT att DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Newbie's problem with internal timer
Date: 28 Mar 1998 19:56:39 GMT
Organization: AT&T WorldNet Services
Lines: 36
Message-ID: <6fjkln$spk@bgtnsc02.worldnet.att.net>
NNTP-Posting-Host: 12.64.126.5
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I am a newbie to programming 32-bit DOS.  I am used to programming 16-bit
DOS, and using memory locations 0000:046C-0000:046F to find the value of
the internal timer.  However, when I make a program like this:

#include <sys/farptr.h>

void main(void) {
   _farpeekl(0x0000,0x046C);
}

I get a GP Fault when it is run.  This is the output the error generates:

Exiting due to signal SIGSEGV
General Protection Fault at eip=000015a8
eax=00000000 ebx=00000000 ecx=0000046c edx=00000000 esi=00000054
edi=0000a2c4
ebp=0004a288 esp=0004a278 program=E:\DJGPP\BIN\TIMER.EXE
cs: sel=00a7  base=832f2000  limit=0005ffff
ds: sel=00b7  base=832f2000  limit=0005ffff
es: sel=00b7  base=832f2000  limit=0005ffff
fs: sel=0000
gs: sel=00c7  base=00000000  limit=ffffffff
ss: sel=00b7  base=832f2000  limit=0005ffff

Call frame traceback EIPs:
  0x000015a8
  0x00001587
  0x00001b12

How can I find the value of the internal timer without getting a GP Fault? 
Can I still reprogram the timer frequency by writing to the 8253 control
register?

I don't know if this is important: I am using RHIDE under Windows 95 to
compile the code

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019