Correct the memory layout for the BGRA32 color space
[syslinux.git] / cpuinit.inc
bloba173ea791e34fd3eca89ca74c23802e8b97a7931
1 ;; -----------------------------------------------------------------------
2 ;;
3 ;;   Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
4 ;;
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 ;; -----------------------------------------------------------------------
14 ;; cpuinit.inc
16 ;; CPU-dependent initialization and related checks.
19 check_escapes:
20                 mov ah,02h                      ; Check keyboard flags
21                 int 16h
22                 mov [KbdFlags],al               ; Save for boot prompt check
23                 test al,04h                     ; Ctrl->skip 386 check
24                 jnz skip_checks
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)
33                 int 12h
34                 cmp ax,dosram_k
35                 jae enough_ram
36                 mov si,err_noram
37                 call writestr
38                 jmp kaboom
39 enough_ram:
40 skip_checks:
43 ; Initialize the bcopy32 code in low memory
45                 mov si,section..bcopy32.start
46                 mov di,__bcopy_start
47                 mov cx,__bcopy_size >> 2
48                 rep movsd
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
56 %if DO_WBINVD
57                 pushfd                          ; Save the good flags
58                 pushfd
59                 pop eax
60                 mov ebx,eax
61                 xor eax,(1 << 18)               ; AC bit
62                 push eax
63                 popfd
64                 pushfd
65                 pop eax
66                 popfd                           ; Restore the original flags
67                 xor eax,ebx
68                 jnz is_486
70 ; 386 - Looks like we better blot out the WBINVD instruction
72                 mov byte [try_wbinvd],0c3h              ; Near RET
73 is_486:
74 %endif  ; DO_WBINVD