Subversion Repositories Kolibri OS

Rev

Rev 1454 | Rev 2129 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1454 Rev 1455
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 1454 $
8
$Revision: 1455 $
9
 
9
 
10
 
10
 
Line 127... Line 127...
127
           mov ecx, 4096/4
127
           mov ecx, 4096/4
128
           cld
128
           cld
129
           rep stosd
129
           rep stosd
Line 130... Line 130...
130
 
130
 
131
           mov edx, (sys_pgdir-OS_BASE)+ 0x800; (OS_BASE shr 20)
131
           mov edx, (sys_pgdir-OS_BASE)+ 0x800; (OS_BASE shr 20)
132
;           bt [cpu_caps-OS_BASE], CAPS_PSE
132
           bt [cpu_caps-OS_BASE], CAPS_PSE
Line 133... Line 133...
133
;           jnc .no_PSE
133
           jnc .no_PSE
134
 
134
 
135
           mov ebx, cr4
135
           mov ebx, cr4
136
           or ebx, CR4_PSE
136
           or ebx, CR4_PSE
Line 140... Line 140...
140
 
140
 
141
           mov [edx], eax
141
           mov [edx], eax
Line 142... Line 142...
142
           add edx, 4
142
           add edx, 4
-
 
143
 
-
 
144
           mov edi, [tmp_page_tabs] 
-
 
145
           jmp .map_kernel_heap		; new kernel fits to the first 4Mb - nothing to do with ".map_low"
-
 
146
.no_PSE:
-
 
147
           mov eax, PG_SW
-
 
148
           mov ecx, [tmp_page_tabs]
-
 
149
           shr ecx, 12
-
 
150
.map_low:
-
 
151
           mov edi, [tmp_page_tabs]
-
 
152
@@:                                   ;
-
 
153
           stosd
-
 
154
           add eax, 0x1000
-
 
155
           dec ecx
-
 
156
           jnz @B
143
 
157
 
144
           mov edi, [tmp_page_tabs] 
158
.map_kernel_heap:
145
           mov ecx, [pg_data.kernel_tables-OS_BASE]
159
           mov ecx, [pg_data.kernel_tables-OS_BASE]
146
           shl ecx, 10
160
           shl ecx, 10
Line 225... Line 239...
225
           add ebx, 20
239
           add ebx, 20
226
           dec edx
240
           dec edx
227
           jnz .scanmap
241
           jnz .scanmap
Line 228... Line 242...
228
 
242
 
229
; mark kernel memory as allocated (unavailable)
243
; mark kernel memory as allocated (unavailable)
230
           mov ecx, (UPPER_KERNEL_PAGES-OS_BASE)/4096
244
           mov ecx, [tmp_page_tabs]
-
 
245
           mov edx, [pg_data.pages_count-OS_BASE]
-
 
246
           shr ecx, 12
231
           mov edx, [pg_data.pages_count-OS_BASE]
247
           add ecx, [pg_data.kernel_tables-OS_BASE]
232
           sub edx, ecx
248
           sub edx, ecx
Line 233... Line 249...
233
           mov [pg_data.pages_free-OS_BASE], edx
249
           mov [pg_data.pages_free-OS_BASE], edx
234
 
250
 
Line 414... Line 430...
414
           shr eax, 8
430
           shr eax, 8
415
           and eax, 0x0f
431
           and eax, 0x0f
416
           ret
432
           ret
417
endp
433
endp
Line -... Line 434...
-
 
434