summaryrefslogtreecommitdiff
path: root/core/init.inc
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-09-02 17:31:53 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-09-02 17:32:39 -0700
commit94a6e382a7a253fdab67a3bff981844dd5f6d4cb (patch)
treea5563377d74fdaec953322ae17d82095fd258d71 /core/init.inc
parent33a3c79d6fe333b1d61b29a64fc045ddde89af22 (diff)
downloadsyslinux-94a6e382a7a253fdab67a3bff981844dd5f6d4cb.tar.gz
core: merge cpuinit.inc into init.inc
The separation between cpuinit.inc and init.inc has never been very clear, and it just made the code harder to read. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/init.inc')
-rw-r--r--core/init.inc38
1 files changed, 38 insertions, 0 deletions
diff --git a/core/init.inc b/core/init.inc
index 5617a697..8e393b67 100644
--- a/core/init.inc
+++ b/core/init.inc
@@ -44,6 +44,44 @@ common_init:
call adjust_screen
;
+; CPU-dependent initialization and related checks.
+;
+check_escapes:
+ mov ah,02h ; Check keyboard flags
+ int 16h
+ mov [KbdFlags],al ; Save for boot prompt check
+ test al,04h ; Ctrl->skip 386 check
+ jnz skip_checks
+
+;
+; Now check that there is sufficient low (DOS) memory
+;
+; NOTE: Linux doesn't use all of real_mode_seg, but we use the same
+; segment for COMBOOT images, which can use all 64K
+;
+dosram_k equ (real_mode_seg+0x1000) >> 6 ; Minimum DOS memory (K)
+ int 12h
+ cmp ax,dosram_k
+ jae enough_ram
+ mov si,err_noram
+ call writestr_early
+ jmp kaboom
+enough_ram:
+skip_checks:
+
+ section .data16
+err_noram db 'It appears your computer has less than '
+ asciidec dosram_k
+ db 'K of low ("DOS")'
+ db CR, LF
+ db 'RAM. Syslinux needs at least this amount to boot. If you get'
+ db CR, LF
+ db 'this message in error, hold down the Ctrl key while'
+ db CR, LF
+ db 'booting, and I will take your word for it.', CR, LF, 0
+ section .text16
+
+;
; The code to decompress the PM code and initialize other segments.
;
extern _lzo1x_decompress_asm_fast