Subversion Repositories Kolibri OS

Rev

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

Rev 2464 Rev 2466
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: 2464 $
72
$Revision: 2466 $
Line 331... Line 331...
331
 
331
 
332
        mov     ecx, disk_list_mutex
332
        mov     ecx, disk_list_mutex
Line 333... Line 333...
333
        call    mutex_init
333
        call    mutex_init
334
 
334
 
335
; SAVE REAL MODE VARIABLES
335
; SAVE REAL MODE VARIABLES
336
        mov     ax, [BOOT_VAR + 0x9031]
336
        mov     ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
Line 337... Line 337...
337
        mov     [IDEContrRegsBaseAddr], ax
337
        mov     [IDEContrRegsBaseAddr], ax
338
; --------------- APM ---------------------
338
; --------------- APM ---------------------
339
 
339
 
340
; init selectors
340
; init selectors
341
        mov     ebx, [BOOT_VAR+0x9040]          ; offset of APM entry point
341
        mov     ebx, [BOOT_VAR+BOOT_APM_ENTRY]        ; offset of APM entry point
342
        movzx   eax, word [BOOT_VAR+0x9050]; real-mode segment base address of
342
        movzx   eax, word [BOOT_VAR+BOOT_APM_CODE_32] ; real-mode segment base address of
343
                                                                                ; protected-mode 32-bit code segment
343
                                                                                ; protected-mode 32-bit code segment
344
        movzx   ecx, word [BOOT_VAR+0x9052]; real-mode segment base address of
344
        movzx   ecx, word [BOOT_VAR+BOOT_APM_CODE_16]; real-mode segment base address of
Line 345... Line 345...
345
                                                                                ; protected-mode 16-bit code segment
345
                                                                                ; protected-mode 16-bit code segment
346
        movzx   edx, word [BOOT_VAR+0x9054]; real-mode segment base address of
346
        movzx   edx, word [BOOT_VAR+BOOT_APM_DATA_16]; real-mode segment base address of
347
                                                                                ; protected-mode 16-bit data segment
347
                                                                                ; protected-mode 16-bit data segment
Line 362... Line 362...
362
        mov     [dword apm_data_16 + 4], dl
362
        mov     [dword apm_data_16 + 4], dl
Line 363... Line 363...
363
 
363
 
364
        mov     dword[apm_entry], ebx
364
        mov     dword[apm_entry], ebx
Line 365... Line 365...
365
        mov     word [apm_entry + 4], apm_code_32 - gdts
365
        mov     word [apm_entry + 4], apm_code_32 - gdts
366
 
366
 
367
        mov     eax, [BOOT_VAR + 0x9044]; version & flags
367
        mov     eax, [BOOT_VAR + BOOT_APM_VERSION] ; version & flags
368
        mov     [apm_vf], eax
-
 
369
; -----------------------------------------
-
 
370
;        movzx eax,byte [BOOT_VAR+0x9010]       ; mouse port
368
        mov     [apm_vf], eax
371
;        mov   [0xF604],byte 1  ;al
369
; -----------------------------------------
372
        mov     al, [BOOT_VAR+0x901F]                   ; DMA access
370
        mov     al, [BOOT_VAR+BOOT_DMA]            ; DMA access
373
        mov     [allow_dma_access], al
371
        mov     [allow_dma_access], al
Line 374... Line 372...
374
        movzx   eax, byte [BOOT_VAR+0x9000]      ; bpp
372
        movzx   eax, byte [BOOT_VAR+BOOT_BPP]      ; bpp
375
        mov     [ScreenBPP], al
373
        mov     [ScreenBPP], al
Line 376... Line 374...
376
 
374
 
377
        mov     [_display.bpp], eax
375
        mov     [_display.bpp], eax
378
        mov     [_display.vrefresh], 60
376
        mov     [_display.vrefresh], 60
379
 
377
 
380
        movzx   eax, word [BOOT_VAR+0x900A]; X max
378
        movzx   eax, word [BOOT_VAR+BOOT_X_RES]; X max
381
        mov     [_display.width], eax
379
        mov     [_display.width], eax
382
        dec     eax
380
        dec     eax
383
        mov     [Screen_Max_X], eax
381
        mov     [Screen_Max_X], eax
384
        mov     [screen_workarea.right], eax
382
        mov     [screen_workarea.right], eax
385
        movzx   eax, word [BOOT_VAR+0x900C]; Y max
383
        movzx   eax, word [BOOT_VAR+BOOT_Y_RES]; Y max
386
        mov     [_display.height], eax
384
        mov     [_display.height], eax
387
        dec     eax
385
        dec     eax
388
        mov     [Screen_Max_Y], eax
386
        mov     [Screen_Max_Y], eax
389
        mov     [screen_workarea.bottom], eax
387
        mov     [screen_workarea.bottom], eax
390
        movzx   eax, word [BOOT_VAR+0x9008]; screen mode
388
        movzx   eax, word [BOOT_VAR+BOOT_VESA_MODE]; screen mode
391
        mov     [SCR_MODE], eax
389
        mov     [SCR_MODE], eax
392
;        mov     eax, [BOOT_VAR+0x9014]    ; Vesa 1.2 bnk sw add
390
;        mov     eax, [BOOT_VAR+0x9014]    ; Vesa 1.2 bnk sw add
393
;        mov     [BANK_SWITCH], eax
391
;        mov     [BANK_SWITCH], eax
394
        mov     [BytesPerScanLine], word 640*4      ; Bytes PerScanLine
392
        mov     [BytesPerScanLine], word 640*4      ; Bytes PerScanLine
395
        cmp     [SCR_MODE], word 0x13       ; 320x200
393
        cmp     [SCR_MODE], word 0x13       ; 320x200
396
        je      @f
394
        je      @f
397
        cmp     [SCR_MODE], word 0x12       ; VGA 640x480
395
        cmp     [SCR_MODE], word 0x12       ; VGA 640x480
398
        je      @f
396
        je      @f
399
        movzx   eax, word[BOOT_VAR+0x9001]      ; for other modes
397
        movzx   eax, word[BOOT_VAR+BOOT_PITCH]   ; for other modes
400
        mov     [BytesPerScanLine], ax
398
        mov     [BytesPerScanLine], ax
Line 412... Line 410...
412
        mov     edi, BiosDisksData
410
        mov     edi, BiosDisksData
413
        rep movsd
411
        rep movsd
Line 414... Line 412...
414
 
412
 
Line 415... Line -...
415
; GRAPHICS ADDRESSES
-
 
416
 
413
; GRAPHICS ADDRESSES
417
        and     byte [BOOT_VAR+0x901e], 0x0
414
 
Line 418... Line 415...
418
        mov     eax, [BOOT_VAR+0x9018]
415
        mov     eax, [BOOT_VAR+BOOT_LFB]
419
        mov     [LFBAddress], eax
416
        mov     [LFBAddress], eax
420
 
417
 
Line 1146... Line 1143...
1146
.fl60:
1143
.fl60:
1147
        in      al, 0x60
1144
        in      al, 0x60
1148
        loop    .fl60
1145
        loop    .fl60
1149
        push    eax
1146
        push    eax
Line 1150... Line 1147...
1150
 
1147
 
1151
        mov     ax, [BOOT_VAR+0x900c]
1148
        mov     ax, [BOOT_VAR+BOOT_Y_RES]
1152
        shr     ax, 1
1149
        shr     ax, 1
1153
        shl     eax, 16
1150
        shl     eax, 16
1154
        mov     ax, [BOOT_VAR+0x900A]
1151
        mov     ax, [BOOT_VAR+BOOT_X_RES]
1155
        shr     ax, 1
1152
        shr     ax, 1
Line 1156... Line 1153...
1156
        mov     [MOUSE_X], eax
1153
        mov     [MOUSE_X], eax
1157
 
1154