Subversion Repositories Kolibri OS

Rev

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

Rev 9715 Rev 9926
Line 5... Line 5...
5
;;                                                              ;;
5
;;                                                              ;;
6
;; Synhronization for MenuetOS.                                 ;;
6
;; Synhronization for MenuetOS.                                 ;;
7
;; Author: Halyavin Andrey, halyavin@land.ru                    ;;
7
;; Author: Halyavin Andrey, halyavin@land.ru                    ;;
8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 9... Line 9...
9
 
9
 
Line 10... Line 10...
10
$Revision: 9715 $
10
$Revision: 9926 $
11
 
11
 
12
struct FRB
12
struct FRB
13
        list            LHEAD
13
        list            LHEAD
Line 154... Line 154...
154
 
154
 
155
        add     ebp, FRB.pde
155
        add     ebp, FRB.pde
156
        or      esi, PG_GLOBAL + PAT_WC + PG_UWR
156
        or      esi, PG_GLOBAL + PAT_WC + PG_UWR
Line 157... Line 157...
157
        and     esi, [pte_valid_mask]
157
        and     esi, [pte_valid_mask]
158
 
158
 
159
        stdcall alloc_kernel_space, 0x1000
159
        stdcall alloc_kernel_space, PAGE_SIZE
Line 160... Line 160...
160
        mov     edi, eax
160
        mov     edi, eax
161
        mov     ebx, 4
161
        mov     ebx, 4
Line 166... Line 166...
166
        mov     [ebp], edx
166
        mov     [ebp], edx
Line 167... Line 167...
167
 
167
 
Line 168... Line 168...
168
        stdcall map_page, edi, eax, PG_SWR
168
        stdcall map_page, edi, eax, PG_SWR
169
 
169
 
170
        mov     eax, esi
170
        mov     eax, esi
171
        mov     ecx, 1024
171
        mov     ecx, PAGE_SIZE/4
172
@@:
172
@@:
173
        stosd
173
        stosd
Line 174... Line 174...
174
        add     eax, 0x1000
174
        add     eax, PAGE_SIZE
175
        loop    @B
175
        loop    @B
176
 
176
 
177
        add     esi, 0x400000
177
        add     esi, 0x400000
178
        add     ebp, 4
178
        add     ebp, 4
179
        sub     edi, 4096
179
        sub     edi, PAGE_SIZE
180
        dec     ebx
180
        dec     ebx
Line 181... Line 181...
181
        jnz     .new_pd
181
        jnz     .new_pd
182
        stdcall free_kernel_space, edi
182
        stdcall free_kernel_space, edi
Line 183... Line 183...
183
        jmp     .ok
183
        jmp     .ok
184
 
184
 
185
.fake:
185
.fake:
Line 186... Line 186...
186
        mov     [BOOT.mtrr], byte 2
186
        mov     [BOOT.mtrr], byte 2
187
 
187
 
Line 195... Line 195...
195
 
195
 
Line 196... Line 196...
196
        stdcall map_page, edi, eax, PG_SWR
196
        stdcall map_page, edi, eax, PG_SWR
197
 
197
 
198
; max VGA=640*480*4=1228800 bytes
198
; max VGA=640*480*4=1228800 bytes
199
; + 32*640*4=81920 bytes for mouse pointer
199
; + 32*640*4=81920 bytes for mouse pointer
200
        stdcall alloc_pages, ((1228800+81920)/4096)
200
        stdcall alloc_pages, ((1228800+81920)/PAGE_SIZE)
201
        or      eax, PG_GLOBAL+PG_UWR
201
        or      eax, PG_GLOBAL+PG_UWR
202
        and     eax, [pte_valid_mask]
202
        and     eax, [pte_valid_mask]
203
        mov     ecx, (1228800+81920)/4096
203
        mov     ecx, (1228800+81920)/PAGE_SIZE
204
@@:
204
@@:
205
        stosd
205
        stosd
Line 206... Line 206...
206
        add     eax, 0x1000
206
        add     eax, PAGE_SIZE
207
        loop    @B
207
        loop    @B
Line 219... Line 219...
219
        cld
219
        cld
220
        pushfd
220
        pushfd
221
        cli
221
        cli
222
        mov     [_display.current_lfb], ecx
222
        mov     [_display.current_lfb], ecx
223
.patch_pde:
223
.patch_pde:
224
        lea     edi, [eax + PROC.pdt_0+4096-32]   ;last 8 pd entries up to 32Mb framebuffer
224
        lea     edi, [eax + PROC.pdt_0 + PAGE_SIZE -32] ;last 8 pd entries up to 32Mb framebuffer
225
        mov     ecx, 4
225
        mov     ecx, 4
226
        rep movsd                               ;patch pde
226
        rep movsd                               ;patch pde
227
        sub     esi, 16
227
        sub     esi, 16
228
        mov     eax, [eax + PROC.list.next]       ;next process/address space
228
        mov     eax, [eax + PROC.list.next]       ;next process/address space
229
        cmp     eax, sys_proc
229
        cmp     eax, sys_proc