clear eflags; set cs; set ecx for LZCKLLT1; more documentation

committer: jreiser <jreiser> 1058382511 +0000
This commit is contained in:
John Reiser
2003-07-16 19:08:31 +00:00
parent 48ec581539
commit 2d403e07bb
+41 -25
View File
@@ -34,6 +34,11 @@
SECTION .text SECTION .text
ORG 0 ORG 0
; gdt segment 3 is flat data
%define __KERNEL_DS 3*8
; gdt segment 2 is flat code
%define __KERNEL_CS 2*8
; ============= ; =============
; ============= ENTRY POINT ; ============= ENTRY POINT
; ============= ; =============
@@ -42,23 +47,33 @@ start:
; __LINUZ000__ ; __LINUZ000__
cli cli
xor eax, eax xor eax, eax
mov al, 0x18 mov al, __KERNEL_DS
mov ds, eax mov ds, eax
mov es, eax mov es, eax
; fs, gs set by startup_32 in arch/i386/kernel/head.S
mov ss, eax mov ss, eax
mov esp, 'STAK' ; 0x90000 mov esp, 'STAK' ; 0x90000
or ebp, byte -1 push byte 0
mov eax, 'KEIP' ; 0x100000 - address of startup_32 popf ; BIOS can leave random flags (such as NT)
push eax ; MATCH00
push edi ; MATCH01 ; do not clear .bss: at this point, .bss comes only from
push esi ; MATCH02 ; arch/i386/boot/compressed/*.o which we are replacing entirely
or ebp, byte -1 ; decompressor assumption
mov eax, 'KEIP' ; 0x100000 : address of startup_32
push byte __KERNEL_CS ; MATCH00
push eax ; MATCH00 entry address
push edi ; MATCH01 save
push esi ; MATCH02 save
%ifdef __LZCALLT1__ %ifdef __LZCALLT1__
push eax ; MATCH03 push eax ; MATCH03 src unfilter
%endif; __LZDUMMY0__ %endif; __LZDUMMY0__
%ifdef __LZCKLLT1__ %ifdef __LZCKLLT1__
push eax ; MATCH03 push eax ; MATCH03 src unfilter
push byte '?' ; MATCH04 push byte '?' ; MATCH04 cto unfilter
push 'ULEN' ; MATCH05 len unfilter
%endif; __LZDUMMY1__ %endif; __LZDUMMY1__
%ifdef __LBZIMAGE__ %ifdef __LBZIMAGE__
mov esi, 'ESI0' mov esi, 'ESI0'
@@ -70,22 +85,22 @@ start:
movsd movsd
cld cld
mov esi, 'ESI1' mov esi, 'ESI1' ; esi = src for decompressor
xchg eax, edi xchg eax, edi ; edi = dst for decompressor = 0x100000
jmp .1 + 'JMPD' ; jump to the copied decompressor jmp .1 + 'JMPD' ; jump to the copied decompressor
.1: .1:
%else; __LZIMAGE0__ %else; __LZIMAGE0__
cld
mov esi, 'ESI1'
xchg eax, edi
; this checka20 stuff looks very unneccessary to me ; this checka20 stuff looks very unneccessary to me
checka20: checka20:
inc eax inc edi ; change value
mov [ebp + 1], eax mov [1 + ebp], edi ; store to 0x000000 (even megabyte)
cmp [edi], eax cmp [eax], edi ; compare 0x100000 ( odd megabyte)
je checka20 je checka20 ; addresses are [still] aliased
cld
mov esi, 'ESI1'
xchg eax, edi ; edi = dst for decompressor = 0x100000
%endif; __LZCUTPOI__ %endif; __LZCUTPOI__
@@ -102,18 +117,19 @@ checka20:
; ============= ; =============
%ifdef __LZCKLLT9__ %ifdef __LZCKLLT9__
pop edx ; MATCH04 pop ecx ; MATCH05 len
pop edi ; MATCH03 pop edx ; MATCH04 cto
pop edi ; MATCH03 src
ckt32 dl ckt32 dl
%endif; __LZDUMMY2__ %endif; __LZDUMMY2__
%ifdef __LZCALLT9__ %ifdef __LZCALLT9__
pop edi ; MATCH03 pop edi ; MATCH03 src
cjt32 0 cjt32 0
%endif; __LINUZ990__ %endif; __LINUZ990__
pop esi ; MATCH02 pop esi ; MATCH02 restore
pop edi ; MATCH01 pop edi ; MATCH01 restore
xor ebx, ebx ; booting the 1st cpu xor ebx, ebx ; booting the 1st cpu
retn ; MATCH00 retf ; MATCH00 set cs
; ============= ; =============
; ============= CUT HERE ; ============= CUT HERE