Subversion Repositories Kolibri OS

Rev

Rev 859 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
854 serge 1
 
2
3
 
4
5
 
6
7
 
8
9
 
10
11
 
928 serge 12
extrn  __os_stack
854 serge 13
extrn  _boot_mbi
14
extrn  _sys_pdbr
15
16
 
17
extrn  __edata
18
19
 
20
21
 
22
23
 
24
25
 
26
  dd  0x1BADB002
27
  dd  0x00010003
28
  dd  -(0x1BADB002 + 0x00010003)
29
  dd  mboot
30
  dd  0x100000
31
  dd  __edata; - OS_BASE
32
  dd  LAST_PAGE
33
  dd  __start
34
35
 
36
__start:
37
           cld
38
39
 
40
           push 0
41
           popf
42
43
 
44
           mov ecx, sz_invboot
45
           jne .fault
46
47
 
48
           mov ecx, sz_nomods
49
           jnc .fault
50
51
 
52
           mov ecx, sz_nommap
53
           jnc .fault
54
55
 
56
57
 
58
           cpuid
59
           cmp eax, 0
60
           mov ecx, sz_nopse
61
           jbe .fault
62
63
 
64
           cpuid
65
           bt edx, 3
66
           mov ecx, sz_nopse
67
           jnc .fault
68
69
 
70
71
 
859 serge 72
           mov eax, PG_LARGE+PG_SW
928 serge 73
           mov edi, _sys_pdbr+(OS_BASE shr 20)+(0x100000000-OS_BASE)
854 serge 74
           mov [edi-4], dword (PG_LARGE+PG_USER)
928 serge 75
@@:
854 serge 76
           stosd
77
           add eax, 4*1024*1024
78
           loop @B
79
80
 
81
           mov dword [_sys_pdbr+(0x100000000-OS_BASE)+4], PG_LARGE+PG_SW+4*1024*1024
82
           mov dword [_sys_pdbr+(0x100000000-OS_BASE)+(page_tabs shr 20)], _sys_pdbr+PG_SW+(0x100000000-OS_BASE)
83
84
 
85
           or ebx, CR4_PSE
86
           and ebx, not CR4_PAE
87
           mov cr4, ebx
88
89
 
90
           mov ebx, cr0
91
           or ebx,CR0_PG+CR0_WP
92
93
 
94
           mov cr0, ebx
95
96
 
97
98
 
99
           mov esi, [ebx+24]
100
           mov ecx, LAST_PAGE
101
           test edx, edx
102
           jz .no_mods
103
.scan_mod:
104
           mov ecx, [esi+4]
105
           add esi, 16
106
           dec edx
107
           jnz .scan_mod
108
109
 
110
           add ecx, 4095
111
           and ecx, not 4095
112
113
 
928 serge 114
           jmp pword 0x10:high_code
115
854 serge 116
 
117
 
118
;           push ecx
119
;           call _lcls
120
;           call __bprintf
121
_hlt:
122
           hlt
123
           jmp _hlt
124
125
 
126
           db 'Halted',0
127
128
 
129
           db 'Halted',0
130
131
 
132
           db 'Halted',0
133
134
 
135
           db 'Halted',0
136