Subversion Repositories Kolibri OS

Rev

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

Rev 19 Rev 21
Line 638... Line 638...
638
        call boot_log
638
        call boot_log
639
        ; name for OS/IDLE process
639
        ; name for OS/IDLE process
640
        mov  [0x80000+256+0],dword 'OS/I'
640
        mov  [0x80000+256+0],dword 'OS/I'
641
        mov  [0x80000+256+4],dword 'DLE '
641
        mov  [0x80000+256+4],dword 'DLE '
642
        ; task list
642
        ; task list
643
        mov  [0x3004],dword 2         ; number of processes
-
 
644
        mov  [0x3000],dword 0         ; process count - start with os task
-
 
645
        mov  [0x3020+0xE],byte  1     ; on screen number
643
        mov  [0x3020+0xE],byte  1     ; on screen number
646
        mov  [0x3020+0x4],dword 1     ; process id number
644
        mov  [0x3020+0x4],dword 1     ; process id number
-
 
645
        mov  [0x3020+0x10], dword 0   ; process base address
Line 647... Line 646...
647
 
646
 
648
        ; set default flags & stacks
647
        ; set default flags & stacks
649
        mov  [l.eflags],dword 0x11202 ; sti and resume
648
        mov  [l.eflags],dword 0x11202 ; sti and resume
650
        mov  [l.ss0], os_data
649
        mov  [l.ss0], os_data
Line 716... Line 715...
716
 
715
 
Line 717... Line 716...
717
        call  enable_mtrr
716
        call  enable_mtrr
718
 
717
 
719
 
718
 
720
; LOAD FIRST APPLICATION
719
; LOAD FIRST APPLICATION
721
        mov   [0x3000],dword 1 ;1
720
        mov   [0x3000],dword 1
722
        mov   [0x3004],dword 1 ;1
721
        mov   [0x3004],dword 1
723
        cli
722
        cli
724
        mov   al,[0x2f0000+0x9030]
723
        mov   al,[0x2f0000+0x9030]
725
        cmp   al,1
724
        cmp   al,1
726
        jne   no_load_vrr_m
725
        jne   no_load_vrr_m
727
        mov   eax,vrr_m
726
        mov   eax,vrr_m
Line 728... Line 727...
728
        call  start_application_fl
727
        call  start_application_fl
729
        cmp   eax,2                  ; if no vrr_m app found
728
        cmp   eax,2                  ; if vrr_m app found (PID=2)
730
        je    first_app_found
729
        je    first_app_found
Line 731... Line 730...
731
        
730
        
732
    no_load_vrr_m:     
731
    no_load_vrr_m:
733
        mov   eax,firstapp
732
        mov   eax,firstapp
734
        call  start_application_fl
733
        call  start_application_fl
735
 
734
 
736
        cmp   eax,2                  ; if no first app found - halt
735
        cmp   eax,2                  ; continue if a process has been loaded
Line 737... Line 736...
737
        je    first_app_found
736
        je    first_app_found
738
        mov   eax, 0xDEADBEEF
737
        mov   eax, 0xDEADBEEF        ; otherwise halt
739
        hlt    ;jmp   $
-
 
740
      first_app_found:
-
 
741
        cli
-
 
Line 742... Line -...
742
 
-
 
743
        mov   [0x3004],dword 2
-
 
744
        mov   [0x3000],dword 1
-
 
745
 
-
 
Line -... Line 738...
-
 
738
        hlt
746
 
739
      first_app_found:
747
; START MULTITASKING
740
        cli
Line -... Line 741...
-
 
741
 
748
 
742
        ;mov   [0x3004],dword 2
749
        mov   esi,boot_tasking
743
        mov   [0x3000],dword 1       ; set OS task fisrt
750
        call  boot_log
-
 
751
 
744
 
752
        mov   [0xe000],byte 1        ; multitasking enabled
745
 
753
 
-
 
754
    mov   al, 0xf6         ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
746
; SET KEYBOARD PARAMETERS
Line 755... Line -...
755
        call  kb_write
-
 
756
 
747
        mov   al, 0xf6         ; reset keyboard, scan enabled
757
        mov     ecx,0
748
        call  kb_write
758
wait_loop_1:       ; variant 2
749
 
759
; ÷èòàåì ïîðò ñîñòîÿíèÿ ïðîöåññîðà 8042
750
        ; wait until 8042 is ready
760
        in      al,64h 
751
        mov    ecx,0
Line 778... Line 769...
778
        call  kb_read
769
        call  kb_read
779
     ;// mike.dld [
770
     ;// mike.dld [
780
        call  set_lights
771
        call  set_lights
781
     ;// mike.dld ]
772
     ;// mike.dld ]
Line -... Line 773...
-
 
773
 
-
 
774
; START MULTITASKING
-
 
775
 
-
 
776
        mov   esi,boot_tasking
-
 
777
        call  boot_log
-
 
778
 
Line 782... Line 779...
782
 
779
        mov   [0xe000],byte 1        ; multitasking enabled
Line 783... Line 780...
783
 
780
 
784
; UNMASK ALL IRQ'S
781
; UNMASK ALL IRQ'S
Line 833... Line 830...
833
        call   check_fdd_motor_status
830
        call   check_fdd_motor_status
834
        jmp    osloop
831
        jmp    osloop
Line 835... Line 832...
835
 
832
 
836
 
-
 
837
checkidle:
833
 
Line 838... Line 834...
838
 
834
checkidle:
839
        pushad
835
        pushad
Line 3022... Line 3018...
3022
       mov cr4,eax
3018
       mov cr4,eax
3023
       mov [esp+36],eax
3019
       mov [esp+36],eax
3024
ret
3020
ret
3025
;---------------------------------------------------------------------------------------------
3021
;---------------------------------------------------------------------------------------------
Line 3026... Line -...
3026
 
-
 
3027
; check pixel limits
-
 
3028
 
-
 
3029
;cplimit:
-
 
3030
;        push    edi
-
 
3031
 
-
 
3032
;        cmp     byte [0xe000], 1      ; Multitasking enabled?
-
 
3033
;        jnz     .ret0
-
 
3034
;        mov     edi,[0x3010]
-
 
3035
;        add     edi, draw_data-0x3000
-
 
3036
;        mov     ecx, 1
-
 
3037
;        cmp     [edi+0], eax  ; xs
-
 
3038
;        ja      .ret1
-
 
3039
;        cmp     [edi+4], ebx  ; ys
-
 
3040
;        ja      .ret1
-
 
3041
;        cmp     eax, [edi+8]   ; xe
-
 
3042
;        ja      .ret1
-
 
3043
;        cmp     ebx, [edi+12] ; ye
-
 
3044
;        ja      .ret1
-
 
3045
 
-
 
3046
;.ret0:
-
 
3047
;        xor     ecx, ecx
-
 
3048
;.ret1:
-
 
3049
;        pop     edi
-
 
3050
;        ret
-
 
Line 3051... Line 3022...
3051
 
3022
 
Line 3052... Line 3023...
3052
 
3023
 
3053
; check if pixel is allowed to be drawn
-
 
3054
 
-
 
3055
checkpixel:
-
 
3056
 
3024
; check if pixel is allowed to be drawn
3057
        push eax
-
 
3058
        push ebx
-
 
3059
        push edx
-
 
3060
 
-
 
3061
;        mov   ecx,[0x3000]  ; process count
-
 
3062
;        shl   ecx, 6        ; *64
-
 
3063
;        add   ecx,0xc000    ; +window_stack
-
 
3064
;        mov   dx,word [ecx] ; window_stack_value
-
 
3065
 
-
 
3066
;        cmp   dx, word [0x3004] ; is this window active right now?!
-
 
3067
;        jz    .ret0
-
 
3068
 
-
 
Line 3069... Line 3025...
3069
;        call  cplimit
3025
 
3070
;        test  ecx, ecx
3026
checkpixel:
3071
;        jnz   .ret1
3027
        push eax edx
3072
 
3028
 
3073
        mov  edx,[0xfe00]     ; screen x size
-
 
Line 3074... Line 3029...
3074
        inc  edx
3029
        mov  edx,[0xfe00]     ; screen x size
3075
        imul  edx, ebx
-
 
3076
        mov  dl, [eax+edx+display_data] ; lea eax, [...]
-
 
3077
;;;        mov  dl,[eax]
-
 
3078
 
-
 
3079
        mov  eax,[0x3000]
-
 
3080
        shl  eax,5
-
 
Line 3081... Line -...
3081
        add  eax,0x3000+0xe
-
 
3082
 
3030
        inc  edx
3083
        mov  ecx, 1
-
 
3084
        cmp  byte [eax], dl
3031
        imul edx, ebx
3085
        jnz  .ret1
3032
        mov  dl, [eax+edx+display_data] ; lea eax, [...]
-
 
3033
 
3086
 
3034
        mov  eax, [0x3010]
3087
.ret0:
3035
 
Line 3088... Line 3036...
3088
        xor  ecx, ecx
3036
        xor  ecx, ecx
3089
.ret1:
3037
        cmp  byte [eax+0xe], dl
3090
        pop  edx
3038
        setne cl