#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??

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??

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.

This article has been dead for over six months. Start a new discussion instead.