Subversion Repositories Kolibri OS

Rev

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

Rev 897 Rev 928
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. 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: 897 $
8
$Revision: 928 $
9
 
9
 
10
 
10
 
Line 176... Line 176...
176
           invlpg [eax]
176
           invlpg [eax]
177
           pop ebx
177
           pop ebx
178
           ret
178
           ret
179
endp
179
endp
Line 180... Line -...
180
 
-
 
181
align 4
-
 
182
proc init_LFB
-
 
183
           locals
-
 
184
             pg_count dd ?
-
 
185
           endl
-
 
186
 
-
 
187
           cmp dword [LFBAddress], -1
-
 
188
           jne @f
-
 
189
           mov [BOOT_VAR+0x901c],byte 2
-
 
190
           mov ecx, 0x280000
-
 
191
           mov edx, PG_SW
-
 
192
           call @mem_alloc@8
-
 
193
           mov [LFBAddress], eax
-
 
194
           ret
-
 
195
@@:
-
 
196
           test [SCR_MODE],word 0100000000000000b
-
 
197
           jnz @f
-
 
198
           mov [BOOT_VAR+0x901c],byte 2
-
 
199
           ret
-
 
200
@@:
-
 
201
           call init_mtrr
-
 
202
 
-
 
203
           mov eax, [LFBAddress]
-
 
204
           or eax, PG_LARGE+PG_UW
-
 
205
           mov [_sys_pdbr+(LFB_BASE shr 20)], eax
-
 
206
           add eax, 0x00400000
-
 
207
           mov [_sys_pdbr+4+(LFB_BASE shr 20)], eax
-
 
208
 
-
 
209
           mov dword [exp_lfb+4], LFB_BASE
-
 
210
 
-
 
211
           bt [cpu_caps], CAPS_PGE
-
 
212
           jnc @F
-
 
213
           or dword [_sys_pdbr+(LFB_BASE shr 20)], PG_GLOBAL
-
 
214
@@:
-
 
215
           mov dword [LFBAddress], LFB_BASE
-
 
216
           mov eax, cr3       ;flush TLB
-
 
217
           mov cr3, eax
-
 
218
 
-
 
219
           ret
-
 
Line 220... Line 180...
220
endp
180
 
221
 
181
 
Line 222... Line 182...
222
align 4
182
align 4
Line 393... Line 353...
393
           pushad
353
           pushad
394
           mov ebp, esp
354
           mov ebp, esp
395
           mov eax, cr2
355
           mov eax, cr2
396
           push eax
356
           push eax
Line 397... Line 357...
397
 
357
 
398
           mov ax, app_data
358
           mov ax, sel_app_data
399
           mov ds, ax
359
           mov ds, ax
Line 400... Line 360...
400
           mov es, ax
360
           mov es, ax
Line 405... Line 365...
405
           mov eax, [.err_code]
365
           mov eax, [.err_code]
Line 406... Line 366...
406
 
366
 
407
           cmp ebx, HEAP_BASE
367
           cmp ebx, HEAP_BASE
Line 408... Line -...
408
           jb .user_space      ;ñòðàíèöà â ïàìÿòè ïðèëîæåíèÿ ;
-
 
409
 
-
 
410
           cmp ebx, LFB_BASE
-
 
411
           jb  .kernel_heap
368
           jb .user_space      ;ñòðàíèöà â ïàìÿòè ïðèëîæåíèÿ ;
412
 
369
 
Line 413... Line 370...
413
           cmp ebx, page_tabs
370
           cmp ebx, page_tabs
414
           jb .lfb
371
           jb  .kernel_heap
Line 415... Line 372...
415
 
372
 
416
           cmp ebx, heap_tabs
373
           cmp ebx, heap_tabs
Line -... Line 374...
-
 
374
           jb .user_tabs
-
 
375
 
Line 417... Line 376...
417
           jb .user_tabs
376
           cmp ebx, LFB_BASE
418
 
377
           jb .heap_tab
419
           cmp ebx, OS_BASE
378
 
Line 420... Line -...
420
           jb .heap_tab
-
 
421
 
-
 
422
 
379
           cmp ebx, OS_BASE
423
         ;  cmp ebx, kernel_tabs
380
           jb .lfb
424
         ;  jb .alloc;.app_tabs ;òàáëèöû ñòðàíèö ïðèëîæåíèÿ ;
381
 
425
                               ;ïðîñòî ñîçäàäèì îäíó
382
         ;  cmp ebx, kernel_tabs
426
 
383
         ;  jb .alloc;.app_tabs ;òàáëèöû ñòðàíèö ïðèëîæåíèÿ ;
Line 994... Line 951...
994
           call    user_realloc
951
           call    user_realloc
995
           mov     [esp+36], eax
952
           mov     [esp+36], eax
996
           ret
953
           ret
997
@@:
954
@@:
998
           cmp eax, 21                     ;for test purposes only
955
           cmp eax, 21                     ;for test purposes only
999
           ja @f                           ;will be removed soon
956
           ja .fail                        ;will be removed soon
1000
           cmp ebx, OS_BASE
957
           cmp ebx, OS_BASE
1001
           jae .fail
958
           jae .fail
Line 1002... Line 959...
1002
 
959
 
1003
           mov ecx, ebx
960
           mov ecx, ebx
Line 1176... Line 1133...
1176
 
1133
 
1177
align 4
1134
align 4
1178
_balloc:   ; gcc fastcall
1135
_balloc:   ; gcc fastcall
Line 1179... Line -...
1179
@balloc@4:
-
 
1180
 
1136
@balloc@4:
1181
 
1137
 
1182
           mov eax, [_pg_balloc]
1138
           mov eax, [_pg_balloc]
1183
           add ecx, 4095
1139
           add ecx, 4095
1184
           and ecx, -4096
1140
           and ecx, -4096