Subversion Repositories Kolibri OS

Rev

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

Rev 2439 Rev 2441
Line 67... Line 67...
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 68... Line 68...
68
 
68
 
69
include 'macros.inc'
69
include 'macros.inc'
Line 70... Line 70...
70
include 'struct.inc'
70
include 'struct.inc'
Line 71... Line 71...
71
 
71
 
Line 72... Line 72...
72
$Revision: 2439 $
72
$Revision: 2441 $
Line 328... Line 328...
328
tmp_page_tabs   dd ?
328
tmp_page_tabs   dd ?
Line 329... Line 329...
329
 
329
 
330
 
330
 
-
 
331
__DEBUG__       fix 1
-
 
332
__DEBUG_LEVEL__ fix 1
331
__DEBUG__ fix 1
333
include 'fdo.inc'
Line 332... Line 334...
332
__DEBUG_LEVEL__ fix 1
334
 
Line 333... Line 335...
333
include 'init.inc'
335
include 'init.inc'
Line 399... Line 401...
399
 
401
 
400
        mov     ecx, disk_list_mutex
402
        mov     ecx, disk_list_mutex
Line 401... Line 403...
401
        call    mutex_init
403
        call    mutex_init
402
 
404
 
403
; SAVE REAL MODE VARIABLES
405
; SAVE REAL MODE VARIABLES
404
        mov     ax, [BOOT_VAR + 0x9031]
406
        mov     ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
Line 405... Line 407...
405
        mov     [IDEContrRegsBaseAddr], ax
407
        mov     [IDEContrRegsBaseAddr], ax
406
; --------------- APM ---------------------
408
; --------------- APM ---------------------
407
 
409
 
408
; init selectors
410
; init selectors
409
        mov     ebx, [BOOT_VAR+0x9040]          ; offset of APM entry point
411
        mov     ebx, [BOOT_VAR+BOOT_APM_ENTRY]        ; offset of APM entry point
410
        movzx   eax, word [BOOT_VAR+0x9050]; real-mode segment base address of
412
        movzx   eax, word [BOOT_VAR+BOOT_APM_CODE_32] ; real-mode segment base address of
411
                                                                                ; protected-mode 32-bit code segment
413
                                                      ; protected-mode 32-bit code segment
412
        movzx   ecx, word [BOOT_VAR+0x9052]; real-mode segment base address of
414
        movzx   ecx, word [BOOT_VAR+BOOT_APM_CODE_16]; real-mode segment base address of
Line 413... Line 415...
413
                                                                                ; protected-mode 16-bit code segment
415
                                               ; protected-mode 16-bit code segment
414
        movzx   edx, word [BOOT_VAR+0x9054]; real-mode segment base address of
416
        movzx   edx, word [BOOT_VAR+BOOT_APM_DATA_16]; real-mode segment base address of
415
                                                                                ; protected-mode 16-bit data segment
417
                                                                                ; protected-mode 16-bit data segment
Line 430... Line 432...
430
        mov     [dword apm_data_16 + 4], dl
432
        mov     [dword apm_data_16 + 4], dl
Line 431... Line 433...
431
 
433
 
432
        mov     dword[apm_entry], ebx
434
        mov     dword[apm_entry], ebx
Line 433... Line 435...
433
        mov     word [apm_entry + 4], apm_code_32 - gdts
435
        mov     word [apm_entry + 4], apm_code_32 - gdts
434
 
436
 
435
        mov     eax, [BOOT_VAR + 0x9044]; version & flags
437
        mov     eax, [BOOT_VAR + BOOT_APM_VERSION] ; version & flags
436
        mov     [apm_vf], eax
-
 
437
; -----------------------------------------
-
 
438
;        movzx eax,byte [BOOT_VAR+0x9010]       ; mouse port
438
        mov     [apm_vf], eax
439
;        mov   [0xF604],byte 1  ;al
439
; -----------------------------------------
440
        mov     al, [BOOT_VAR+0x901F]                   ; DMA access
440
        mov     al, [BOOT_VAR+BOOT_DMA]            ; DMA access
441
        mov     [allow_dma_access], al
441
        mov     [allow_dma_access], al
Line 442... Line 442...
442
        movzx   eax, byte [BOOT_VAR+0x9000]      ; bpp
442
        movzx   eax, byte [BOOT_VAR+BOOT_BPP]      ; bpp
443
        mov     [ScreenBPP], al
443
        mov     [ScreenBPP], al
Line 444... Line 444...
444
 
444
 
445
        mov     [_display.bpp], eax
445
        mov     [_display.bpp], eax
446
        mov     [_display.vrefresh], 60
446
        mov     [_display.vrefresh], 60
447
 
447
 
448
        movzx   eax, word [BOOT_VAR+0x900A]; X max
448
        movzx   eax, word [BOOT_VAR+BOOT_X_RES]; X max
449
        mov     [_display.width], eax
449
        mov     [_display.width], eax
450
        dec     eax
450
        dec     eax
451
        mov     [Screen_Max_X], eax
451
        mov     [Screen_Max_X], eax
452
        mov     [screen_workarea.right], eax
452
        mov     [screen_workarea.right], eax
453
        movzx   eax, word [BOOT_VAR+0x900C]; Y max
453
        movzx   eax, word [BOOT_VAR+BOOT_Y_RES]; Y max
454
        mov     [_display.height], eax
454
        mov     [_display.height], eax
455
        dec     eax
455
        dec     eax
456
        mov     [Screen_Max_Y], eax
456
        mov     [Screen_Max_Y], eax
457
        mov     [screen_workarea.bottom], eax
457
        mov     [screen_workarea.bottom], eax
458
        movzx   eax, word [BOOT_VAR+0x9008]; screen mode
458
        movzx   eax, word [BOOT_VAR+BOOT_VESA_MODE]; screen mode
459
        mov     [SCR_MODE], eax
459
        mov     [SCR_MODE], eax
460
;        mov     eax, [BOOT_VAR+0x9014]    ; Vesa 1.2 bnk sw add
460
;        mov     eax, [BOOT_VAR+0x9014]    ; Vesa 1.2 bnk sw add
461
;        mov     [BANK_SWITCH], eax
461
;        mov     [BANK_SWITCH], eax
462
        mov     [BytesPerScanLine], word 640*4      ; Bytes PerScanLine
462
        mov     [BytesPerScanLine], word 640*4      ; Bytes PerScanLine
463
        cmp     [SCR_MODE], word 0x13       ; 320x200
463
        cmp     [SCR_MODE], word 0x13       ; 320x200
464
        je      @f
464
        je      @f
465
        cmp     [SCR_MODE], word 0x12       ; VGA 640x480
465
        cmp     [SCR_MODE], word 0x12       ; VGA 640x480
466
        je      @f
466
        je      @f
467
        movzx   eax, word[BOOT_VAR+0x9001]      ; for other modes
467
        movzx   eax, word[BOOT_VAR+BOOT_PITCH]   ; for other modes
468
        mov     [BytesPerScanLine], ax
468
        mov     [BytesPerScanLine], ax
Line 480... Line 480...
480
        mov     edi, BiosDisksData
480
        mov     edi, BiosDisksData
481
        rep movsd
481
        rep movsd
Line 482... Line 482...
482
 
482
 
Line 483... Line -...
483
; GRAPHICS ADDRESSES
-
 
484
 
483
; GRAPHICS ADDRESSES
485
        and     byte [BOOT_VAR+0x901e], 0x0
484
 
Line 486... Line 485...
486
        mov     eax, [BOOT_VAR+0x9018]
485
        mov     eax, [BOOT_VAR+BOOT_LFB]
487
        mov     [LFBAddress], eax
486
        mov     [LFBAddress], eax
488
 
487
 
Line 1052... Line 1051...
1052
        mov     al, 0x7 + 1 shl 5
1051
        mov     al, 0x7 + 1 shl 5
1053
        out     dx, al
1052
        out     dx, al
Line 1054... Line 1053...
1054
 
1053
 
-
 
1054
 
-
 
1055
end if
-
 
1056
        mov     eax, [cpu_count]
-
 
1057
        test    eax, eax
-
 
1058
        jnz     @F
-
 
1059
        mov al, 1                               ; at least one CPU
Line 1055... Line 1060...
1055
 
1060
@@:
Line 1056... Line 1061...
1056
end if
1061
        DEBUGF  1, "K : %d CPU detected\n", eax
1057
 
1062
 
Line 1078... Line 1083...
1078
 
1083
 
Line 1079... Line 1084...
1079
 
1084
 
1080
        ; Fly :)
-
 
Line 1081... Line 1085...
1081
 
1085
        ; Fly :)
1082
include 'unpacker.inc'
1086
 
1083
include 'fdo.inc'
1087
include 'unpacker.inc'
Line 1212... Line 1216...
1212
.fl60:
1216
.fl60:
1213
        in      al, 0x60
1217
        in      al, 0x60
1214
        loop    .fl60
1218
        loop    .fl60
1215
        push    eax
1219
        push    eax
Line 1216... Line 1220...
1216
 
1220
 
1217
        mov     ax, [BOOT_VAR+0x900c]
1221
        mov     ax, [BOOT_VAR+BOOT_Y_RES]
1218
        shr     ax, 1
1222
        shr     ax, 1
1219
        shl     eax, 16
1223
        shl     eax, 16
1220
        mov     ax, [BOOT_VAR+0x900A]
1224
        mov     ax, [BOOT_VAR+BOOT_X_RES]
1221
        shr     ax, 1
1225
        shr     ax, 1
Line 1222... Line 1226...
1222
        mov     [MOUSE_X], eax
1226
        mov     [MOUSE_X], eax
1223
 
1227