Hi all,
I have a question
about option table; the utility
“build_opt_tbl.c” will give us an option_table.c automatically, but
where is the option_table [ ] used?
How to control my Linuxbios go to fallback or normal image? We always run in fallback image. Can someone
give me some suggestions?
The code is in file reset_test.inc and cmos_failover.inc.
The code total is “
#define MCH_DRC 0x7C
#define DRC_IC (1 <<
29)
/* If I have already
booted once skip a bunch of initialization */
/* To see if I have already booted I check to see if memory
* has been enabled.
*/
movl $MCH_DRC, %eax
PCI_READ_CONFIG_DWORD
testl $DRC_IC,
%eax
setnz %al
testb %al,
%al
jz __failover_boot
__failover_reset:
movb $RTC_BOOT_BYTE,
%al
outb %al, $0x70
inb $0x71,
%al
testb $(1<<1),
%al
jnz __normal_image
jmp __cpu_reset
__failover_boot:
/* See if the cmos clear jumper has been set */
movl $((RTC_DEVFN << 8) | GEN_PMCON_3), %eax
PCI_READ_CONFIG_DWORD
testl $RTC_FAILED,
%eax
jz __cs_test
/* There are no
impossible values, no checksums
* so just trust
whatever value we have in the
* cmos.
*/
__rtc_failed:
movb $RTC_BOOT_BYTE,
%al
outb %al, $0x70
inb $0x71,
%al
andb $0xfc,
%al
outb %al, $0x71
jmp __cs_test
/* test the checksum
*/
__cs_test:
movl $77,%ecx
xor %ebx,%ebx
movl $RTC_BOOT_BYTE, %edx
1:
addl
$1, %edx
movl %edx, %eax
outb %al, $0x70
inb $0x71, %al
addl %eax,%ebx
subl $1,%ecx
jnz 1b
not %ebx
addl
$1, %edx
movl %edx, %eax
outb %al, $0x70
inb $0x71, %al
movb %al,%ch
addl $1, %edx
movl %edx, %eax
outb %al, $0x70
inb $0x71, %al
movb %ch,%ah
cmpw %ax,%bx
jz __rtc_ok
/* Set to fall back
mode */
movb $RTC_BOOT_BYTE,
%al
outb %al, $0x70
inb $0x71,
%al
andb $0xfc,
%al
outb %al, $0x71
/* The byte is o.k. see where to go */
__rtc_ok:
movb $RTC_BOOT_BYTE,
%al
outb %al, $0x70
inb $0x71,
%al
/* Transfer the boot
bit from bit 0 to bit 1.
* And clear bit 0 so that unless we say
it works we
* fallback to
the other bios image immediately.
*/
movb %al,
%bl
andb $0xfc,
%al
andb $1,
%bl
shlb %bl
orb %bl, %al
outb %al, $0x71
testb $(1<<1),
%al
jnz __normal_image