Subversion Repositories Kolibri OS

Rev

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

Rev 465 Rev 513
Line 1... Line 1...
1
$Revision: 465 $
1
$Revision: 513 $
Line 2... Line 2...
2
 
2
 
3
MEM_WB     equ 6               ;write-back memory
3
MEM_WB     equ 6               ;write-back memory
4
MEM_WC     equ 1               ;write combined memory
4
MEM_WC     equ 1               ;write combined memory
Line 38... Line 38...
38
           mov edx, eax
38
           mov edx, eax
39
           mov [pg_data.pages_count-OS_BASE], eax
39
           mov [pg_data.pages_count-OS_BASE], eax
40
           shr eax, 3
40
           shr eax, 3
41
           mov [pg_data.pagemap_size-OS_BASE], eax
41
           mov [pg_data.pagemap_size-OS_BASE], eax
Line -... Line 42...
-
 
42
 
-
 
43
           add eax, (sys_pgmap-OS_BASE)+4095
-
 
44
           and eax, not 4095
-
 
45
           mov [tmp_page_tabs], eax
42
 
46
 
43
           cmp edx, (OS_BASE/4096)
47
           cmp edx, (OS_BASE/4096)
44
           jbe @F
48
           jbe @F
45
           mov edx, (OS_BASE/4096)
49
           mov edx, (OS_BASE/4096)
46
           jmp .set
50
           jmp .set
Line 72... Line 76...
72
 
76
 
73
           or eax, PG_GLOBAL
77
           or eax, PG_GLOBAL
74
           or ebx, CR4_PGE
78
           or ebx, CR4_PGE
75
@@:
79
@@:
76
           mov cr4, ebx
80
           mov cr4, ebx
Line 77... Line 81...
77
           sub [pg_data.kernel_tables-OS_BASE], 1
81
           dec [pg_data.kernel_tables-OS_BASE]
78
 
82
 
79
           mov [edx], eax
-
 
80
           add eax, 0x00400000
83
           mov [edx], eax
Line 81... Line 84...
81
;           mov [edx+4], eax
84
           add eax, 0x00400000
82
           add edx, 4
85
           add edx, 4
-
 
86
 
-
 
87
           mov eax, 0x400000+PG_SW
83
 
88
           mov ecx, [tmp_page_tabs]
84
           mov eax, 0x400000+PG_SW
89
           sub ecx, 0x400000
85
           mov ecx, (tmp_page_tab-0x400000)/4096
90
           shr ecx, 12          ;ecx/=4096
86
           jmp .map_low
91
           jmp .map_low
-
 
92
.no_PSE:
87
.no_PSE:
93
           mov eax, PG_SW
88
           mov eax, PG_SW
94
           mov ecx, [tmp_page_tabs]
89
           mov ecx, tmp_page_tab/4096
95
           shr ecx, 12
90
.map_low:
96
.map_low:
91
           mov edi, tmp_page_tab
97
           mov edi, [tmp_page_tabs]
92
@@:                                   ;
98
@@:                                   ;
93
           stosd
99
           stosd
Line 99... Line 105...
99
           shl ecx, 10
105
           shl ecx, 10
100
           xor eax, eax
106
           xor eax, eax
101
           rep stosd
107
           rep stosd
Line 102... Line 108...
102
 
108
 
103
           mov ecx, [pg_data.kernel_tables-OS_BASE]
109
           mov ecx, [pg_data.kernel_tables-OS_BASE]
-
 
110
           mov eax, [tmp_page_tabs]
104
           mov eax, tmp_page_tab+PG_SW
111
           or eax, PG_SW
Line 105... Line 112...
105
           mov edi, edx
112
           mov edi, edx
Line 106... Line 113...
106
 
113
 
Line 129... Line 136...
129
 
136
 
130
align 4
137
align 4
Line 131... Line 138...
131
proc init_page_map
138
proc init_page_map
132
 
-
 
133
           mov edi, sys_pgmap-OS_BASE
-
 
134
           mov ecx, ((HEAP_BASE-OS_BASE)/4096)/32      ;384/4
-
 
135
           mov ebx, ecx
-
 
136
           xor eax,eax
-
 
137
           cld
-
 
138
           rep stosd
-
 
139
 
139
 
140
           not eax
-
 
141
           mov ecx, [pg_data.pagemap_size-OS_BASE]
140
           mov edi, sys_pgmap-OS_BASE
-
 
141
           mov ecx, [pg_data.pagemap_size-OS_BASE]
-
 
142
           shr ecx, 2
142
           sub ecx, ebx
143
           or eax, -1
Line 143... Line 144...
143
           shr ecx, 2
144
           cld
144
           rep stosd
145
           rep stosd
145
 
146
 
146
           lea edi, [sys_pgmap-OS_BASE+ebx*4]         ;+384
147
           mov ecx, [tmp_page_tabs]
147
           mov edx, [pg_data.pages_count-OS_BASE]
-
 
148
           mov ecx, [pg_data.kernel_tables-OS_BASE]
148
           mov edx, [pg_data.pages_count-OS_BASE]
149
           add ecx, ((HEAP_BASE-OS_BASE)/4096) and 31
149
           shr ecx, 12
Line 150... Line 150...
150
           sub edx, (HEAP_BASE-OS_BASE)/4096
150
           add ecx, [pg_data.kernel_tables-OS_BASE]
151
           sub edx, ecx
151
           sub edx, ecx
152
           mov [pg_data.pages_free-OS_BASE], edx
152
           mov [pg_data.pages_free-OS_BASE], edx
-
 
153
 
153
 
154
           mov edi, sys_pgmap-OS_BASE
Line 154... Line 155...
154
           xor eax, eax
155
           mov ebx, ecx
155
           mov ebx, ecx
156
           shr ecx, 5
156
           shr ecx, 5
157
           xor eax, eax
Line 167... Line 168...
167
           mov ebx, sys_pgmap
168
           mov ebx, sys_pgmap
168
           add ebx, [pg_data.pagemap_size-OS_BASE]
169
           add ebx, [pg_data.pagemap_size-OS_BASE]
169
           mov [page_end-OS_BASE], ebx
170
           mov [page_end-OS_BASE], ebx
Line 170... Line 171...
170
 
171
 
171
           mov [pg_data.pg_mutex-OS_BASE], 0
-
 
172
 
172
           mov [pg_data.pg_mutex-OS_BASE], 0
173
           ret
173
           ret
Line 174... Line 174...
174
endp
174
endp
175
 
175