2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2000, 2001 Free Software Foundation, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 /* This is stolen from arch/i386/boot/setup.S in Linux 2.2.17 */
22 ! setup.S Copyright (C) 1991, 1992 Linus Torvalds
31 call EXT_C(prot_to_real)
34 /* APM BIOS installation check */
38 /* error -> no APM BIOS */
41 /* check for "PM" signature */
43 /* no signature -> no APM BIOS */
46 /* Is 32 bit supported? */
51 /* Disconnect first just in case */
54 /* ignore return code */
69 /* BIOS code segment */
70 movw %ax, ABS(EXT_C(apm_bios_info)) + 2
71 /* BIOS entry point offset */
72 movl %ebx, ABS(EXT_C(apm_bios_info)) + 4
73 /* BIOS 16 bit code segment */
74 movw %cx, ABS(EXT_C(apm_bios_info)) + 8
75 /* BIOS data segment */
76 movw %dx, ABS(EXT_C(apm_bios_info)) + 10
77 /* BIOS code segment length */
78 movl %esi, ABS(EXT_C(apm_bios_info)) + 14
79 /* BIOS data segment length */
80 movw %di, ABS(EXT_C(apm_bios_info)) + 18
83 * Redo the installation check as the 32 bit connect
84 * modifies the flags returned on some BIOSs
87 /* APM BIOS installation check */
93 /* error -> should not happen, tidy up */
96 /* check for "PM" signature */
98 /* no signature -> should not happen, tidy up */
101 /* record the APM BIOS version */
102 movw %ax, ABS(EXT_C(apm_bios_info))
104 movw %cx, ABS(EXT_C(apm_bios_info)) + 12
108 /* remove 32 bit support bit */
109 andw $0xfffd, ABS(EXT_C(apm_bios_info)) + 12
112 /* Some paranoia here: Always Disconnect from APM */
115 /* ignore return code */
118 DATA32 call EXT_C(real_to_prot)