Skip to content

Commit

Permalink
x86: remove legacy BOOT_A20_ENABLE option
Browse files Browse the repository at this point in the history
BOOT_A20_ENABLE relies on the kernel being on a system that has a full
PC BIOS and requires that the A20 line be enabled to boot
correctly. None of the supported platforms satisfy either requirment.

Change-Id: I05805a050f5531de0348b60a4f0cb974e464b279
Signed-off-by: Dirk Brandewie <[email protected]>
  • Loading branch information
Dirk Brandewie authored and nashif committed Feb 6, 2016
1 parent ca97c38 commit 3012166
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 77 deletions.
68 changes: 0 additions & 68 deletions arch/x86/core/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -107,74 +107,6 @@ __start:

cli


/*
* Platforms that need to enable the A20 line to boot properly wil enable this
* option.
*/
#ifdef CONFIG_BOOT_A20_ENABLE

/*
* Set the stack pointer to just before the start of the .text
* section. This needs to be performed before any BIOS invocations.
*
* Note that attempting to set the stack pointer to beyond the end of
* the static ELF image (indicated via the _end symbol) may result
* in pointer wrap-around for images with large BSS sections
* (since the processor is still in "real" mode and thus the stack
* pointer is only a 16 bits).
*/

movl $__start, %esp

/*
* Before switching to 32-bit protected mode, Gate-A20 must be
* enabled (legacy PC hardware issue).
*
* The classical method of enabling address line A20 via the 8042
* keyboard controller will not be performed. Instead, it will be
* assumed that the board has a relatively modern BIOS which supports
* the following int 15h function:
*
* - int 15h: ax=2400 -> disable A20
* - int 15h: ax=2401 -> enable A20
* If successful: CF clear, AH = 00h
* On error: CF set, AH = status
* Status: 01h keyboard controller is in secure mode
* 86h function not supported
* - int 15h: ax=2402 -> query status A20
* status (0: disabled, 1: enabled) is returned in AL
* - int 15h: ax=2403 -> query A20 support (kbd or port 92)
* status (bit 0: kbd, bit 1: port 92) is returned in BX
*
* Return values:
* If successful: carry flag (CF) clear, AH = 00h
* On error: carry flag (CF) set, AH = status
* Status: 01h keyboard controller is in secure mode
* 86h function not supported
*
* If the int15h method fails, then the system control port A
* (I/O port 0x92) method will be used.
*/

movw $0x2401, %ax /* ax=2401 -> enable A20 */
int $0x15
jnc A20Enabled /* CF = 1 -> try I/O port 0x92 method */

/* try enabling Gate-A20 via system control port A (I/O port 0x92) */

movb $0x02, %al
outb %al, $0x92

xorl %ecx, %ecx
A20EnableWait:
inb $0x92, %al
andb $0x02, %al
loopz A20EnableWait

A20Enabled:
#endif /* CONFIG_BOOT_A20_ENABLE */

/* load Interrupt Descriptor and Global Descriptor tables (IDT & GDT) */

lgdt %cs:_GdtRom /* load 32-bit operand size GDT */
Expand Down
9 changes: 0 additions & 9 deletions misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,6 @@ config PROT_MODE_SWITCH
This option causes the kernel to transition from real mode (16-bit)
to protected mode (32-bit) during its initial booting sequence.

config BOOT_A20_ENABLE
bool "Boot A20 enable"
depends on PROT_MODE_SWITCH
default n
help
This option causes the A20 line to be enabled during the transition
from real mode (16-bit) to protected mode (32-bit) during its initial
booting sequence.

endmenu

menu "System Monitoring Options"
Expand Down

0 comments on commit 3012166

Please sign in to comment.