#include <stdio.h>
#include <dos.h>
#include <conio.h>
int main()
{
    int i;
    printf("CMOS Dump (format [address=value])");
    for(i=0;i<128;i++)
    {
        outp(0x70,i);
        if(i%8==0)printf("\n");
        printf(" [%2x=%2x] ",i,inp(0x71));
    }
}

This program compile but not run ,it give runtime error.
How to solve it??

Recommended Answers

All 8 Replies

http://www.daniweb.com/forums/thread119232.html
You're still not listening.

The OS does NOT allow you to go poking around the hardware in any manner you like. Even if you do manage to get it to compile, that's no guarantee of success.

Plus, saying "an error" is meaningless. Provide actual details.

hi..Salem
I m looking for bios password...so trying to open 70h port.
it gives runtime error like this.... Abc.exe has encountered a problem and needs to close. We are sorry for the inconvenience.

send error report don't send
how to solve it??

i am using windows xp

With regard to the subject, NT and XP are quite alike.

Hi..mitrmkar
Thanks..for solving problem to open port
I want to read cmos..value of bios data is stored in 1DH 1CH..my code is

void readpasschecksum()
{
     int i,j=0;
    for(i=0x10;i<=0x2d;i++)
    {
    outp(0x70,i);
    j=j+inp(0x71);
    }
    printf("[Check sum cal from 0x10 to 0x2d = %x]\n",j);
    outp(0x70,0x2e);
    printf(" [ 0x2e = %x ]\n",inp(0x71));
    outp(0x70,0x2f);
    printf(" [ 0x2f = %x ]\n",inp(0x71));
    checksumcal = readcmos(0x1D); /*hashed value is stored at 1DH and 1CH
here is problem it can not read cmos
*/
    
    checksumcal = checksumcal*256+readcmos(0x1C);
    if(seerun==1)
    {
      
        printf("The check sum = %u ",checksumcal);
        
    }
}

port 1DH and 1CH accessing..through porttalk
but when read cmos as i mentioned in code program can not run...it stops what to do??

Use winio perhaps? http://www.internals.com/
But this is really just a hack to get your hack to work.

There are some tutorials on the net for doing this "properly" using the proper access mechanisms through the NT drivers, but they don't make for very easy reading.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.