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.
thanks, Jonathan
----- Original Message ---- From: Stefan Reinauer stepan@coresystems.de To: Jonathan Sturges jonathansturges@yahoo.com Cc: LinuxBIOS mailing list linuxbios@linuxbios.org Sent: Saturday, October 6, 2007 1:18:27 PM Subject: Re: [LinuxBIOS] Normal vs. fallback images and CMOS
* Jonathan Sturges jonathansturges@yahoo.com [071006 18:04]:
Question. If an embedded board has no battery backup, it should have no (usable) CMOS. Therefore, is a "Normal" image required on such a system? My understanding is that CMOS settings are required to force the Fallback image to boot, except in cases of an missing or corrupt Normal image.
It's rather the other way around. CMOS allows the Normal image to be booted. So without CMOS you always boot the Fallback image. Which is good, because Fallback uses the hardcoded default values for all otherwise CMOS drives variables.
So just drop the Normal image.
Stefan
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.