Subversion Repositories Kolibri OS

Rev

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

Rev 1364 Rev 1386
Line 24... Line 24...
24
; Subsystem id and Subsystem vendor id detection
24
; Subsystem id and Subsystem vendor id detection
Line 25... Line 25...
25
 
25
 
26
; Full device detection (like "ATI Radeon 9200") will increase app
26
; Full device detection (like "ATI Radeon 9200") will increase app
27
; size a lot and probably it is function of particular drivers
27
; size a lot and probably it is function of particular drivers
28
;----------------------------------------------------------------
28
;----------------------------------------------------------------
29
;2.2: PCIDEV   31/12/2009
29
;2.2: PCIDEV   03/01/2010
30
;Author:    Artem Jerdev 
30
;Author:    Artem Jerdev 
31
;Features:
31
;Features:
32
;           fixed
32
;           fixed
33
;                 * English in some comments ;)
33
;                 * English in some comments ;)
34
;           added
34
;           added
35
;                 * ! user-accessible PCI memory channels detection
35
;                 * ! user-accessible MMIO channels detection
36
;                 * ! ASCII-dump as PCI memory access demonstration
36
;                 * ! ASCII-dump as PCI memory access demonstration
37
;           optimization
37
;           optimization
38
;                 * (yet needed)
38
;                 * (yet needed)
39
;----------------------------------------------------------------
39
;----------------------------------------------------------------
Line 239... Line 239...
239
	jne	@b
239
	jne	@b
240
	; Quantity of devices...
240
	; Quantity of devices...
241
	movzx	ecx, byte [total]	; number to draw
241
	movzx	ecx, byte [total]	; number to draw
242
	mcall	47, 0x00020000,,150 * 65536 + 65, 0x224466
242
	mcall	47, 0x00020000,,150 * 65536 + 65, 0x224466
Line -... Line 243...
-
 
243
	
-
 
244
	mov	ah, [MMIO_allowed]
-
 
245
	or 	ah, ah
-
 
246
	jz 	@f
-
 
247
	mov	ah, [MMIO_Bus]	; =255 if MMIO disabled / not found
-
 
248
	and	ah, 0x7f
-
 
249
	inc	ah
243
 
250
	jo	@f	
-
 
251
	call	Try_MMIO
244
	call	Try_MMIO
252
@@:
245
	mcall	12, 2			; end of draw
253
	mcall	12, 2			; end of draw
Line 246... Line 254...
246
	ret
254
	ret
247
 
255
 
Line 310... Line 318...
310
	mov	al, byte [PCI_LastBus]	; get last bus
318
	mov	al, byte [PCI_LastBus]	; get last bus
311
	cmp	byte [V_Bus], al	; was it last bus
319
	cmp	byte [V_Bus], al	; was it last bus
312
	jbe	Start_Enum		; if not jump to keep searching
320
	jbe	Start_Enum		; if not jump to keep searching
313
	ret
321
	ret
Line -... Line 322...
-
 
322
 
-
 
323
no_ummio_allowed:
-
 
324
	xor 	al,al
314
 
325
	mov 	[MMIO_allowed],al		; re-enter the subroutine
315
;------------------------------------------------------------------
326
;------------------------------------------------------------------
-
 
327
;* Print device info to screen
316
;* Print device info to screen
328
 
317
Print_New_Device:
329
Print_New_Device:
318
	xor esi, esi	    ; default text color
330
	xor 	esi, esi	    	; default text color
-
 
331
	mov 	cl, [MMIO_allowed]
-
 
332
	or	cl,cl
319
; by art_zh December 2009
333
	jz	no_ummio_here
320
	mov ch, byte [V_Bus]
334
	mov 	ch, byte [V_Bus]
321
	mov cl, byte [V_Dev]
335
	mov 	cl, byte [V_Dev]
322
	mcall	62, 11		; detect uMMIO
336
	mcall	62, 11		; detect uMMIO
-
 
337
	and	ax,0x7fff
-
 
338
	inc 	ax			; -1 returned?
-
 
339
	jo 	no_ummio_allowed
323
	cmp eax, -2
340
	inc 	ax			; -2 returned?
-
 
341
	jo 	no_ummio_here
-
 
342
	inc 	ax			; -3 returned?
324
	je no_ummio_here
343
	jo 	no_ummio_here
325
	mov esi, 0x990033   ; highlighted text color
344
	mov 	esi, 0x990033   ; highlighted text color
326
	mov bh, byte [V_Bus]
345
	mov 	bh, byte [V_Bus]
327
	mov bl, byte [V_Dev]
346
	mov 	bl, byte [V_Dev]
328
	mov byte [MMIO_Bus], bh
347
	mov 	byte [MMIO_Bus], bh
Line 558... Line 577...
558
PCI_SubClass	db ?
577
PCI_SubClass	db ?
559
PCI_Interface	db ?
578
PCI_Interface	db ?
560
PCI_IRQ 	db ?
579
PCI_IRQ 	db ?
Line 561... Line 580...
561
 
580
 
562
align 4
581
align 4
563
MMIO_Bus	db ?
582
MMIO_Bus	db 255
564
MMIO_Dev	db ?
583
MMIO_Dev	db 255
565
MMIO_BAR	db 0
584
MMIO_BAR	db 0
566
MMIO_Blk	db 0
585
MMIO_allowed	db 1
Line 567... Line 586...
567
MMIO_Map	rd 8
586
MMIO_Map	rd 8
Line 568... Line 587...
568
 
587