On Sun, Oct 07, 2007 at 05:02:21PM -0700, Jonathan Sturges wrote: > Thanks! > Let me turn the CMOS question around though. If an embedded board does have > a battery, is it possible that it's just for the TOD clock and not CMOS? In > other words, if an unknown board has a battery, how can I positively confirm > the existence of the CMOS? > I've got two revisions of the same board, one with battery and one without. > They're Winterminal boards, so they don't necessarily need CMOS settings.
I'm just guessing, but maybe just try reading CMOS bytes and see
if it works? If it doesn't I guess junk or 0xff will be returned.
I used something like this:
#define RTC_PORT 0x70
/**
* Read a byte from the specified CMOS address.
*
* @param addr The CMOS address to read a byte from.
* @return The byte at the given CMOS address.
*/
inline u8 cmos_read(u8 addr)
{
outb(addr, RTC_PORT);
return inb(RTC_PORT + 1);
}
Uwe.
--
http://www.hermann-uwe.de | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
signature.asc
Description: Digital signature
-- linuxbios mailing list [email protected] http://www.linuxbios.org/mailman/listinfo/linuxbios
