1 ;; -----------------------------------------------------------------------
3 ;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
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, Inc., 53 Temple Place Ste 330,
8 ;; Boston MA 02111-1307, USA; either version 2 of the License, or
9 ;; (at your option) any later version; incorporated herein by reference.
11 ;; -----------------------------------------------------------------------
16 ;; CPU-dependent initialization and related checks.
20 mov ah,02h ; Check keyboard flags
22 mov [KbdFlags],al ; Save for boot prompt check
23 test al,04h ; Ctrl->skip 386 check
27 ; Now check that there is sufficient low (DOS) memory
29 ; NOTE: Linux doesn't use all of real_mode_seg, but we use the same
30 ; segment for COMBOOT images, which can use all 64K
32 dosram_k equ (real_mode_seg+0x1000) >> 6 ; Minimum DOS memory (K)
43 ; Initialize the bcopy32 code in low memory
45 mov si,section..bcopy32.start
47 mov cx,__bcopy_size >> 2
51 ; Check if we're 386 (as opposed to 486+); if so we need to blank out
52 ; the WBINVD instruction
54 ; We check for 486 by setting EFLAGS.AC
57 pushfd ; Save the good flags
61 xor eax,(1 << 18) ; AC bit
66 popfd ; Restore the original flags
70 ; 386 - Looks like we better blot out the WBINVD instruction
72 mov byte [try_wbinvd],0c3h ; Near RET
77 err_noram db 'It appears your computer has less than '
81 db 'RAM. Linux needs at least this amount to boot. If you get'
83 db 'this message in error, hold down the Ctrl key while'
85 db 'booting, and I will take your word for it.', CR, LF, 0