2 ; -----------------------------------------------------------------------
4 ; Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
5 ; Copyright 2009 Intel Corporation; author: H. Peter Anvin
7 ; This program is free software; you can redistribute it and/or modify
8 ; it under the terms of the GNU General Public License as published by
9 ; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
10 ; Boston MA 02111-1307, USA; either version 2 of the License, or
11 ; (at your option) any later version; incorporated herein by reference.
13 ; -----------------------------------------------------------------------
18 ; Common initialization code (inline)
23 ; Initialize PM invocation framework
26 ; Decompress PM code to its target location
37 ; Initialize configuration information
42 ; Set up the COMBOOT APIs
44 call comboot_setup_api
47 ; Now set up screen parameters
52 ; CPU-dependent initialization and related checks.
55 mov ah,02h ; Check keyboard flags
57 mov [KbdFlags],al ; Save for boot prompt check
58 test al,04h ; Ctrl->skip 386 check
62 ; Now check that there is sufficient low (DOS) memory
64 ; NOTE: Linux doesn't use all of real_mode_seg, but we use the same
65 ; segment for COMBOOT images, which can use all 64K
68 mov edx,__lowmem_heap + min_lowmem_heap + 1023
76 add [si+err_noram.size-err_noram+2],ah
79 add [si+err_noram.size-err_noram],ax
86 err_noram db 'It appears your computer has less than '
90 db 'RAM. Syslinux needs at least this amount to boot. If you get'
92 db 'this message in error, hold down the Ctrl key while'
94 db 'booting, and I will take your word for it.', CR, LF, 0
98 ; The code to decompress the PM code and initialize other segments.
100 extern _lzo1x_decompress_asm_fast
105 push 0 ; Space for decompressed size
106 push esp ; Pointer to previous word
107 push __pm_code_start ; Target address
108 push dword [lzo_data_size] ; Compressed size
109 push dword __pm_code_lma
110 call _lzo1x_decompress_asm_fast
112 pop RM_EAX ; Decompressed size
114 ; Zero bss sections (but not .earlybss, since it may
115 ; contain already-live data.)
120 mov edi,__bss16_start
121 mov ecx,__bss16_dwords
123 mov edi,__high_clear_start ; .uibss, .auxseg, .lowmem
124 mov ecx,__high_clear_dwords
130 lzo_data_size dd 0 ; filled in by compressor