Subversion Repositories Kolibri OS

Rev

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

Rev 2382 Rev 2540
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. 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: 2382 $
8
$Revision $
9
 
9
 
Line 164... Line 164...
164
        mov     [page_start], eax
164
        mov     [page_start], eax
165
        popfd
165
        popfd
166
        ret
166
        ret
167
endp
167
endp
Line -... Line 168...
-
 
168
 
168
 
169
align 4
Line 169... Line 170...
169
proc map_io_mem stdcall, base:dword, size:dword, flags:dword
170
proc map_io_mem stdcall, base:dword, size:dword, flags:dword
170
 
171
 
171
        push    ebx
172
        push    ebx
Line 355... Line 356...
355
             pg_count dd ?
356
             pg_count dd ?
356
           endl
357
           endl
Line 357... Line 358...
357
 
358
 
358
        cmp     dword [LFBAddress], -1
359
        cmp     dword [LFBAddress], -1
359
        jne     @f
360
        jne     @f
-
 
361
        mov     [BOOT_VAR+BOOT_MTRR], byte 2
-
 
362
; max VGA=640*480*4=1228800 bytes
360
        mov     [BOOT_VAR+0x901c], byte 2
363
; + 32*640*4=81920 bytes for mouse pointer
Line 361... Line 364...
361
        stdcall alloc_pages, (0x280000 / 4096)
364
        stdcall alloc_pages, ((1228800+81920)/4096)
362
 
365
 
363
        push    eax
366
        push    eax
364
        call    alloc_page
367
        call    alloc_page
365
        stdcall map_page_table, LFB_BASE, eax
368
        stdcall map_page_table, LFB_BASE, eax
366
        pop     eax
369
        pop     eax
-
 
370
        or      eax, PG_UW
-
 
371
        mov     ebx, LFB_BASE
367
        or      eax, PG_UW
372
; max VGA=640*480*4=1228800 bytes
368
        mov     ebx, LFB_BASE
373
; + 32*640*4=81920 bytes for mouse pointer
369
        mov     ecx, 0x280000 / 4096
374
        mov     ecx, (1228800+81920)/4096
370
        call    commit_pages
375
        call    commit_pages
371
        mov     [LFBAddress], dword LFB_BASE
376
        mov     [LFBAddress], dword LFB_BASE
372
        ret
377
        ret
373
@@:
378
@@:
374
        test    [SCR_MODE], word 0100000000000000b
379
        test    [SCR_MODE], word 0100000000000000b
375
        jnz     @f
380
        jnz     @f
376
        mov     [BOOT_VAR+0x901c], byte 2
381
        mov     [BOOT_VAR+BOOT_MTRR], byte 2
377
        ret
382
        ret
Line 378... Line 383...
378
@@:
383
@@:
Line 1301... Line 1306...
1301
        jecxz   @f
1306
        jecxz   @f
1302
        bts     [eax+APPDATA.except_mask], ecx
1307
        bts     [eax+APPDATA.except_mask], ecx
1303
@@:
1308
@@:
1304
        ret
1309
        ret
Line -... Line 1310...
-
 
1310
 
-
 
1311
.26:
-
 
1312
        stdcall user_unmap, ecx, edx, esi
-
 
1313
        mov     [esp+32], eax
-
 
1314
        ret
1305
 
1315
 
1306
.fail:
1316
.fail:
1307
        xor     eax, eax
1317
        xor     eax, eax
1308
        mov     [esp+32], eax
1318
        mov     [esp+32], eax
Line 1323... Line 1333...
1323
           dd f68.19   ; load_dll
1333
           dd f68.19   ; load_dll
1324
           dd f68.20   ; user_realloc
1334
           dd f68.20   ; user_realloc
1325
           dd f68.21   ; load_driver
1335
           dd f68.21   ; load_driver
1326
           dd f68.22   ; shmem_open
1336
           dd f68.22   ; shmem_open
1327
           dd f68.23   ; shmem_close
1337
           dd f68.23   ; shmem_close
-
 
1338
           dd f68.24   ; set exception handler
1328
           dd f68.24
1339
           dd f68.25   ; unmask exception
1329
           dd f68.25
1340
           dd f68.26   ; user_unmap
Line 1330... Line 1341...
1330
 
1341
 
1331
 
1342
 
Line 1351... Line 1362...
1351
 
1362
 
1352
 
1363
 
Line 1353... Line 1364...
1353
align 4
1364
align 4
1354
proc init_mtrr
1365
proc init_mtrr
Line 1355... Line 1366...
1355
 
1366
 
1356
        cmp     [BOOT_VAR+0x901c], byte 2
1367
        cmp     [BOOT_VAR+BOOT_MTRR], byte 2
Line 1541... Line 1552...
1541
        xor     eax, eax
1552
        xor     eax, eax
1542
        pop     ebx
1553
        pop     ebx
1543
.fail:
1554
.fail:
1544
        ret
1555
        ret
1545
endp
1556
endp
-
 
1557
 
-
 
1558
 
-
 
1559
align 4
-
 
1560
proc print_mem
-
 
1561
        mov     edi, BOOT_VAR + 0x9104
-
 
1562
        mov     ecx, [edi-4]
-
 
1563
        test    ecx, ecx
-
 
1564
        jz      .done
-
 
1565
 
-
 
1566
@@:
-
 
1567
        mov     eax, [edi]
-
 
1568
        mov     edx, [edi+4]
-
 
1569
        add     eax, [edi+8]
-
 
1570
        adc     edx, [edi+12]
-
 
1571
 
-
 
1572
        DEBUGF  1, "K : E820 %x%x - %x%x type %d\n", \
-
 
1573
                    [edi+4], [edi],\
-
 
1574
                    edx, eax, [edi+16]
-
 
1575
        add     edi, 20
-
 
1576
        dec     ecx
-
 
1577
        jnz     @b
-
 
1578
.done:
-
 
1579
        ret
-
 
1580
endp