summaryrefslogtreecommitdiff
path: root/core/init.inc
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2011-10-18 13:13:06 +0100
committerMatt Fleming <matt.fleming@intel.com>2011-12-01 13:14:05 +0000
commit9f51b69d7c0500e04b3c404bb5138a9234810035 (patch)
treed566e6984457f331288f34d780f15a680334af94 /core/init.inc
parentdd5e4935f3e2f8f1940c72d9c3b39a926300c42e (diff)
downloadsyslinux-9f51b69d7c0500e04b3c404bb5138a9234810035.tar.gz
core: Reimplement lots asm code in C
There is an awful lot of code currently implemented in assembly when it could just as easily be implemented in C. Having it in C makes it much easier to share code between the BIOS and forthcoming EFI firmware backend. The following code fragments have been rewritten, - timer initialisation - adjust_screen() - check_esapes() and mem_init() - conio.inc - plaincon.inc - cleanup.inc - serirq.inc - font.inc - graphics - writehex Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'core/init.inc')
-rw-r--r--core/init.inc60
1 files changed, 3 insertions, 57 deletions
diff --git a/core/init.inc b/core/init.inc
index cce4327c..83d6fd68 100644
--- a/core/init.inc
+++ b/core/init.inc
@@ -28,11 +28,8 @@ common_init:
cmp eax,__pm_code_len
jne kaboom
-;
-; Initialize timer
-;
- call timer_init
-
+ extern init
+ pm_call init
;
; Initialize configuration information
;
@@ -44,63 +41,12 @@ common_init:
call comboot_setup_api
;
-; Now set up screen parameters
-;
- call adjust_screen
- pm_call printf_init
-
-;
; Inite the memmory subsystem
;
- pm_call mem_init
+; pm_call mem_init
mov eax,[HighMemSize]
mov [VKernelEnd],eax
-;
-; 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
-;
- int 12h
- mov edx,__lowmem_heap + min_lowmem_heap + 1023
- shr edx,10
- cmp ax,dx
- jae enough_ram
- mov ax,dx
- mov si,err_noram
- mov cl,10
- div cl
- add [si+err_noram.size-err_noram+2],ah
- cbw
- div cl
- add [si+err_noram.size-err_noram],ax
- call writestr_early
- jmp kaboom
-enough_ram:
-skip_checks:
-
- section .data16
-err_noram db 'It appears your computer has less than '
-.size db '000'
- 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.