2 ;; -----------------------------------------------------------------------
4 ;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ;; Boston MA 02111-1307, USA; either version 2 of the License, or
10 ;; (at your option) any later version; incorporated herein by reference.
12 ;; -----------------------------------------------------------------------
17 ;; CPU-dependent initialization and related checks.
21 mov ah,02h ; Check keyboard flags
23 mov [KbdFlags],al ; Save for boot prompt check
24 test al,04h ; Ctrl->skip 386 check
28 ; Now check that there is sufficient low (DOS) memory
30 ; NOTE: Linux doesn't use all of real_mode_seg, but we use the same
31 ; segment for COMBOOT images, which can use all 64K
33 dosram_k equ (real_mode_seg+0x1000) >> 6 ; Minimum DOS memory (K)
44 ; Initialize the bcopy32 code in low memory
46 mov si,section..bcopy32.start
48 mov cx,__bcopy_size >> 2
52 ; Check if we're 386 (as opposed to 486+); if so we need to blank out
53 ; the WBINVD instruction
55 ; We check for 486 by setting EFLAGS.AC
58 pushfd ; Save the good flags
62 xor eax,(1 << 18) ; AC bit
67 popfd ; Restore the original flags
71 ; 386 - Looks like we better blot out the WBINVD instruction
73 mov byte [try_wbinvd],0c3h ; Near RET