repository service wrote:
+++ trunk/src/pc80/mc146818rtc_early.c Fri Jan 14 08:40:24 2011 (r6253)
..
static inline int do_normal_boot(void) {
char *cmos_default = cbfs_find_file("cmos.default", 0xaa); unsigned char byte;
int i;
if (cmos_error() || !cmos_chksum_valid()) {
if (cmos_default) {
printk_warning("WARNING - CMOS CORRUPTED. RESTORING DEFAULTS.\n");
/* First 14 bytes are reserved for
RTC and ignored by nvramtool, too.
Only 128 bytes: 128+ requires cmos configuration and
contains only suspend-to-ram data, which isn't part
of the recovery procedure. */
for (i = 14; i < 128; i++) {
cmos_write(cmos_default[i], i);
}
/* Now reboot to run with default cmos. */
outb(0x06, 0xcf9);
for (;;) asm("hlt"); /* Wait for reset! */
Isn't this kinda ugly to have in the rtc code? We could at least have some kind of reset/reboot function..
//Peter