1
2
3
4
5
6
7
8
9
10
11
12
13
14 .text
15
16 #include <linux/segment.h>
17
18 startup_32:
19 cld
20 cli
21 movl $KERNEL_DS,%eax
22 mov %ax,%ds
23 mov %ax,%es
24 mov %ax,%fs
25 mov %ax,%gs
26 lss _stack_start,%esp
27 xorl %eax,%eax
28 1: incl %eax # check that A20 really IS enabled
29 movl %eax,0x000000 # loop forever if it isn't
30 cmpl %eax,0x100000
31 je 1b
32
33
34
35
36
37 pushl $0
38 popfl
39
40
41
42 xorl %eax,%eax
43 movl $__edata,%edi
44 movl $__end,%ecx
45 subl %edi,%ecx
46 cld
47 rep
48 stosb
49
50
51
52 call _decompress_kernel
53 ljmp $KERNEL_CS, $0x100000