Click to See Complete Forum and Search --> : Challenge: write to CMOS clock area


gordonwd
February 26th, 2003, 08:18 PM
Here's a real challenge: I have to port a piece of code from an old DOS program that made use of some unused bytes in the CMOS realtime clock area to get a couple of bytes of non-volatile memory (don't ask). On DOS or running in a Win9x DOS-box, this was done simply by directly using I/O ports 0x70 and 0x71 (e.g., "_inp(0x71)").

Now I've got to do this from a Win32 program running on XP. Is there a way to get to some sort of HAL API, which is probably where this capability might reside? I really don't want to have to write a whole **** XP driver just to read/write a couple of bytes in the CMOS memory!

Any ideas?

Doug Gordon

galathaea
February 26th, 2003, 08:28 PM
Since CMOS memory resides outside the physical memory map, I know of no way to do this on an NT machine except through a driver. Otherwise, I think it would violate the user mode security...