Subversion Repositories Kolibri OS

Rev

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

Rev 6244 Rev 6263
Line 69... Line 69...
69
format binary as "mnt"
69
format binary as "mnt"
Line 70... Line 70...
70
 
70
 
71
include 'macros.inc'
71
include 'macros.inc'
Line 72... Line 72...
72
include 'struct.inc'
72
include 'struct.inc'
Line 73... Line 73...
73
 
73
 
74
$Revision: 6244 $
74
$Revision: 6263 $
Line 438... Line 438...
438
        mov     eax, [BOOT_VARS + BOOT_APM_VERSION] ; version & flags
438
        mov     eax, [BOOT_VARS + BOOT_APM_VERSION] ; version & flags
439
        mov     [apm_vf], eax
439
        mov     [apm_vf], eax
440
; -----------------------------------------
440
; -----------------------------------------
441
        mov     al, [BOOT_VARS+BOOT_DMA]            ; DMA access
441
        mov     al, [BOOT_VARS+BOOT_DMA]            ; DMA access
442
        mov     [allow_dma_access], al
442
        mov     [allow_dma_access], al
443
        movzx   eax, byte [BOOT_VARS+BOOT_BPP]      ; bpp
-
 
444
        mov     [_display.bits_per_pixel], eax
-
 
445
        mov     [_display.vrefresh], 60
-
 
-
 
443
 
446
        mov     al, [BOOT_VARS+BOOT_DEBUG_PRINT]    ; If nonzero, duplicates debug output to the screen
444
        mov     al, [BOOT_VARS+BOOT_DEBUG_PRINT]    ; If nonzero, duplicates debug output to the screen
447
        mov     [debug_direct_print], al
445
        mov     [debug_direct_print], al
-
 
446
 
448
        mov     al, [BOOT_VARS+BOOT_LAUNCHER_START] ; Start the first app (LAUNCHER) after kernel is loaded?
447
        mov     al, [BOOT_VARS+BOOT_LAUNCHER_START] ; Start the first app (LAUNCHER) after kernel is loaded?
449
        mov     [launcher_start], al
448
        mov     [launcher_start], al
450
        movzx   eax, word [BOOT_VARS+BOOT_X_RES]; X max
-
 
451
        mov     [_display.width], eax
-
 
452
        mov     [display_width_standard], eax
-
 
453
        dec     eax
-
 
454
        mov     [screen_workarea.right], eax
-
 
455
        movzx   eax, word [BOOT_VARS+BOOT_Y_RES]; Y max
-
 
456
        mov     [_display.height], eax
-
 
457
        mov     [display_height_standard], eax
-
 
458
        dec     eax
-
 
459
        mov     [screen_workarea.bottom], eax
-
 
460
        movzx   eax, word [BOOT_VARS+BOOT_VESA_MODE] ; screen mode
-
 
461
        mov     dword [SCR_MODE], eax
-
 
462
;        mov     eax, [BOOT_VAR+0x9014]             ; Vesa 1.2 bnk sw add
-
 
463
;        mov     [BANK_SWITCH], eax
-
 
464
        mov     eax, 640 *4                         ; Bytes PerScanLine
-
 
465
        cmp     [SCR_MODE], word 0x13               ; 320x200
-
 
466
        je      @f
-
 
467
        cmp     [SCR_MODE], word 0x12               ; VGA 640x480
-
 
468
        je      @f
-
 
469
        movzx   eax, word[BOOT_VARS+BOOT_PITCH]      ; for other modes
-
 
470
@@:
-
 
471
        mov     [_display.lfb_pitch], eax
-
 
472
        mov     eax, [_display.width]
-
 
473
        mul     [_display.height]
-
 
474
        mov     [_display.win_map_size], eax
-
 
475
 
-
 
476
        call    calculate_fast_getting_offset_for_WinMapAddress
-
 
477
; for Qemu or non standart video cards
-
 
478
; Unfortunately [BytesPerScanLine] does not always
-
 
479
;                             equal to [_display.width] * [ScreenBPP] / 8
-
 
480
        call    calculate_fast_getting_offset_for_LFB
-
 
Line 481... Line 449...
481
 
449
 
482
        mov     esi, BOOT_VARS+0x9080
450
        mov     esi, BOOT_VARS+0x9080
483
        movzx   ecx, byte [esi-1]
451
        movzx   ecx, byte [esi-1]
484
        mov     [NumBiosDisks], ecx
452
        mov     [NumBiosDisks], ecx
485
        mov     edi, BiosDisksData
453
        mov     edi, BiosDisksData
Line 486... Line -...
486
        rep movsd
-
 
487
 
-
 
488
setvideomode:
-
 
489
 
-
 
490
        mov     eax, [BOOT_VARS+BOOT_LFB]
-
 
491
        mov     [LFBAddress], eax
-
 
492
 
-
 
493
        cmp     word [SCR_MODE], 0x0012                 ; VGA (640x480 16 colors)
-
 
494
        je      .vga
-
 
495
        cmp     word [SCR_MODE], 0x0013                 ; MCGA (320*200 256 colors)
-
 
496
        je      .32bpp
-
 
497
        cmp     byte [_display.bits_per_pixel], 32
-
 
498
        je      .32bpp
-
 
499
        cmp     byte [_display.bits_per_pixel], 24
-
 
500
        je      .24bpp
-
 
501
        cmp     byte [_display.bits_per_pixel], 16
-
 
502
        je      .16bpp
-
 
503
;        cmp     byte [_display.bits_per_pixel], 15
-
 
504
;        je      .15bpp
-
 
505
 
-
 
506
  .vga:
-
 
507
        mov     [PUTPIXEL], VGA_putpixel
-
 
508
        mov     [GETPIXEL], Vesa20_getpixel32           ; Conversion buffer is 32 bpp
-
 
509
        mov     [_display.bytes_per_pixel], 4           ; Conversion buffer is 32 bpp
-
 
510
        jmp     .finish
-
 
511
 
-
 
512
;  .15bpp:
-
 
513
;        mov     [PUTPIXEL], Vesa20_putpixel15
-
 
514
;        mov     [GETPIXEL], Vesa20_getpixel15
-
 
515
;        mov     [_display.bytes_per_pixel], 2
-
 
516
;        jmp     .finish
-
 
517
 
-
 
518
  .16bpp:
-
 
519
        mov     [PUTPIXEL], Vesa20_putpixel16
-
 
520
        mov     [GETPIXEL], Vesa20_getpixel16
-
 
521
        mov     [_display.bytes_per_pixel], 2
-
 
522
        jmp     .finish
-
 
523
 
-
 
524
  .24bpp:
-
 
525
        mov     [PUTPIXEL], Vesa20_putpixel24
-
 
526
        mov     [GETPIXEL], Vesa20_getpixel24
-
 
527
        mov     [_display.bytes_per_pixel], 3
-
 
528
        jmp     .finish
-
 
529
 
-
 
530
  .32bpp:
-
 
531
        mov     [PUTPIXEL], Vesa20_putpixel32
-
 
532
        mov     [GETPIXEL], Vesa20_getpixel32
-
 
533
        mov     [_display.bytes_per_pixel], 4
-
 
534
;        jmp     .finish
-
 
535
 
-
 
536
  .finish:
-
 
537
        mov     [MOUSE_PICTURE], mousepointer
-
 
538
        mov     [_display.check_mouse], check_mouse_area_for_putpixel
-
 
539
        mov     [_display.check_m_pixel], check_mouse_area_for_getpixel
454
        rep movsd
540
 
455
 
541
; -------- Fast System Call init ----------
456
; -------- Fast System Call init ----------
542
; Intel SYSENTER/SYSEXIT (AMD CPU support it too)
457
; Intel SYSENTER/SYSEXIT (AMD CPU support it too)
543
        bt      [cpu_caps], CAPS_SEP
458
        bt      [cpu_caps], CAPS_SEP
Line 617... Line 532...
617
        rep stosd                    ; access to 4096*8=65536 ports
532
        rep stosd                    ; access to 4096*8=65536 ports
Line 618... Line 533...
618
 
533
 
619
        mov     ax, tss0
534
        mov     ax, tss0
Line 620... Line 535...
620
        ltr     ax
535
        ltr     ax
-
 
536
 
-
 
537
        mov     eax, sys_proc
-
 
538
        list_init eax
-
 
539
        add     eax, PROC.thr_list
-
 
540
        list_init eax
621
 
541
 
-
 
542
        call    init_video
-
 
543
        call    init_mtrr
-
 
544
        mov     [LFBAddress], LFB_BASE
622
        mov     [LFBSize], 0xC00000
545
        mov     ecx, bios_fb
623
        call    init_LFB
546
        call    set_framebuffer
Line 624... Line 547...
624
        call    init_fpu
547
        call    init_fpu
625
        call    init_malloc
548
        call    init_malloc
Line 705... Line 628...
705
; SET UP OS TASK
628
; SET UP OS TASK
Line 706... Line 629...
706
 
629
 
707
        mov     esi, boot_setostask
630
        mov     esi, boot_setostask
Line 708... Line -...
708
        call    boot_log
-
 
709
 
631
        call    boot_log
710
        mov     eax, sys_proc
632
 
Line 711... Line -...
711
        lea     edi, [eax+PROC.heap_lock]
-
 
712
        mov     ecx, (PROC.ht_free-PROC.heap_lock)/4
-
 
713
 
-
 
714
        list_init eax
-
 
715
        add     eax, PROC.thr_list
633
        mov     edi, sys_proc+PROC.heap_lock
716
        list_init eax
634
        mov     ecx, (PROC.ht_free-PROC.heap_lock)/4
717
 
635
 
Line 718... Line 636...
718
        xor     eax, eax
636
        xor     eax, eax