Subversion Repositories Kolibri OS

Rev

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

Rev 767 Rev 769
Line 53... Line 53...
53
;;
53
;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 55... Line 55...
55
 
55
 
Line 56... Line 56...
56
include 'macros.inc'
56
include 'macros.inc'
Line 57... Line 57...
57
 
57
 
Line 58... Line 58...
58
$Revision: 767 $
58
$Revision: 769 $
59
 
59
 
60
 
60
 
Line 636... Line 636...
636
	mov    esi,boot_devices
636
	mov    esi,boot_devices
637
	call   boot_log
637
	call   boot_log
Line 638... Line 638...
638
 
638
 
Line 639... Line 639...
639
	mov  [pci_access_enabled],1
639
	mov  [pci_access_enabled],1
640
 
640
 
-
 
641
	;call   detect_devices
Line 641... Line 642...
641
	call   detect_devices
642
	stdcall load_driver, szPS2MDriver
Line 642... Line 643...
642
	stdcall load_driver, szPS2MDriver
643
	stdcall load_driver, szCOM_MDriver
643
 
644
 
Line 669... Line 670...
669
 
670
 
Line 670... Line 671...
670
; SET PORTS FOR IRQ HANDLERS
671
; SET PORTS FOR IRQ HANDLERS
671
 
672
 
672
	mov  esi,boot_setrports
673
	mov  esi,boot_setrports
Line 673... Line 674...
673
	call boot_log
674
	call boot_log
Line 674... Line 675...
674
	call setirqreadports
675
	;call setirqreadports
675
 
676
 
Line 1027... Line 1028...
1027
reserve_irqs_ports:
1028
reserve_irqs_ports:
Line 1028... Line 1029...
1028
 
1029
 
Line 1029... Line 1030...
1029
	pushad
1030
	pushad
1030
 
1031
 
1031
	mov  [irq_owner+4*0], 1    ; timer
1032
	mov  [irq_owner+4*0], 1    ; timer
1032
	mov  [irq_owner+4*1], 1    ; keyboard
1033
	;mov  [irq_owner+4*1], 1    ; keyboard
1033
	mov  [irq_owner+4*5], 1    ; sound blaster
1034
	mov  [irq_owner+4*5], 1    ; sound blaster
1034
	mov  [irq_owner+4*6], 1    ; floppy diskette
1035
	mov  [irq_owner+4*6], 1    ; floppy diskette
1035
	mov  [irq_owner+4*13], 1   ; math co-pros
1036
	mov  [irq_owner+4*13], 1   ; math co-pros
Line 1066... Line 1067...
1066
	mov   [RESERVED_PORTS+edi+8],dword 0xff
1067
	mov   [RESERVED_PORTS+edi+8],dword 0xff
Line 1067... Line 1068...
1067
 
1068
 
1068
	popad
1069
	popad
Line 1069... Line -...
1069
	ret
-
 
1070
 
-
 
1071
iglobal
-
 
1072
mouseirqtable	db  12	  ; ps2
-
 
1073
		db  4	  ; com1
-
 
1074
		db  3	  ; com2
-
 
1075
endg
1070
	ret
Line 1076... Line 1071...
1076
 
1071
 
1077
setirqreadports:
1072
setirqreadports:
1078
 
1073
 
1079
	mov   [irq12read+0],dword 0x60 + 0x01000000  ; read port 0x60 , byte
1074
	mov   [irq12read+0],dword 0x60 + 0x01000000  ; read port 0x60 , byte
1080
	mov   [irq12read+4],dword 0		     ; end of port list
1075
	mov   [irq12read+4],dword 0		     ; end of port list
1081
	mov   [irq04read+0],dword 0x3f8 + 0x01000000 ; read port 0x3f8 , byte
1076
	;mov   [irq04read+0],dword 0x3f8 + 0x01000000 ; read port 0x3f8 , byte
Line 1082... Line 1077...
1082
	mov   [irq04read+4],dword 0		     ; end of port list
1077
	;mov   [irq04read+4],dword 0                  ; end of port list
Line 1083... Line 1078...
1083
	mov   [irq03read+0],dword 0x2f8 + 0x01000000 ; read port 0x2f8 , byte
1078
	;mov   [irq03read+0],dword 0x2f8 + 0x01000000 ; read port 0x2f8 , byte
1084
	mov   [irq03read+4],dword 0		     ; end of port list
1079
	;mov   [irq03read+4],dword 0                  ; end of port list
Line 1996... Line 1991...
1996
     ret
1991
     ret
Line 1997... Line 1992...
1997
 
1992
 
1998
 
1993
 
1999
detect_devices:
1994
detect_devices:
2000
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1995
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2001
include 'detect/commouse.inc'
1996
;include 'detect/commouse.inc'
2002
;include 'detect/ps2mouse.inc'
1997
;include 'detect/ps2mouse.inc'
2003
;include 'detect/dev_fd.inc'
1998
;include 'detect/dev_fd.inc'
2004
;include 'detect/dev_hdcd.inc'
1999
;include 'detect/dev_hdcd.inc'
Line 4185... Line 4180...
4185
     xor   esi, esi
4180
     xor   esi, esi
4186
     inc   esi
4181
     inc   esi
4187
     cmp   ecx, 16
4182
     cmp   ecx, 16
4188
     jae   ril1
4183
     jae   ril1
Line -... Line 4184...
-
 
4184
 
4189
 
4185
     push  ecx
4190
     lea   ecx, [irq_owner + 4 * ecx]
4186
     lea   ecx, [irq_owner + 4 * ecx]
4191
     mov   edx, [ecx]
4187
     mov   edx, [ecx]
4192
     mov   eax, [TASK_BASE]
4188
     mov   eax, [TASK_BASE]
-
 
4189
     mov   edi, [eax + TASKDATA.pid]
4193
     mov   edi, [eax + TASKDATA.pid]
4190
     pop   eax
4194
     dec   ebx
4191
     dec   ebx
Line 4195... Line 4192...
4195
     jnz   reserve_irq
4192
     jnz   reserve_irq
4196
 
4193
 
Line 4204... Line 4201...
4204
  reserve_irq:
4201
  reserve_irq:
Line 4205... Line 4202...
4205
 
4202
 
4206
     cmp   dword [ecx], 0
4203
     cmp   dword [ecx], 0
Line -... Line 4204...
-
 
4204
     jne   ril1
-
 
4205
 
-
 
4206
     mov   ebx, [f_irqs + 4 * eax]
-
 
4207
 
4207
     jne   ril1
4208
     stdcall attach_int_handler, eax, ebx
-
 
4209
 
4208
 
4210
     mov   [ecx], edi
4209
     mov   [ecx], edi
4211
 
4210
     dec   esi
4212
     dec   esi
4211
   ril1:
4213
   ril1:
Line -... Line 4214...
-
 
4214
     mov   [esp+32], esi ; return in eax
-
 
4215
     ret
-
 
4216
 
-
 
4217
iglobal
-
 
4218
f_irqs:
-
 
4219
     dd 0x0
-
 
4220
     dd 0x0
-
 
4221
     dd p_irq2
-
 
4222
     dd p_irq3
-
 
4223
     dd p_irq4
-
 
4224
     dd p_irq5
-
 
4225
     dd p_irq6
-
 
4226
     dd p_irq7
-
 
4227
     dd p_irq8
-
 
4228
     dd p_irq9
-
 
4229
     dd p_irq10
-
 
4230
     dd p_irq11
-
 
4231
     dd 0x0
-
 
4232
     dd 0x0
-
 
4233
     dd p_irq14
-
 
4234
     dd p_irq15
4212
     mov   [esp+32], esi ; return in eax
4235
 
4213
     ret
4236
endg
4214
 
4237
 
4215
drawbackground:
4238
drawbackground:
4216
       inc   [mouse_pause]
4239
       inc   [mouse_pause]
Line 4492... Line 4515...
4492
	   ; ps2 mouse enable
4515
	   ; ps2 mouse enable
Line 4493... Line 4516...
4493
 
4516
 
Line 4494... Line 4517...
4494
     mov     [MOUSE_PICTURE],dword mousepointer
4517
     mov     [MOUSE_PICTURE],dword mousepointer
4495
 
-
 
4496
     cli
-
 
4497
;     mov     bl,0xa8                 ; enable mouse cmd
-
 
4498
;     call    kb_cmd
-
 
4499
;     call    kb_read                 ; read status
-
 
4500
;     mov     bl,0x20                 ; get command byte
-
 
4501
;     call    kb_cmd
-
 
4502
;     call    kb_read
-
 
4503
;     or      al,3                    ; enable interrupt
-
 
4504
;     mov     bl,0x60                 ; write command
-
 
4505
;     push    eax
-
 
4506
;     call    kb_cmd
-
 
4507
;     pop     eax
-
 
4508
;     call    kb_write
-
 
4509
;     mov     bl,0xd4                 ; for mouse
-
 
4510
;     call    kb_cmd
-
 
4511
;     mov     al,0xf4                 ; enable mouse device
-
 
4512
;     call    kb_write
-
 
4513
;     call    kb_read           ; read status return
-
 
4514
 
-
 
4515
     ; com1 mouse enable
-
 
4516
 
-
 
4517
     mov   bx,0x3f8 ; combase
-
 
4518
 
-
 
4519
     mov   dx,bx
-
 
4520
     add   dx,3
-
 
4521
     mov   al,0x80
-
 
4522
     out   dx,al
-
 
4523
 
-
 
4524
     mov   dx,bx
-
 
4525
     add   dx,1
-
 
4526
     mov   al,0
-
 
4527
     out   dx,al
-
 
4528
 
-
 
4529
     mov   dx,bx
-
 
4530
     add   dx,0
-
 
4531
     mov   al,0x30*2	; 0x30 / 4
-
 
4532
     out   dx,al
-
 
4533
 
-
 
4534
     mov   dx,bx
-
 
4535
     add   dx,3
-
 
4536
     mov   al,2 	; 3
-
 
4537
     out   dx,al
-
 
4538
 
-
 
4539
     mov   dx,bx
-
 
4540
     add   dx,4
-
 
4541
     mov   al,0xb
-
 
4542
     out   dx,al
-
 
4543
 
-
 
4544
     mov   dx,bx
-
 
4545
     add   dx,1
-
 
4546
     mov   al,1
-
 
4547
     out   dx,al
-
 
4548
 
-
 
4549
 
-
 
4550
     ; com2 mouse enable
-
 
4551
 
-
 
4552
     mov   bx,0x2f8 ; combase
-
 
4553
 
-
 
4554
     mov   dx,bx
-
 
4555
     add   dx,3
-
 
4556
     mov   al,0x80
-
 
4557
     out   dx,al
-
 
4558
 
-
 
4559
     mov   dx,bx
-
 
4560
     add   dx,1
-
 
4561
     mov   al,0
-
 
4562
     out   dx,al
-
 
4563
 
-
 
4564
     mov   dx,bx
-
 
4565
     add   dx,0
-
 
4566
     mov   al,0x30*2
-
 
4567
     out   dx,al
-
 
4568
 
-
 
4569
     mov   dx,bx
-
 
4570
     add   dx,3
-
 
4571
     mov   al,2
-
 
4572
     out   dx,al
-
 
4573
 
-
 
4574
     mov   dx,bx
-
 
4575
     add   dx,4
-
 
4576
     mov   al,0xb
-
 
4577
     out   dx,al
-
 
4578
 
-
 
4579
     mov   dx,bx
-
 
4580
     add   dx,1
-
 
Line 4581... Line 4518...
4581
     mov   al,1
4518
 
Line 4582... Line 4519...
4582
     out   dx,al
4519
     cli