Skip to content
Permalink
Browse files

key 'C' to Single Sector for Buggy BIOS on startup.

  • Loading branch information...
chenall committed Nov 2, 2014
1 parent 8ade6b4 commit 3a253e50603662c0be9678b27d91a50f4237a9bf
Showing with 21 additions and 5 deletions.
  1. +6 −1 stage2/asm.S
  2. +15 −4 stage2/common.c
@@ -500,9 +500,14 @@ real_codestart:

cmpw $KEY_IC, %ax /* insert char */
jne 3f
movb $1, %bh /* DEBUG_KEY pressed */
orb $1, %bh /* DEBUG_KEY pressed */
jmp 2b /* get next key */
3:
orb $0x20, %al
cmpb $0x73, %al /* is "S"? */
jne 3f
orb $2, %bh /* Single Sector for Buggy BIOS */
3:
cmpb $0x63, %al /* is "C"? */
jne 2b /* no, get next key */

@@ -346,6 +346,7 @@ init_bios_info (void)
unsigned long drive;
unsigned long force_pxe_as_boot_device;
unsigned long use_fixed_boot_device = boot_drive;
unsigned long use_lba1sector;

if (use_fixed_boot_device != -1)
{
@@ -361,7 +362,8 @@ init_bios_info (void)
malloc_array_start = (struct malloc_array *)mem_alloc_array_start + 10;
malloc_array_start->addr = free_mem_start + 0x400000;
malloc_array_start->next = (struct malloc_array *)&free_mem_end;

use_lba1sector = debug_boot & 2;
debug_boot &= 1;
/*
* Get information from BIOS on installed RAM.
*/
@@ -894,13 +896,22 @@ init_bios_info (void)
}
}
#endif
if (debug_boot)
grub_printf("\rInitialize variable space...\n");
if (debug_boot) grub_printf("\rInitialize variable space...\n");

VARIABLE_BASE_ADDR = 0x45000;
memset(ADDR_RET_STR,0,0x200);
run_line("set ?_BOOT=%@root%",1);
QUOTE_CHAR = '\"';
// builtin_cmd("set","?_Boot=",1);/*Initialize variable space*/
if (use_lba1sector && run_line("geometry --lba1sector",1))
{
int chk;
printf("\nYou pressed the `S` key, and \"geometry --lba1sector\" is successfully executed\n for drive 0x%X.This will Slow but Secure disk read for Buggy BIOS.\n",boot_drive);
while((chk = run_line("pause --wait=5",1)))
{
chk &= 0xdf;
if (chk != 'S') break;
}
}

#ifdef SUPPORT_GRAPHICS
extern int font_func (char *, int);

0 comments on commit 3a253e5

Please sign in to comment.
You can’t perform that action at this time.