Subversion Repositories Kolibri OS

Rev

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

Rev 1683 Rev 1941
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: 1683 $
8
$Revision: 1941 $
9
 
9
 
10
 
10
 
Line 16... Line 16...
16
align 4
16
align 4
17
preinit_mem:
17
preinit_mem:
Line 18... Line 18...
18
 
18
 
19
; clear [0x280000..HEAP_BASE]
19
; clear [0x280000..HEAP_BASE]
20
	   xor	 eax,eax
20
	   xor	 eax,eax
21
	   mov	 edi,0x280000			; 0x280000 = ramdisk FAT ?
21
	   mov	 edi, CLEAN_ZONE			; 0x280000 = ramdisk FAT ?
22
	   mov	 ecx,(HEAP_BASE-OS_BASE-0x280000) / 4
22
	   mov	 ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4
23
	   cld
23
	   cld
Line 24... Line 24...
24
	   rep	 stosd
24
	   rep	 stosd
25
 
25
 
Line 33... Line 33...
33
	   mov	 ecx, (uglobals_size/4)+4
33
	   mov	 ecx, (uglobals_size/4)+4
34
	   rep	 stosd
34
	   rep	 stosd
Line 35... Line 35...
35
 
35
 
36
; save [0..0xffff]
36
; save [0..0xffff]
37
	   xor	 esi, esi
37
	   xor	 esi, esi
38
	   mov	 edi,0x2F0000			; low mem storage area
38
	   mov	 edi,(BOOT_VAR-OS_BASE) 		; low mem storage area
39
	   mov	 ecx, 0x10000 / 4
39
	   mov	 ecx, 0x10000 / 4
40
	   rep	 movsd
40
	   rep	 movsd
41
; clear [0x1000..0x0ffff]
41
; clear [0x1000..0x0ffff]
42
	   mov	 edi,0x1000
42
	   mov	 edi,0x1000
Line 81... Line 81...
81
	   mov ebx, cr4
81
	   mov ebx, cr4
82
	   or  ebx, CR4_PSE
82
	   or  ebx, CR4_PSE
83
	   mov eax, PG_LARGE+PG_SW
83
	   mov eax, PG_LARGE+PG_SW
84
	   mov cr4, ebx
84
	   mov cr4, ebx
85
	   dec [pg_data.kernel_tables-OS_BASE]
85
	   dec [pg_data.kernel_tables-OS_BASE]
-
 
86
	   sub [pg_data.kernel_pages -OS_BASE], 1024	; 1 large page = 1024 ordinary pages
Line 86... Line 87...
86
 
87
 
87
	   mov [edx], eax				; map first (physical) 4M bytes
88
	   mov [edx], eax				; map first (physical) 4M bytes
Line 88... Line 89...
88
	   add edx, 4
89
	   add edx, 4
89
 
90
 
-
 
91
	   mov edi, [tmp_page_tabs]
-
 
92
	   mov ecx, [pg_data.kernel_pages -OS_BASE]	; map the rest of kernel space
-
 
93
	   mov eax, 0x00400000+PG_SW
90
	   mov edi, [tmp_page_tabs]
94
.map_kernel_pages:
91
	   mov ecx, [pg_data.kernel_pages -OS_BASE]	; safety cleaning of already-zeroed space
95
	   stosd
-
 
96
	   add	eax, 4096
Line 92... Line 97...
92
	   xor eax, eax
97
	   dec	ecx
93
	   rep stosd
98
	   jnz	.map_kernel_pages
94
 
99
 
95
	   mov ecx, [pg_data.kernel_tables-OS_BASE]	; build some PDEs to hold empty PTEs
100
	   mov ecx, [pg_data.kernel_tables-OS_BASE]	; build some PDEs to hold empty PTEs
96
	   mov eax, [tmp_page_tabs]
-
 
97
	   or  eax, PG_SW
101
	   mov eax, [tmp_page_tabs]
98
	   mov edi, edx 		; edi = sys_pgdir+0x804
102
	   or  eax, PG_SW
99
 
103
	   mov edi, edx 		; edi = sys_pgdir+0x804
100
.map_kernel_tabs:
104
.map_kernel_tabs:
101
	   stosd
105
	   stosd