[SeaBIOS] [PATCH 8/8] Convert some QEMU cmos config variables to the romfile interface.

Kevin O'Connor kevin at koconnor.net
Wed Feb 13 02:57:47 CET 2013


On Mon, Feb 11, 2013 at 09:21:29AM +0100, Paolo Bonzini wrote:
> Il 10/02/2013 05:48, Kevin O'Connor ha scritto:
> > @@ -300,9 +300,8 @@ timer_setup(void)
> >      SET_BDA(timer_counter, ticks);
> >  
> >      // Setup Century storage
> > -    if (CONFIG_QEMU) {
> > -        Century = inb_cmos(CMOS_CENTURY);
> > -    } else {
> > +    Century = romfile_loadint("etc/century", 0);
> > +    if (!Century) {
> >          // Infer current century from the year.
> >          u8 year = inb_cmos(CMOS_RTC_YEAR);
> >          if (year > 0x80)
> 
> The right thing to would be to use the FADT century field.  In fact we
> should also set the century field to 0x32 under QEMU.

I'm not much of a fan of storing content in the CMOS.  It's fine on
QEMU, but on real-hardware it tends to cause conflicts when switching
between the factory bios and coreboot.  Since the century field isn't
going to change for another 87 years I think it's safe to avoid cmos
in this case.

-Kevin



More information about the SeaBIOS mailing list