Subversion Repositories Kolibri OS

Rev

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

Rev 2047 Rev 2425
Line 56... Line 56...
56
;;
56
;;
57
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
57
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 58... Line 58...
58
 
58
 
Line 59... Line 59...
59
include 'macros.inc'
59
include 'macros.inc'
Line 60... Line 60...
60
 
60
 
Line 61... Line 61...
61
$Revision: 2047 $
61
$Revision: 2425 $
Line 231... Line 231...
231
	display 10,13
231
	display 10,13
Line 232... Line 232...
232
 
232
 
233
 
233
 
234
; MEMORY MODEL
-
 
Line 235... Line 234...
235
	   call init_mem	; (init.inc)
234
; MEMORY MODEL
Line 236... Line 235...
236
	   call init_page_map	; (init.inc)
235
	   call init_mem	; (init.inc)
237
 
236
 
Line 679... Line 678...
679
	mov eax, [def_cursor]
678
	mov eax, [def_cursor]
680
	mov [SLOT_BASE+APPDATA.cursor],eax
679
	mov [SLOT_BASE+APPDATA.cursor],eax
681
	mov [SLOT_BASE+APPDATA.cursor+256],eax
680
	mov [SLOT_BASE+APPDATA.cursor+256],eax
Line 682... Line 681...
682
 
681
 
Line 683... Line -...
683
 
-
 
684
  ; READ TSC / SECOND
-
 
685
 
682
 
-
 
683
  ; READ TSC / SECOND == Fusion only!
-
 
684
 
686
;        mov   esi,boot_tsc
685
	cli
-
 
686
	mov	edx, PCIe_CONFIG_SPACE + 0xE0
687
;        call  boot_log
687
	mov	eax, 0x013080F0 	; BIOS timer reg.
688
	cli
688
	mov	[edx], eax
-
 
689
	add	dl, 4
-
 
690
	mov	edi, edx
-
 
691
	mov	eax, [edi]		; old microseconds
-
 
692
	inc	eax			; next precise microsecond
689
	rdtsc ;call  _rdtsc
693
	mov	esi, eax
-
 
694
 @@:
-
 
695
	mov	eax, [edi]
-
 
696
	cmp	eax, esi
-
 
697
	jne	@b
690
	mov   ecx,eax
698
 
-
 
699
	rdtsc
-
 
700
	mov	ebp, eax		; clockmark
-
 
701
	add	esi, 20 		; wait 20us
-
 
702
 @@:
-
 
703
	mov	eax, [edi]
-
 
704
	cmp	eax, esi
-
 
705
	jne	@b
-
 
706
 
-
 
707
	rdtsc
691
	mov   esi,250		    ; wait 1/4 a second
708
	sub	eax, ebp
692
	call  delay_ms
-
 
693
	rdtsc ;call  _rdtsc
709
	mov	ebx, 50000
694
	sti
710
	mul	ebx		      ; clks per second
695
	sub   eax,ecx
711
	sti
696
	shl   eax,2
712
 
697
	mov   [CPU_FREQ],eax	      ; save tsc / sec
-
 
698
;       mov ebx, 1000000
-
 
699
;       div ebx
-
 
700
; faster division possible:
-
 
701
	mov	edx, 2251799814
713
	mov   [CPU_FREQ],eax	      ; save tsc / sec
702
	mul	edx
714
	mov   ebx, 1000000
703
	shr	edx, 19
715
	div   ebx
704
	mov [stall_mcs], edx
716
	mov [stall_mcs], eax
Line 705... Line 717...
705
; PRINT CPU FREQUENCY
717
; PRINT CPU FREQUENCY
706
	mov	esi, boot_cpufreq
718
	mov	esi, boot_cpufreq
707
	call	boot_log
719
	call	boot_log
708
 
720
 
709
	mov	ebx, edx
721
	mov	ebx, eax
710
	movzx	ecx, word [boot_y]
722
	movzx	ecx, word [boot_y]
Line 719... Line 731...
719
 
731
 
Line 720... Line 732...
720
	call  set_variables
732
	call  set_variables
Line 721... Line -...
721
 
-
 
722
; SET MOUSE
733
 
Line 723... Line -...
723
 
-
 
724
	;call   detect_devices
-
 
725
	stdcall load_driver, szPS2MDriver
-
 
726
 
-
 
727
;        mov   esi,boot_setmouse
734
; SET MOUSE
Line 728... Line 735...
728
;        call  boot_log
735
 
Line 729... Line 736...
729
;       call  setmouse
736
	stdcall load_driver, szPS2MDriver
Line 802... Line 809...
802
      @@:
809
      @@:
803
	in     al,64h
810
	in     al,64h
804
	and    al,00000010b
811
	and    al,00000010b
805
	loopnz @b
812
	loopnz @b
Line 806... Line -...
806
 
-
 
807
       ; mov   al, 0xED       ; svetodiody - only for testing!
-
 
808
       ; call  kb_write
-
 
809
       ; call  kb_read
-
 
810
       ; mov   al, 111b
-
 
811
       ; call  kb_write
-
 
Line 812... Line 813...
812
       ; call  kb_read
813
 
813
 
814
 
814
	mov   al, 0xF3	     ; set repeat rate & delay
815
	mov   al, 0xF3	     ; set repeat rate & delay
815
	call  kb_write
816
	call  kb_write
Line 823... Line 824...
823
 
824
 
Line 824... Line -...
824
 
-
 
825
 
-
 
826
; START MULTITASKING
-
 
827
 
-
 
828
;if preboot_blogesc
-
 
829
;        mov     esi, boot_tasking
-
 
830
;        call    boot_log
-
 
831
;.bll1:  in      al, 0x60        ; wait for ESC key press
-
 
832
;        cmp     al, 129
-
 
833
;        jne     .bll1
825
 
Line 834... Line 826...
834
;end if
826
 
835
 
827
; START MULTITASKING
836
 
828
 
Line 843... Line 835...
843
	sti
835
	sti
844
	call change_task
836
	call change_task
Line 845... Line 837...
845
 
837
 
Line 846... Line 838...
846
	jmp osloop				; Fly :)
838
	jmp osloop				; Fly :)
Line -... Line 839...
-
 
839
 
847
 
840
diff16 "init code end  ",0,$
-
 
841
 
-
 
842
unpacker_inc:
848
diff16 "init code end: ",0,$
843
include 'unpacker.inc'
Line 849... Line 844...
849
 
844
diff16 "unpacker code  ",unpacker_inc,$
850
include 'unpacker.inc'
845
 
851
include 'fdo.inc'
846
include 'fdo.inc'