Reading CMOS memory - How? - OS2

This is a discussion on Reading CMOS memory - How? - OS2 ; Hello! I would like to write a program that will among others check some locations in computers "CMOS" memory(RTC-CMOS). How is the best way to do this? I have read on some places that it has something to do with ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Reading CMOS memory - How?

  1. Reading CMOS memory - How?

    Hello!

    I would like to write a program that will among others check some
    locations in computers "CMOS" memory(RTC-CMOS).

    How is the best way to do this?

    I have read on some places that it has something to do with ports 70h
    and 71h.
    Are they accessible in OS/2? How?(TESTCFG$?)
    Or is there a better way?

    Certain info on status of ThinkPad Buttons are located there, and I
    would like to have some indication of their status.
    So I just need to read the momory not to write it.

    Any suggestions?

    Are there any examples, for that kind of thing?
    (Either C or Pascal)

    TIA
    Marko

  2. Re: Reading CMOS memory - How?

    In , on 01/21/2005
    at 01:20 PM, Marko Udvanc said:

    >I have read on some places that it has something to do with ports 70h
    >and 71h.


    Yes. 70h is the address port and 71h is the data port. You can find
    details of the address mapping with a bit of Googling.

    >Are they accessible in OS/2? How?(TESTCFG$?)


    This will work. You need to do byte IO.

    >Are there any examples, for that kind of thing?
    >(Either C or Pascal)


    See the Control Program Guide and Reference and search for testcfg. All
    you need to do is open TESTCFG$ and issue the appropriate IOCTLs

    HTH,

    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 2.60b #10183
    Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  3. Re: Reading CMOS memory - How?

    I have been checking Control Program Guide and Reference and uder
    remarksit says:
    Ports under hex 100 are not accessible.

    So this is dead end.

    Is there any other way?

    Marko

    Steven Levine wrote:
    > In , on 01/21/2005
    > at 01:20 PM, Marko Udvanc said:
    >
    >
    >>I have read on some places that it has something to do with ports 70h
    >>and 71h.

    >
    >
    > Yes. 70h is the address port and 71h is the data port. You can find
    > details of the address mapping with a bit of Googling.
    >
    >
    >>Are they accessible in OS/2? How?(TESTCFG$?)

    >
    >
    > This will work. You need to do byte IO.
    >
    >
    >>Are there any examples, for that kind of thing?
    >>(Either C or Pascal)

    >
    >
    > See the Control Program Guide and Reference and search for testcfg. All
    > you need to do is open TESTCFG$ and issue the appropriate IOCTLs
    >
    > HTH,
    >
    > Steven
    >


  4. Re: Reading CMOS memory - How?

    In , on 01/22/2005
    at 04:54 PM, Marko Udvanc said:

    >I have been checking Control Program Guide and Reference and uder
    >remarksit says:
    >Ports under hex 100 are not accessible.


    >So this is dead end.


    Maybe. You need to test this. It is not wise to assume that the
    documentation is always correct.

    There are lots of alternatives. One is:

    http://www.os2site.com/sw/dev/32bit/io386.zip

    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 2.60b #10183
    Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  5. Re: Reading CMOS memory - How?

    Marko Udvanc wrote:

    > I have read on some places that it has something to do with ports 70h
    > and 71h.


    Sometimes some additional effort is needed to read values that are
    in update. And on Intel chips, there is often a second CMOS.

    > Are they accessible in OS/2? How?(TESTCFG$?)
    > Or is there a better way?


    compile this program with Virtual Pascal 2.1:

    -------------------------
    program cmos;
    uses
    VpUtils;

    procedure dump_cmos(const title:string;const base:word);
    var
    i:byte;
    begin
    Writeln(title);
    for i:=$00 to $ff do
    begin
    if (i and $f)=$0 then Write(Int2Hex(i shr 4,1),'x ');
    Port[base+0]:=i;
    Write(' ',Int2Hex(Port[base+1],2));
    if (i and $f)=$f then WriteLn;
    end;
    WriteLn;
    end;

    begin
    dump_cmos('CMOS (70/71)',$70);
    dump_cmos('CMOS2 (72/73)',$72);
    end.


    --
    Veit Kannegieser

  6. Re: Reading CMOS memory - How?

    Thanks Veit!

    That gives me the data I need.

    I did some lpt communication thru port, but didn't remembered to use it now.

    I plan to write a widget for Xcenter on the status of thinkpad buttons,
    so that I will at least be able to se what the setting for the volume is.

    Marko

    Veit Kannegieser wrote:
    > Marko Udvanc wrote:
    >
    >
    >>I have read on some places that it has something to do with ports 70h
    >>and 71h.

    >
    >
    > Sometimes some additional effort is needed to read values that are
    > in update. And on Intel chips, there is often a second CMOS.
    >
    >
    >>Are they accessible in OS/2? How?(TESTCFG$?)
    >>Or is there a better way?

    >
    >
    > compile this program with Virtual Pascal 2.1:
    >
    > -------------------------
    > program cmos;
    > uses
    > VpUtils;
    >
    > procedure dump_cmos(const title:string;const base:word);
    > var
    > i:byte;
    > begin
    > Writeln(title);
    > for i:=$00 to $ff do
    > begin
    > if (i and $f)=$0 then Write(Int2Hex(i shr 4,1),'x ');
    > Port[base+0]:=i;
    > Write(' ',Int2Hex(Port[base+1],2));
    > if (i and $f)=$f then WriteLn;
    > end;
    > WriteLn;
    > end;
    >
    > begin
    > dump_cmos('CMOS (70/71)',$70);
    > dump_cmos('CMOS2 (72/73)',$72);
    > end.
    >
    >


  7. Re: Reading CMOS memory - How?

    Marko Udvanc wrote:

    > I plan to write a widget for Xcenter on the status of thinkpad buttons,
    > so that I will at least be able to se what the setting for the volume is.


    When the machine has an AC 97 chip, then you would better read out
    the volume setting from hardware - would be more portable.

    --
    Veit Kannegieser

+ Reply to Thread