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.need-err_noram+2],ah
79 add [si+err_noram.need-err_noram],ax
82 add [si+err_noram.size-err_noram+2],ah
85 add [si+err_noram.size-err_noram],ax
92 err_noram db 'It appears your computer has only '
94 db 'K of low ("DOS") RAM.', CR, LF
95 db 'This version of Syslinux needs '
97 db 'K to boot. If you get this', CR, LF
98 db 'message in error, hold down the Ctrl key while'
99 db 'booting, and I', CR, LF
100 db 'will take your word for it.', CR, LF, 0
104 ; The code to decompress the PM code and initialize other segments.
106 extern _lzo1x_decompress_asm_fast
111 push 0 ; Space for decompressed size
112 push esp ; Pointer to previous word
113 push __pm_code_start ; Target address
114 push dword [lzo_data_size] ; Compressed size
115 push dword __pm_code_lma
116 call _lzo1x_decompress_asm_fast
118 pop RM_EAX ; Decompressed size
120 ; Zero bss sections (but not .earlybss, since it may
121 ; contain already-live data.)
126 mov edi,__bss16_start
127 mov ecx,__bss16_dwords
129 mov edi,__high_clear_start ; .uibss, .auxseg, .lowmem
130 mov ecx,__high_clear_dwords
136 lzo_data_size dd 0 ; filled in by compressor