Subversion Repositories Kolibri OS

Rev

Rev 1946 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1356 diamond 1
;***************************************************************
132 diamond 2
; project name:    PCI Device Enumeration
475 Ghost 3
; target platform: KolibriOS
1351 art_zh 4
; compiler:        flat assembler 1.68
5
; version:         2.2
6
; last update:     December 2007
475 Ghost 7
; maintained by:   Jason Delozier (cordata51@hotmail.com)
8
;                  Sergey Kuzmin (kuzmin_serg@list.ru)
9
;                  Mihailov Ilia (ghost.nsk@gmail.com)
1351 art_zh 10
;                  Artem Jerdev  (art_zh@yahoo.com)
205 heavyiron 11
; project site:    http://www.coolthemes.narod.ru/pcidev.html
132 diamond 12
;***************************************************************
13
;Summary: This program will attempt to scan the PCI Bus
14
;        and display basic information about each device
15
;        connected to the PCI Bus.
16
;***************************************************************
17
;HISTORY:
18
;keep dates in european format (dd/mm/yyyy), please
19
; '!' means big changes
205 heavyiron 20
;
21
;to-do:
475 Ghost 22
; more vendors
205 heavyiron 23
; vendor's website
24
; Subsystem id and Subsystem vendor id detection
25
 
26
; Full device detection (like "ATI Radeon 9200") will increase app
27
; size a lot and probably it is function of particular drivers
132 diamond 28
;----------------------------------------------------------------
1386 art_zh 29
;2.2: PCIDEV   03/01/2010
1351 art_zh 30
;Author:    Artem Jerdev 
31
;Features:
32
;           fixed
33
;                 * English in some comments ;)
34
;           added
1386 art_zh 35
;                 * ! user-accessible MMIO channels detection
1351 art_zh 36
;                 * ! ASCII-dump as PCI memory access demonstration
37
;           optimization
38
;                 * (yet needed)
39
;----------------------------------------------------------------
475 Ghost 40
;2.1: PCIDEV   ??/04/2007
41
;Author:    Mihailov Ilia aka Ghost 
42
;Features:
43
;           fixed
1351 art_zh 44
;                 * Some little bugs
475 Ghost 45
;                 * Source code formating
46
;                 * PCI version normalized 0210 -> 2.10
47
;           added
48
;                 * + 13 vendor (total now 1000!)
49
;                 * + 3 class type
50
;                 * Fast call source ready
51
;                 * Device IRQ detection
52
;           optimized
53
;                 * ! size optimized (61025 -> 32501 see added)
54
;                 * easy to add new vendor & class names
55
;----------------------------------------------------------------
205 heavyiron 56
;2.0: PCIDEV   30/08/2006
57
;(it differs a lot from the version 1.0, which was introduced 19 months ago)
58
;Author:    Marat Zakiyanov aka Mario79 
59
;           Sergey Kuzmin aka Wildwest 
60
;Features:
61
;           added
62
;                 * Detection of Interface by Mario79
63
;                 * 122 vendor id's by Wildwest
64
;                 * Description is based on Class, SubClass and Interface now (PCI 3.0) by Wildwest
65
;----------------------------------------------------------------
132 diamond 66
;1.31: PCIDEV   13/05/2006
67
;Author:    Jason Delozier 
68
;Features:
69
;           fixed
70
;                 * ! bug in Company Name look up code that would cause Unknown Name errors.
71
;                 * ! possible bugs, many instructions missing byte, word, dword prefixes
72
;                 * ! possible bug which could have occured after removing  "PREVIOUSVERSIONLIST"
73
;                     entry in loop up code and not fixing jump parameters.
74
;           added
75
;                 *  comments to various parts of the code
76
;           optimized
77
;                 * various parts of the source, too many to remember and mention.
78
;                 * changed entries for Subclasses in vendors.inc to Byte format, saves a little space.
79
;----------------------------------------------------------------
80
;1.30: PCIDEV   11/05/2006
81
;Author:    Sergey Kuzmin aka Wildwest 
82
;Features:
83
;           added
84
;                * 3 new vendor id's (ESS from Madis Kalme and 2 id's
85
;                  forgotten from 1.15 release: Broadcom -SiByte and Chaintech Comp.)
205 heavyiron 86
;           changed
87
;                * I don't know why other devs (Jason or Victor) changed window style
132 diamond 88
;                  to old ugly one, so I changed it back to skinned type 3.
89
;                * the same goes to the use of macroc.inc - it is enabled again.
90
;           deleted
91
;                * there is no more label "PREVIOUSVERSIONLIST" - id's moved to the
92
;                  appropriate parts of global list.
93
;----------------------------------------------------------------
94
;1.29: PCIDEV   30/04/2006
95
;Author:    Jason Delozier 
96
;Features:
97
;           fixed
98
;                 * ! bug that would not allow devices with device
99
;                   numbers > 16 to be displayed.
100
;           added
101
;                 * ! another heading called "FNC" (function) which allows
102
;                   the multipurpose Device/Function varible to be split and
103
;                   displayed to the user properly.
104
;                 * horizontal bars to display for easier reading.
105
;           optimized
106
;                 * vendor/description search routines for speed and space.
107
;----------------------------------------------------------------
108
;1.25: PCIDEV   02/10/2005
109
;Author:    Sergey Kuzmin aka Wildwest 
110
;Features:
111
;            changed
205 heavyiron 112
;                  * ! Description is based on Class and SubClass
132 diamond 113
;                     now (PCI 3.0). The Names of Classes and SubClasses
114
;                     are in the end of Vendors.inc
115
;            deleted
116
;                  * label "Descriptions" (names of Classes)
117
;
118
;----------------------------------------------------------------
119
;1.20: PCIDEV   16/08/2005
120
;Author:    Victor Alberto Gil Hanla a.k.a. vhanla 
121
;Features:
122
;           added
123
;                  * ! many vendor lists (865)
124
;           deleted
125
;                  * previous version's list
126
;           changed
127
;                  * previous Company Name searching and printing
128
;----------------------------------------------------------------
129
;1.15: PCIDEV   03/06/2005
130
;Author:    Sergey Kuzmin aka Wildwest 
131
;Features:
132
;           added
475 Ghost 133
;                 * quantity of devices,
134
;                 * ! detection of Company Name based on Vendor ID,
135
;                 * database of VenID (35 ID's),
136
;                 * macros.inc for smaller size,
132 diamond 137
;           changed
475 Ghost 138
;                 * interface+(skinned window),
139
;                 * VenID before DevID in 'table'(was DevID before VenID)
132 diamond 140
;----------------------------------------------------------------
141
;1.0: PCIDEV    30/01/2005
142
;Author:    Jason Delozier
143
;Features:
144
;          able to
145
;                 * detect PCI version,
146
;                 * quantity of PCI buses,
147
;                 * Vendor&Device ID for appropriate Device on Bus;
148
;                 * detect Revision, Class and Subclass of Device,
149
;                 * and make Description based on Class
150
;-------------------------------------------------------------
1364 diamond 151
include '../../../macros.inc'
1359 art_zh 152
;include 'macros.inc'
1351 art_zh 153
 
475 Ghost 154
MEOS_APP_START
155
CODE
156
	call draw_window
132 diamond 157
 
475 Ghost 158
still:	mcall	10			; wait here for event
159
	dec	eax			; redraw request ?
160
	jz	red
161
	dec	eax			; key in buffer ?
162
	jz	key
163
	dec	eax			; button in buffer ?
164
	jz	button
165
	jmp	still
132 diamond 166
 
475 Ghost 167
red:					; redraw
168
	mcall	9, Proc_Info, -1	; window redraw requested so get new window coordinates and size
485 heavyiron 169
	mov	eax, [Proc_Info.box.left]; store the window coordinates into the Form Structure
475 Ghost 170
	mov	[Form + 2], ax		; x start position
485 heavyiron 171
	mov	eax, [Proc_Info.box.top];
475 Ghost 172
	mov	[Form + 6], ax		; ystart position
485 heavyiron 173
	mov	eax, [Proc_Info.box.width]	;
475 Ghost 174
	mov	[Form], ax		; window width
485 heavyiron 175
	mov	eax, [Proc_Info.box.height]	;
475 Ghost 176
	mov	[Form + 4] ,ax		; window height
177
	call	draw_window		; go redraw window now
178
	jmp	still
132 diamond 179
 
475 Ghost 180
key:					; key
181
	mcall	2			; just read it and ignore
182
	jmp	still
1351 art_zh 183
button: 				; button
475 Ghost 184
	mcall	17			; get id
185
	cmp	ah, 1			; button id = 1 ?
186
	jne	still
187
	mcall	-1			; close this program
132 diamond 188
 
189
draw_window:
475 Ghost 190
	mov	byte [total], 0
191
	mcall	12, 1			; start of draw
192
	; DRAW WINDOW
193
	mcall	0, dword [Form], dword [Form + 4], 0x13ffffff, 0x805080d0, title
194
	; Insert horizontal bars  in list area
1351 art_zh 195
	mov	eax, 13 		; draw bar system function
196
	mov	ebx, 18 		; set Xstart position of bar
197
	shl	ebx, 16 		;
198
	mov	bx, word [Form] ; get width of window
475 Ghost 199
	sub	bx, 32			; bar is 32 pixels shorter then window width
200
	mov	ecx, 119 * 65536 + 10	; set Ystart(109) and Height(10) of bar   109
201
	mov	edx, 0xC0C0C0		; set color of bar
202
again:	;begin draw bar loop
203
	mcall				; draw bar to window area
1351 art_zh 204
	shr	ecx, 16 		; move the Ystart position to working area
205
	add	ecx, 34 		; add 34 pixels to Y Start (moves bar down)
475 Ghost 206
	cmp	cx, word [Form + 4]	; is the Ystart position outside of window area
207
	jae	nomo			; if so stop drawing bars
1351 art_zh 208
	sub	ecx, 14 		; if not, we only need 20 pixels between bar tops
209
	shl	ecx, 16 		; set that values as Ystart
210
	add	ecx, 10 		; Bar Height is always 10 pixels
475 Ghost 211
	jmp	again			; draw another bar
212
nomo:					;done drawing bars here
213
	; start PCI stuff
214
	call	Get_PCI_Info		; get pci version and last bus, scan for and draw each pci device
132 diamond 215
 
475 Ghost 216
	; Window inteface
217
	mov	cx, [PCI_Version]
218
	add	ch, '0'
1351 art_zh 219
	mov	[PCIWin + 85], ch	; 0xBADCODE but it works !
475 Ghost 220
	mov	ch, cl
221
	shr	cl, 4
222
	and	ch, 0x0f
223
	add	cx, '00'
224
	mov	[PCIWin + 87], cx
1351 art_zh 225
	mov	cl, [PCI_LastBus]	; will only work if [PCI_LastBus] < 10
475 Ghost 226
	add	cl, '0'
1351 art_zh 227
	mov	[PCIWin + 106], cl
228
 
475 Ghost 229
	mov	edx, PCIWin
230
	mov	ebx, 20 * 65536 + 25	; x start, ystart of text
231
	mov	ecx, 0x224466		; color of text
232
	mov	eax, 4
233
@@:	movzx	esi, byte[edx]
234
	inc	edx
235
	mcall
236
	add	ebx, 10
237
	add	edx, esi
238
	cmp	byte[edx], -1
239
	jne	@b
240
	; Quantity of devices...
241
	movzx	ecx, byte [total]	; number to draw
242
	mcall	47, 0x00020000,,150 * 65536 + 65, 0x224466
1386 art_zh 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
250
	jo	@f
1351 art_zh 251
	call	Try_MMIO
1386 art_zh 252
@@:
475 Ghost 253
	mcall	12, 2			; end of draw
254
	ret
132 diamond 255
 
475 Ghost 256
;------------------------------------------------------------------
205 heavyiron 257
;* Gets the PCI Version and Last Bus
132 diamond 258
Get_PCI_Info:
475 Ghost 259
	mcall	62, 0
260
	mov	word [PCI_Version], ax
261
	mcall	62, 1
262
	mov	byte [PCI_LastBus], al
263
	;----------------------------------------------------------
264
	;* Get all devices on PCI Bus
265
	cmp	al, 0xff		; 0xFF means no pci bus found
266
	jne	Pci_Exists		;
267
	ret				; if no bus then leave
132 diamond 268
Pci_Exists:
1351 art_zh 269
	mov	byte [V_Bus], 0 	; reset varibles
270
	mov	byte [V_Dev], 0 	;
475 Ghost 271
	mov	edx,  20 * 65536 + 110	; set start write position
132 diamond 272
Start_Enum:
475 Ghost 273
	mov	bl, 6			; get a dword
274
	mov	bh, byte [V_Bus]	; bus of pci device
275
	mov	ch, byte [V_Dev]	; device number/function
276
	mov	cl, 0			; offset to device/vendor id
277
	mcall	62			; get ID's
132 diamond 278
 
475 Ghost 279
	cmp	ax, 0			; Vendor ID should not be 0 or 0xFFFF
1351 art_zh 280
	je	nextDev 		; check next device if nothing exists here
475 Ghost 281
	cmp	ax, 0xffff		;
1351 art_zh 282
	je	nextDev 		;
132 diamond 283
 
475 Ghost 284
	mov	word [PCI_Vendor], ax	; There is a device here, save the ID's
1351 art_zh 285
	shr	eax, 16 		;
475 Ghost 286
	mov	word [PCI_Device], ax	;
287
	mov	bl, 4			; Read config byte
288
	mov	bh, byte [V_Bus]	; Bus #
289
	mov	ch, byte [V_Dev]	; Device # on bus
290
	mov	cl, 0x08		; Register to read (Get Revision)
291
	mcall	62			; Read it
292
	mov	byte [PCI_Rev], al	; Save it
293
	mov	cl, 0x0b		; Register to read (Get class)
294
	mcall	62			; Read it
1351 art_zh 295
 
475 Ghost 296
	mov	byte [PCI_Class], al	; Save it
297
	mov	cl, 0x0a		; Register to read (Get Subclass)
298
	mcall	62			; Read it
299
	mov	byte [PCI_SubClass], al; Save it
1351 art_zh 300
; by Mario79 august 2006
475 Ghost 301
	mov	cl, 0x09		; Register to read (Get Interface)
302
	mcall	62			; Read it
303
	mov  [PCI_Interface], al	; Save it
205 heavyiron 304
;
1351 art_zh 305
; by Ghost april 2007
475 Ghost 306
	mov	cl, 0x3c		; Register to read (Get IRQ)
307
@@:	mcall	62			; Read it
308
	mov	[PCI_IRQ], al		; Save it
1946 clevermous 309
; by CleverMouse juny 2011
310
	mov	cl, 0x0e
311
	mcall	62
312
	push	eax
475 Ghost 313
	inc	byte [total]		; one more device found
314
	call	Print_New_Device	; print device info to screen
1946 clevermous 315
; don't scan for nonzero functions if zero function says "not multifunction device"
316
	pop	eax
317
	test	al, al
318
	js	nextDev
319
	test	byte [V_Dev], 7
1947 clevermous 320
	jnz	nextDev
1946 clevermous 321
	or	byte [V_Dev], 7
132 diamond 322
nextDev:
475 Ghost 323
	inc	byte [V_Dev]		; next device on this bus
324
	jnz	Start_Enum		; jump until we reach zero
325
	;(used to be JNO which caused bug!!! 30-4-2006, JMD)
1351 art_zh 326
	mov	byte [V_Dev], 0 	; reset device number
475 Ghost 327
	inc	byte [V_Bus]		; next bus
328
	mov	al, byte [PCI_LastBus]	; get last bus
329
	cmp	byte [V_Bus], al	; was it last bus
330
	jbe	Start_Enum		; if not jump to keep searching
331
	ret
132 diamond 332
 
1386 art_zh 333
no_ummio_allowed:
334
	xor 	al,al
335
	mov 	[MMIO_allowed],al		; re-enter the subroutine
475 Ghost 336
;------------------------------------------------------------------
132 diamond 337
;* Print device info to screen
1386 art_zh 338
 
132 diamond 339
Print_New_Device:
1386 art_zh 340
	xor 	esi, esi	    	; default text color
341
	mov 	cl, [MMIO_allowed]
342
	or	cl,cl
343
	jz	no_ummio_here
344
	mov 	ch, byte [V_Bus]
345
	mov 	cl, byte [V_Dev]
1351 art_zh 346
	mcall	62, 11		; detect uMMIO
1386 art_zh 347
	and	ax,0x7fff
348
	inc 	ax			; -1 returned?
349
	jo 	no_ummio_allowed
350
	inc 	ax			; -2 returned?
351
	jo 	no_ummio_here
352
	inc 	ax			; -3 returned?
353
	jo 	no_ummio_here
354
	mov 	esi, 0x990033   ; highlighted text color
355
	mov 	bh, byte [V_Bus]
356
	mov 	bl, byte [V_Dev]
357
	mov 	byte [MMIO_Bus], bh
358
	mov 	byte [MMIO_Dev], bl
359
	add 	bh,'0'
360
	mov 	[PCIWin + 129], bh	; uMMIO bus
361
	mov 	al, bl
362
	shr 	al, 1
363
	shr 	al, 1
364
	shr 	al, 1
365
	add 	al,'0'
366
	mov 	[PCIWin + 131], al	; uMMIO device
367
	and 	bl, 7
368
	add 	bl, '0'
369
	mov 	[PCIWin + 133], bl	; uMMIO function
1351 art_zh 370
 
371
no_ummio_here:
475 Ghost 372
	movzx	ecx,word [PCI_Vendor]	; Pointer to number to be written
373
	mcall	47, 0x00040100		; Write Vendor ID
374
	and	edx, 0xFFFF		;*****************************************
1351 art_zh 375
	or	edx, 54 * 65536 ; X start becomes 54
475 Ghost 376
	movzx	ecx, word [PCI_Device]	; get Vendor ID
377
	mcall				; Draw Vendor ID to Window
378
	and	edx, 0xFFFF		;*****************************************
1351 art_zh 379
	or	edx, 98 * 65536 ; X start becomes 98
475 Ghost 380
	movzx	ecx, byte [V_Bus]	; get bus number
381
	mcall	,0x00020100		; draw bus number to screen
382
	and	edx, 0xFFFF		;*****************************************
383
	or	edx, 128 * 65536	; X start becomes 128
384
	movzx	ecx, byte [V_Dev]	; get device number
385
	shr	ecx, 3			; device number is bits 3-7
386
	mcall				; Draw device Number To Window
1351 art_zh 387
 
475 Ghost 388
	and	edx, 0xFFFF		;*****************************************
389
	or	edx, 155 * 65536	; X start becomes 155
390
	movzx	ecx, byte [V_Dev]	; get Function number
391
	and	ecx, 7			; function is first 3 bits
392
	mcall				; Draw Function Number To Window
393
	and	edx, 0xFFFF		;*****************************************
394
	or	edx, 179 * 65536	; X start becomes 179
395
	movzx	ecx, byte [PCI_Rev]	; get revision number
396
	mcall				; Draw Revision to screen
397
	and	edx, 0xFFFF		;*****************************************
398
	or	edx, 215*65536		; X start becomes 215
399
	movzx	ecx, byte [PCI_Class]	; get PCI_Class
400
	mcall				; Draw Class to screen
401
	and	edx, 0xFFFF		;*****************************************
402
	or	edx, 250*65536		; X start becomes 250
403
	movzx	ecx, byte [PCI_SubClass]; get sub class
404
	mcall				; Draw Sub Class to screen
205 heavyiron 405
; from Mario79 august 2006
475 Ghost 406
	and	edx, 0xFFFF		;*****************************************
407
	or	edx, 280 * 65536	; X start becomes 280
408
	movzx	ecx, [PCI_Interface]	; get Interface
409
	mcall
205 heavyiron 410
;
1351 art_zh 411
; from Ghost april 2007                 ;*****************************************
475 Ghost 412
	movzx	ecx, [PCI_IRQ]		; get Interface
413
	cmp	cl, 0x0f		; IRQ between 0..15
414
	ja	@f
415
	and	edx, 0xFFFF
416
	or	edx, 310 * 65536	; X start becomes 310
417
	mcall
418
@@:
419
;
420
	;Write Names
1351 art_zh 421
	movzx	ebx, dx 	; Set y position
475 Ghost 422
	or	ebx, 340 * 65536	; set Xposition to 340
132 diamond 423
 
475 Ghost 424
;------------------------------------------------------------------
425
; Prints the Vendor's Name based on Vendor ID
132 diamond 426
;
475 Ghost 427
; Modified on ??-04-2007 by Ghost for size
428
;------------------------------------------------------------------
429
	mov	edx, VendorsTab
430
	mov	cx, word[PCI_Vendor]
1351 art_zh 431
 
475 Ghost 432
.fn:	mov	ax, [edx]
433
	add	edx, 6
434
	test	ax, ax
435
	jz	.find
436
	cmp	ax, cx
437
	jne	.fn
438
.find:	mov	edx, [edx - 4]
439
	mcall	4,, 0x80000000		; lets print the vendor Name
132 diamond 440
 
441
;------------------------------------------------------------------
475 Ghost 442
; Get description based on Class/Subclass
443
;
444
; Modified on ??-04-2007 by Ghost for size
445
;------------------------------------------------------------------
446
	mov	eax, dword [PCI_Class]
447
	and	eax, 0xffffff
448
	xor	edx, edx
449
	xor	esi, esi
450
.fnc:	inc	esi
451
	mov	ecx, [Classes + esi * 8 - 8]
452
	cmp	cx, 0xffff
453
	je	.endfc
454
	cmp	cx, ax
455
	jne	.fnc
456
	test	ecx, 0xff000000
457
	jz	@f
458
	mov	edx, [Classes + esi * 8 - 4]
459
	jmp	.fnc
460
@@:	cmp	eax, ecx
461
	jne	.fnc
462
	xor	edx, edx
1351 art_zh 463
.endfc: test	edx, edx
475 Ghost 464
	jnz	@f
465
	mov	edx, [Classes + esi * 8 - 4]
1351 art_zh 466
@@:
467
	and	ebx, 0x0000FFFF 	; clear X position
475 Ghost 468
	or	ebx, 0x24E0000		; set X position to 590 pixels
469
	mcall	4,, 0x80000000,, 32	; draw the text
1351 art_zh 470
	movzx	edx, bx 	; get y coordinate
471
	add	edx, 0x0014000A 	; add 10 to y coordinate and set x coordinate to 20
472
	mov	[gr_pos], edx
475 Ghost 473
	ret
1351 art_zh 474
;------------------------------------------------------------------
475
; Get the user-MMIO related info
476
;
477
; Added on ??-12-2009 by art_zh
478
;------------------------------------------------------------------
479
Try_MMIO:
480
	xor	ebx, ebx
481
	mov	edx, ebx
1358 art_zh 482
	mov	bh, [MMIO_BAR]
1351 art_zh 483
	or	bx, 12			; function 12
484
	mov	ecx, 4096		; =1 page to map
485
	mcall	62
1358 art_zh 486
	mov	[MMIO_Map], eax 	; store MMIO lin.addr.
1351 art_zh 487
	mov	ecx, 0x80990022 	; print color : red
488
	add	bh, '0'
489
	cmp	eax, -3
490
	jne	@f
491
	mov	[bar_um+3], bh
492
	mov	ebx, [gr_pos]
493
	mov	edx, bar_um
494
	mcall	4
495
	jmp	mmio_next_bar
496
@@:
497
	cmp	eax, -4
498
	jne	@f
499
	mov	[bar_io+3], bh
500
	mov	ebx, [gr_pos]
501
	mov	edx, bar_io
502
	mcall	4
503
	jmp	mmio_next_bar
504
@@:
1358 art_zh 505
	cmp	bh, '6' 	; expansion ROM ?
506
	je	@f
1351 art_zh 507
	mov	[bar_ram+3], bh
508
	mov	ebx, [gr_pos]
509
	mov	edx, bar_ram
510
	mcall	4
1358 art_zh 511
	jmp	mmio_dump
1353 art_zh 512
@@:
513
	mov	ebx, [gr_pos]
514
	mov	edx, bar_rom
515
	mcall	4
205 heavyiron 516
 
1353 art_zh 517
mmio_dump:
1358 art_zh 518
	mov	edx, [MMIO_Map]
1351 art_zh 519
	mov	esi, 64
520
	mov	ecx, 0x099		; dump color : blue
521
	add	ebx, 10
522
	mov	[gr_pos], ebx
523
	mcall	4
1358 art_zh 524
	mov	ecx, [MMIO_Map] 	; release the tried page
1351 art_zh 525
	mcall	62,13
526
 
527
mmio_next_bar:
528
	mov	bh, [MMIO_BAR]
529
	inc	bh
1353 art_zh 530
	cmp	bh,7
1351 art_zh 531
	je	@f
532
	mov	[MMIO_BAR], bh
533
	add	[gr_pos], 10
534
	jmp	Try_MMIO
535
 
536
@@:
537
	xor	bh,bh
538
	mov	[MMIO_BAR], bh
539
	ret
540
 
541
 
1728 clevermous 542
include 'vendors.inc'
132 diamond 543
;------------------------------------------------------------------
544
; DATA AREA
475 Ghost 545
DATA
132 diamond 546
 
547
 
475 Ghost 548
Form:	dw 800 ; window width (no more, special for 800x600)
549
	dw 100 ; window x start
1358 art_zh 550
	dw 620 ; window height
551
	dw 20 ; window y start
205 heavyiron 552
 
1351 art_zh 553
title	db 'PCI Device Enumerator v 2.2 by J.Delozier, S.Kuzmin, V.Hanla, M.Zakiyanov, A.Jerdev', 0
205 heavyiron 554
 
475 Ghost 555
PCIWin mls \
1351 art_zh 556
	'   Don`t forget to enable PCI Access to Applications in Setup Menu.',\
475 Ghost 557
	'',\
1351 art_zh 558
	'PCI Version  = x.xx; Last PCI Bus = x',\
559
	'User MMIO channel = 0F.F:F ',\
560
	'Number of PCI units =',\
475 Ghost 561
	'',\
562
	'VenID DevID Bus# Dev# Fnc Rev  Class  Subclass/ IRQ                 Company                      Description',\
563
	'                                      Interface',\
564
	'----- ----- ---- ---- --- ---  -----  --------- --- ------------------------------------------ ----------------'
205 heavyiron 565
 
1351 art_zh 566
bar_ram db 'BARx: MMIO block', 0
567
bar_io	db 'BARx: IO ports',0
568
bar_um	db 'BARx: unmapped',0
1358 art_zh 569
bar_rom db 'BAR6: Expansion ROM', 0
1351 art_zh 570
 
475 Ghost 571
;------------------------------------------------------------------
572
; UNINITIALIZED DATA AREA
573
UDATA
205 heavyiron 574
 
475 Ghost 575
total		db ?
576
V_Bus		db ?
577
V_Dev		db ?
578
PCI_Version	dw ?
579
PCI_LastBus	db ?
580
PCI_Device	dw ?
581
PCI_Vendor	dw ?
1351 art_zh 582
PCI_Bus 	db ?
583
PCI_Dev 	db ?
584
PCI_Rev 	db ?
475 Ghost 585
; don`t change order!!!
586
PCI_Class	db ?
587
PCI_SubClass	db ?
588
PCI_Interface	db ?
1351 art_zh 589
PCI_IRQ 	db ?
205 heavyiron 590
 
1351 art_zh 591
align 4
1386 art_zh 592
MMIO_Bus	db 255
593
MMIO_Dev	db 255
1351 art_zh 594
MMIO_BAR	db 0
1386 art_zh 595
MMIO_allowed	db 1
1351 art_zh 596
MMIO_Map	rd 8
597
 
598
gr_pos		dd ?
599
 
475 Ghost 600
Proc_Info	process_information
601
MEOS_APP_END
1351 art_zh 602