Rev 6311 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6311 | Rev 6339 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | width rd 1 |
18 | width rd 1 |
19 | height rd 1 |
19 | height rd 1 |
20 | pitch rd 1 |
20 | pitch rd 1 |
21 | format rd 1 |
21 | format rd 1 |
22 | private rd 1 |
22 | private rd 1 |
23 | pde rd 8 |
23 | pde rd 16*2 |
24 | ends |
24 | ends |
Line 25... | Line 25... | ||
25 | 25 | ||
26 | align 4 |
26 | align 4 |
27 | create_framebuffer: |
27 | create_framebuffer: |
Line 124... | Line 124... | ||
124 | 124 | ||
125 | mov esi, [LFBAddress] |
125 | mov esi, [LFBAddress] |
126 | bt [cpu_caps], CAPS_PSE |
126 | bt [cpu_caps], CAPS_PSE |
Line 127... | Line 127... | ||
127 | jnc .create_page_tables |
127 | jnc .create_page_tables |
128 | 128 | ||
129 | mov edx, 0x00400000 |
129 | mov edx, 0x00200000 |
130 | or esi, PG_GLOBAL+PAT_WC+PG_UWR |
130 | or esi, PG_GLOBAL+PAT_WC+PG_UWR |
131 | and esi, [pte_valid_mask] |
131 | and esi, [pte_valid_mask] |
132 | or esi, PDE_LARGE |
132 | or esi, PDE_LARGE |
133 | mov [ebp+FRB.pde], esi |
- | |
134 | add esi, edx |
- | |
135 | mov [ebp+FRB.pde+4], esi |
133 | mov [ebp+FRB.pde], esi |
136 | add esi, edx |
134 | add esi, edx |
137 | mov [ebp+FRB.pde+8], esi |
135 | mov [ebp+FRB.pde+8], esi |
- | 136 | add esi, edx |
|
- | 137 | mov [ebp+FRB.pde+16], esi |
|
138 | add esi, edx |
138 | add esi, edx |
139 | mov [ebp+FRB.pde+12], esi |
139 | mov [ebp+FRB.pde+24], esi |
140 | add esi, edx |
140 | add esi, edx |
141 | .ok: |
141 | .ok: |
142 | call calculate_fast_getting_offset_for_WinMapAddress |
142 | call calculate_fast_getting_offset_for_WinMapAddress |
Line 152... | Line 152... | ||
152 | or esi, PG_GLOBAL+PAT_WC+PG_UWR |
152 | or esi, PG_GLOBAL+PAT_WC+PG_UWR |
153 | and esi, [pte_valid_mask] |
153 | and esi, [pte_valid_mask] |
Line 154... | Line 154... | ||
154 | 154 | ||
155 | stdcall alloc_kernel_space, 0x1000 |
155 | stdcall alloc_kernel_space, 0x1000 |
156 | mov edi, eax |
156 | mov edi, eax |
Line 157... | Line 157... | ||
157 | mov ebx, 4 |
157 | mov ebx, 8 |
158 | 158 | ||
159 | .new_pd: |
159 | .new_pd: |
160 | call alloc_page |
160 | call alloc_page |
Line 161... | Line 161... | ||
161 | lea edx, [eax+PG_UWR] |
161 | lea edx, [eax+PG_UWR] |
Line 162... | Line 162... | ||
162 | mov [ebp], edx |
162 | mov [ebp], edx |
163 | 163 | ||
164 | stdcall map_page, edi, eax, PG_SWR |
164 | stdcall map_page, edi, eax, PG_SWR |
165 | 165 | ||
- | 166 | mov eax, esi |
|
166 | mov eax, esi |
167 | mov ecx, 512 |
- | 168 | @@: |
|
167 | mov ecx, 1024 |
169 | mov [edi], eax |
Line 168... | Line 170... | ||
168 | @@: |
170 | mov [edi+4], dword 0 |
169 | stosd |
171 | add eax, 0x1000 |
170 | add eax, 0x1000 |
172 | add edi, 8 |
171 | loop @B |
173 | loop @B |
172 | 174 | ||
173 | add esi, 0x400000 |
175 | add esi, 0x200000 |
Line 196... | Line 198... | ||
196 | stdcall alloc_pages, ((1228800+81920)/4096) |
198 | stdcall alloc_pages, ((1228800+81920)/4096) |
197 | or eax, PG_GLOBAL+PG_UWR |
199 | or eax, PG_GLOBAL+PG_UWR |
198 | and eax, [pte_valid_mask] |
200 | and eax, [pte_valid_mask] |
199 | mov ecx, (1228800+81920)/4096 |
201 | mov ecx, (1228800+81920)/4096 |
200 | @@: |
202 | @@: |
201 | stosd |
203 | mov [edi], eax |
- | 204 | mov [edi+4],dword 0 |
|
202 | add eax, 0x1000 |
205 | add eax, 0x1000 |
- | 206 | add edi, 8 |
|
203 | loop @B |
207 | loop @B |
Line 204... | Line 208... | ||
204 | 208 | ||
205 | call free_kernel_space |
209 | call free_kernel_space |
Line 206... | Line 210... | ||
206 | jmp .ok |
210 | jmp .ok |
207 | 211 | ||
208 | align 4 |
212 | align 4 |
209 | set_framebuffer: |
213 | set_framebuffer: |
210 | push esi |
214 | push esi |
211 | push edi |
215 | push edi |
Line 212... | Line 216... | ||
212 | lea esi, [ecx+FRB.pde] |
216 | lea esi, [ecx+FRB.pde] |
213 | mov eax, sys_proc |
217 | mov edi, sys_pml2+OS_BASE+8192-16*8 |
214 | 218 | ||
- | 219 | cld |
|
215 | cld |
220 | pushfd |
- | 221 | cli |
|
216 | pushfd |
222 | |
217 | cli |
- | |
218 | mov [_display.current_lfb], ecx |
223 | mov [_display.current_lfb], ecx |
219 | .patch_pde: |
- | |
220 | lea edi, [eax+PROC.pdt_0+4096-32] ;last 8 pd entries up to 32Mb framebuffer |
224 | |
221 | mov ecx, 4 |
- | |
222 | rep movsd ;patch pde |
- | |
223 | sub esi, 16 |
- | |
Line 224... | Line 225... | ||
224 | mov eax, [eax+PROC.list.next] ;next process/address space |
225 | .patch_pde: |
225 | cmp eax, sys_proc |
226 | mov ecx, 16*2 |
Line 226... | Line 227... | ||
226 | jne .patch_pde |
227 | rep movsd |