Subversion Repositories Kolibri OS

Rev

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

Rev 2218 Rev 2231
Line 66... Line 66...
66
;;
66
;;
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 68... Line 68...
68
 
68
 
Line 69... Line 69...
69
include 'macros.inc'
69
include 'macros.inc'
Line 70... Line 70...
70
 
70
 
Line 71... Line 71...
71
$Revision: 2218 $
71
$Revision: 2231 $
Line 224... Line 224...
224
           mov   ds,ax
224
           mov   ds,ax
225
           mov   es,ax
225
           mov   es,ax
226
           mov   fs,ax
226
           mov   fs,ax
227
           mov   gs,ax
227
           mov   gs,ax
228
           mov   ss,ax
228
           mov   ss,ax
229
           mov   esp,0x5ec00       ; Set stack
229
           mov   esp,0x006CC00       ; Set stack
Line 230... Line 230...
230
 
230
 
Line 231... Line 231...
231
; CLEAR 0x280000 - HEAP_BASE
231
; CLEAR 0x280000 - HEAP_BASE
232
 
232
 
233
           xor   eax,eax
233
           xor   eax,eax
234
           mov   edi,CLEAN_ZONE
234
           mov   edi,CLEAN_ZONE
235
           mov   ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4
235
           mov   ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4
Line 236... Line -...
236
           cld
-
 
237
           rep   stosd
-
 
238
 
-
 
239
           mov   edi,0x40000
-
 
240
           mov   ecx,(0x90000-0x40000)/4
236
           cld
241
           rep   stosd
237
           rep   stosd
242
 
238
 
-
 
239
; CLEAR KERNEL UNDEFINED GLOBALS
-
 
240
           mov   edi, endofcode-OS_BASE
243
; CLEAR KERNEL UNDEFINED GLOBALS
241
           mov   ecx, 0x90000
Line 244... Line 242...
244
           mov   edi, endofcode-OS_BASE
242
           sub   ecx, edi
Line 245... Line 243...
245
           mov   ecx, (uglobals_size/4)+4
243
           shr   ecx, 2
Line 603... Line 601...
603
        rep     stosd
601
        rep     stosd
Line 604... Line 602...
604
 
602
 
Line 605... Line 603...
605
; REDIRECT ALL IRQ'S TO INT'S 0x20-0x2f
603
; REDIRECT ALL IRQ'S TO INT'S 0x20-0x2f
606
 
604
 
Line 607... Line 605...
607
        call  init_irqs
605
        call  init_irqs
608
        call  rerouteirqs
606
        call  PIC_init
Line 609... Line 607...
609
 
607
 
-
 
608
; Initialize system V86 machine
Line 610... Line -...
610
; Initialize system V86 machine
-
 
611
        call    init_sys_v86
-
 
612
 
-
 
613
; TIMER SET TO 1/100 S
609
        call    init_sys_v86
614
 
-
 
615
        mov   al,0x34              ; set to 100Hz
610
 
Line 616... Line 611...
616
        out   0x43,al
611
; Initialize system timer (IRQ0)
617
        mov   al,0x9b              ; lsb    1193180 / 1193
612
	call	PIT_init
618
        out   0x40,al
613
 
619
        mov   al,0x2e              ; msb
614
; Try to Initialize APIC
620
        out   0x40,al
615
	call	APIC_init
621
 
616
 
622
; Enable timer IRQ (IRQ0) and hard drives IRQs (IRQ14, IRQ15)
617
; Enable timer IRQ (IRQ0) and hard drives IRQs (IRQ14, IRQ15)
623
; they are used: when partitions are scanned, hd_read relies on timer
618
; they are used: when partitions are scanned, hd_read relies on timer
Line 624... Line 619...
624
; Also enable IRQ2, because in some configurations
619
        call unmask_timer
625
; IRQs from slave controller are not delivered until IRQ2 on master is enabled
620
        stdcall enable_irq, 2               ; @#$%! PIC
626
        mov     al, 0xFA
621
        stdcall enable_irq, 6               ; FDD
627
        out     0x21, al
622
        stdcall enable_irq, 13              ; co-processor
Line 677... Line 672...
677
        stdcall read_file, char2, FONT_II, 0, 2560
672
        stdcall read_file, char2, FONT_II, 0, 2560
Line 678... Line 673...
678
 
673
 
679
        mov   esi,boot_fonts
674
        mov   esi,boot_fonts
Line -... Line 675...
-
 
675
        call  boot_log
-
 
676
 
-
 
677
; Display APIC status
-
 
678
	mov	esi, boot_APIC_found
-
 
679
        cmp     [irq_mode], IRQ_APIC
-
 
680
        je    @f
-
 
681
	mov	esi, boot_APIC_nfound
680
        call  boot_log
682
@@:
681
 
683
 
682
; PRINT AMOUNT OF MEMORY
684
; PRINT AMOUNT OF MEMORY
Line 683... Line 685...
683
        mov     esi, boot_memdetect
685
        mov     esi, boot_memdetect
Line 820... Line 822...
820
 
822
 
Line 821... Line 823...
821
; SET VARIABLES
823
; SET VARIABLES
Line 822... Line -...
822
 
-
 
823
        call  set_variables
-
 
824
 
-
 
825
; SET MOUSE
-
 
826
 
-
 
827
        ;call   detect_devices
-
 
828
        stdcall load_driver, szPS2MDriver
-
 
829
;        stdcall load_driver, szCOM_MDriver
-
 
830
 
-
 
831
        mov   esi,boot_setmouse
-
 
832
        call  boot_log
-
 
833
        call  setmouse
824
 
Line 834... Line 825...
834
 
825
        call  set_variables
835
 
826
 
Line 937... Line 928...
937
        call  kb_write
928
        call  kb_write
938
;        call  kb_read
929
;        call  kb_read
939
     ;// mike.dld [
930
     ;// mike.dld [
940
        call  set_lights
931
        call  set_lights
941
     ;// mike.dld ]
932
     ;// mike.dld ]
-
 
933
        stdcall attach_int_handler, 1, irq1, 0
-
 
934
 
-
 
935
; SET MOUSE
Line -... Line 936...
-
 
936
 
-
 
937
        stdcall load_driver, szPS2MDriver
-
 
938
;        stdcall load_driver, szCOM_MDriver
-
 
939
 
-
 
940
        mov   esi,boot_setmouse
-
 
941
        call  boot_log
Line 942... Line 942...
942
 
942
        call  setmouse
Line 943... Line 943...
943
 
943
 
Line 991... Line 991...
991
.bll1:  in      al, 0x60        ; wait for ESC key press
991
.bll1:  in      al, 0x60        ; wait for ESC key press
992
        cmp     al, 129
992
        cmp     al, 129
993
        jne     .bll1
993
        jne     .bll1
994
end if
994
end if
Line 995... Line -...
995
 
-
 
996
 
-
 
997
        stdcall attach_int_handler, 1, irq1, 0
-
 
998
 
-
 
999
;        mov    [dma_hdd],1
995
 
1000
        cmp     [IDEContrRegsBaseAddr], 0
996
        cmp     [IDEContrRegsBaseAddr], 0
1001
        setnz   [dma_hdd]
997
        setnz   [dma_hdd]
Line 1002... Line 998...
1002
        mov [timer_ticks_enable],1              ; for cd driver
998
        mov [timer_ticks_enable],1              ; for cd driver
Line 4863... Line 4859...
4863
           cld
4859
           cld
4864
           rep movsd
4860
           rep movsd
Line 4865... Line 4861...
4865
 
4861
 
Line 4866... Line -...
4866
           call restorefatchain
-
 
4867
 
-
 
4868
           mov al, 0xFF
4862
           call restorefatchain
Line 4869... Line 4863...
4869
           out 0x21, al
4863
 
4870
           out 0xA1, al
4864
	       call IRQ_mask_all
4871
 
4865