2010-01-04 02:51:27 +03:00
|
|
|
;***************************************************************
|
2006-08-18 18:32:11 +04:00
|
|
|
; project name: PCI Device Enumeration
|
2007-05-04 18:44:43 +04:00
|
|
|
; target platform: KolibriOS
|
2010-01-02 18:10:39 +03:00
|
|
|
; compiler: flat assembler 1.68
|
2011-06-26 04:03:00 +04:00
|
|
|
; version: 2.3
|
2011-07-01 22:30:18 +04:00
|
|
|
; last update: Jule 2011
|
2011-06-26 09:21:02 +04:00
|
|
|
; maintained by: Jason Delozier <cordata51@hotmail.com>
|
|
|
|
; Sergey Kuzmin <kuzmin_serg@list.ru>
|
|
|
|
; Mihailov Ilia <ghost.nsk@gmail.com>
|
2011-06-26 04:03:00 +04:00
|
|
|
; Marat Zakiyanov <mario79@bk.ru>
|
2011-06-26 09:21:02 +04:00
|
|
|
; Artem Jerdev <art_zh@yahoo.com>
|
|
|
|
; Evgeny Grechnikov (diamond)
|
|
|
|
; Veronica (CleverMouse)
|
2011-06-26 04:03:00 +04:00
|
|
|
; old project site: http://www.coolthemes.narod.ru/pcidev.html
|
|
|
|
; new project site: http://board.kolibrios.org/viewtopic.php?f=42&t=73
|
2006-08-18 18:32:11 +04:00
|
|
|
;***************************************************************
|
|
|
|
;Summary: This program will attempt to scan the PCI Bus
|
|
|
|
; and display basic information about each device
|
|
|
|
; connected to the PCI Bus.
|
|
|
|
;***************************************************************
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2013-06-09 16:28:30 +04:00
|
|
|
|
|
|
|
include 'lang.inc' ;language support
|
2010-01-06 02:21:35 +03:00
|
|
|
include '../../../macros.inc'
|
2010-01-02 18:10:39 +03:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
include '../../../develop/libraries/box_lib/load_lib.mac'
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
use32
|
|
|
|
org 0x0
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
dd 0x01 ; header version
|
|
|
|
dd START ; start of code
|
|
|
|
dd IM_END ; size of image
|
|
|
|
dd I_END ; memory for app
|
|
|
|
dd stacktop ; esp
|
|
|
|
dd 0 ; I_Param
|
2011-06-26 09:21:02 +04:00
|
|
|
dd path ; APPLICATION PATH
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
@use_library ; load_lib macro
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
START:
|
|
|
|
mcall 68,11
|
|
|
|
mcall 66,1,1
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
load_libraries l_libs_start,end_l_libs
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
;OpenDialog initialisation
|
|
|
|
push dword OpenDialog_data
|
|
|
|
call [OpenDialog_Init]
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
mov edi,filename_area
|
|
|
|
mov esi,start_temp_file_name
|
|
|
|
call copy_file_name_path
|
|
|
|
;-----------------------------------------------------------------------------
|
2011-06-26 21:38:41 +04:00
|
|
|
mcall 68,12,4096*4 ; 16 Kb - I hope this will be enough for store of data
|
2011-06-26 04:03:00 +04:00
|
|
|
mov [store_text_area_start],eax
|
2013-06-09 16:28:30 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2007-05-04 18:44:43 +04:00
|
|
|
call draw_window
|
2011-06-26 04:03:00 +04:00
|
|
|
still:
|
|
|
|
mcall 10 ; wait here for event
|
2007-05-04 18:44:43 +04:00
|
|
|
dec eax ; redraw request ?
|
|
|
|
jz red
|
|
|
|
dec eax ; key in buffer ?
|
|
|
|
jz key
|
|
|
|
dec eax ; button in buffer ?
|
|
|
|
jz button
|
|
|
|
jmp still
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2007-05-04 18:44:43 +04:00
|
|
|
red: ; redraw
|
2011-08-18 18:08:40 +04:00
|
|
|
call get_window_param
|
2007-05-10 17:48:35 +04:00
|
|
|
mov eax, [Proc_Info.box.left]; store the window coordinates into the Form Structure
|
2007-05-04 18:44:43 +04:00
|
|
|
mov [Form + 2], ax ; x start position
|
2007-05-10 17:48:35 +04:00
|
|
|
mov eax, [Proc_Info.box.top];
|
2007-05-04 18:44:43 +04:00
|
|
|
mov [Form + 6], ax ; ystart position
|
2007-05-10 17:48:35 +04:00
|
|
|
mov eax, [Proc_Info.box.width] ;
|
2007-05-04 18:44:43 +04:00
|
|
|
mov [Form], ax ; window width
|
2007-05-10 17:48:35 +04:00
|
|
|
mov eax, [Proc_Info.box.height] ;
|
2007-05-04 18:44:43 +04:00
|
|
|
mov [Form + 4] ,ax ; window height
|
|
|
|
call draw_window ; go redraw window now
|
|
|
|
jmp still
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2007-05-04 18:44:43 +04:00
|
|
|
key: ; key
|
|
|
|
mcall 2 ; just read it and ignore
|
2011-06-26 04:03:00 +04:00
|
|
|
cmp [extended_key],1
|
|
|
|
je .extended_key
|
|
|
|
test al, al
|
|
|
|
jnz still
|
|
|
|
cmp ah, 0xE0
|
|
|
|
jne @f
|
|
|
|
mov [extended_key],1
|
|
|
|
jmp still
|
|
|
|
@@:
|
|
|
|
cmp ah,129 ; Esc
|
|
|
|
je button.exit
|
|
|
|
cmp ah,159
|
|
|
|
je call_OpenDialog
|
|
|
|
jmp still
|
|
|
|
.extended_key:
|
|
|
|
mov [extended_key],0
|
|
|
|
cmp ah,129 ; Esc
|
|
|
|
je button.exit
|
|
|
|
cmp ah,159
|
|
|
|
je call_OpenDialog
|
2007-05-04 18:44:43 +04:00
|
|
|
jmp still
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2010-01-02 18:10:39 +03:00
|
|
|
button: ; button
|
2007-05-04 18:44:43 +04:00
|
|
|
mcall 17 ; get id
|
2011-06-26 04:03:00 +04:00
|
|
|
cmp ah,2
|
|
|
|
je call_OpenDialog
|
2007-05-04 18:44:43 +04:00
|
|
|
cmp ah, 1 ; button id = 1 ?
|
|
|
|
jne still
|
2011-06-26 04:03:00 +04:00
|
|
|
.exit:
|
2007-05-04 18:44:43 +04:00
|
|
|
mcall -1 ; close this program
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
call_OpenDialog:
|
|
|
|
mov [OpenDialog_data.type],1 ; Save
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
push dword OpenDialog_data
|
|
|
|
call [OpenDialog_Start]
|
2006-08-18 18:32:11 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
cmp [OpenDialog_data.status],2 ; OpenDialog does not start
|
|
|
|
je .save_file_default_path
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
cmp [OpenDialog_data.status],1
|
|
|
|
jne still
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_data
|
|
|
|
jmp still
|
2013-06-09 16:28:30 +04:00
|
|
|
;----------------------------------------
|
2011-06-26 04:03:00 +04:00
|
|
|
.save_file_default_path:
|
|
|
|
mov edi,file_name
|
|
|
|
mov esi,file_default_path
|
|
|
|
call copy_file_name_path
|
|
|
|
call store_data
|
|
|
|
jmp still
|
2013-06-09 16:28:30 +04:00
|
|
|
;----------------------------------------
|
2011-06-26 04:03:00 +04:00
|
|
|
copy_file_name_path:
|
|
|
|
xor eax,eax
|
|
|
|
cld
|
|
|
|
@@:
|
|
|
|
lodsb
|
|
|
|
stosb
|
|
|
|
test eax,eax
|
|
|
|
jnz @r
|
|
|
|
ret
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
prepare_text_area:
|
|
|
|
mov edi,[store_text_area_start]
|
|
|
|
|
|
|
|
push edi
|
2011-06-26 21:38:41 +04:00
|
|
|
mov ecx,4096 ; 16 Kb - I hope this will be enough for store of data
|
2011-06-26 04:03:00 +04:00
|
|
|
mov eax,dword ' '
|
|
|
|
cld
|
|
|
|
rep stosd
|
|
|
|
pop edi
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
mov esi,PCIWin
|
|
|
|
xor ecx,ecx
|
|
|
|
@@:
|
|
|
|
mov cl,[esi]
|
|
|
|
inc esi
|
|
|
|
rep movsb
|
|
|
|
mov al,0Ah ; CR - carriage return
|
|
|
|
stosb
|
|
|
|
cmp [esi],byte 0xFF
|
2013-06-09 16:28:30 +04:00
|
|
|
jne @r
|
2011-06-26 04:03:00 +04:00
|
|
|
|
|
|
|
mov [store_text_area_end],edi
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
xor edi,edi
|
|
|
|
ret
|
2013-06-09 16:28:30 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2011-08-18 18:08:40 +04:00
|
|
|
get_window_param:
|
2013-06-09 16:28:30 +04:00
|
|
|
mcall 9, Proc_Info, -1 ; window redraw requested so get
|
2011-08-18 18:08:40 +04:00
|
|
|
; new window coordinates and size
|
|
|
|
ret
|
2013-06-09 16:28:30 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2006-08-18 18:32:11 +04:00
|
|
|
draw_window:
|
2011-06-26 04:03:00 +04:00
|
|
|
call prepare_text_area
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov byte [total], 0
|
|
|
|
mcall 12, 1 ; start of draw
|
|
|
|
; DRAW WINDOW
|
2011-06-26 04:03:00 +04:00
|
|
|
mcall 0,dword [Form],dword [Form + 4],0x13ffffff,0x805080d0,title
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-08-18 18:08:40 +04:00
|
|
|
call get_window_param
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-08-18 18:08:40 +04:00
|
|
|
mov eax,[Proc_Info+70] ;status of window
|
|
|
|
test eax,100b
|
|
|
|
jne .end
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
mcall 8,<450,100>,<25,25>,2,0xC0C0C0
|
|
|
|
shr ecx,16
|
|
|
|
mov bx,cx
|
|
|
|
add ebx,13 shl 16+4
|
|
|
|
mcall 4,,0x80000000,text_save_button
|
|
|
|
add bx,11
|
|
|
|
mcall ,,,text_save_button.1
|
2007-05-04 18:44:43 +04:00
|
|
|
; Insert horizontal bars in list area
|
2010-01-02 18:10:39 +03:00
|
|
|
mov eax, 13 ; draw bar system function
|
|
|
|
mov ebx, 18 ; set Xstart position of bar
|
|
|
|
shl ebx, 16 ;
|
|
|
|
mov bx, word [Form] ; get width of window
|
2007-05-04 18:44:43 +04:00
|
|
|
sub bx, 32 ; bar is 32 pixels shorter then window width
|
|
|
|
mov ecx, 119 * 65536 + 10 ; set Ystart(109) and Height(10) of bar 109
|
|
|
|
mov edx, 0xC0C0C0 ; set color of bar
|
2011-08-18 18:08:40 +04:00
|
|
|
.again: ;begin draw bar loop
|
2007-05-04 18:44:43 +04:00
|
|
|
mcall ; draw bar to window area
|
2010-01-02 18:10:39 +03:00
|
|
|
shr ecx, 16 ; move the Ystart position to working area
|
|
|
|
add ecx, 34 ; add 34 pixels to Y Start (moves bar down)
|
2007-05-04 18:44:43 +04:00
|
|
|
cmp cx, word [Form + 4] ; is the Ystart position outside of window area
|
2011-08-18 18:08:40 +04:00
|
|
|
jae .nomo ; if so stop drawing bars
|
2010-01-02 18:10:39 +03:00
|
|
|
sub ecx, 14 ; if not, we only need 20 pixels between bar tops
|
|
|
|
shl ecx, 16 ; set that values as Ystart
|
|
|
|
add ecx, 10 ; Bar Height is always 10 pixels
|
2011-08-18 18:08:40 +04:00
|
|
|
jmp .again ; draw another bar
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2011-08-18 18:08:40 +04:00
|
|
|
.nomo: ;done drawing bars here
|
2007-05-04 18:44:43 +04:00
|
|
|
; start PCI stuff
|
|
|
|
call Get_PCI_Info ; get pci version and last bus, scan for and draw each pci device
|
|
|
|
|
|
|
|
; Window inteface
|
|
|
|
mov cx, [PCI_Version]
|
|
|
|
add ch, '0'
|
2010-01-02 18:10:39 +03:00
|
|
|
mov [PCIWin + 85], ch ; 0xBADCODE but it works !
|
2007-05-04 18:44:43 +04:00
|
|
|
mov ch, cl
|
|
|
|
shr cl, 4
|
|
|
|
and ch, 0x0f
|
|
|
|
add cx, '00'
|
|
|
|
mov [PCIWin + 87], cx
|
2010-01-02 18:10:39 +03:00
|
|
|
mov cl, [PCI_LastBus] ; will only work if [PCI_LastBus] < 10
|
2007-05-04 18:44:43 +04:00
|
|
|
add cl, '0'
|
2010-01-02 18:10:39 +03:00
|
|
|
mov [PCIWin + 106], cl
|
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov edx, PCIWin
|
|
|
|
mov ebx, 20 * 65536 + 25 ; x start, ystart of text
|
|
|
|
mov ecx, 0x224466 ; color of text
|
|
|
|
mov eax, 4
|
2011-06-26 04:03:00 +04:00
|
|
|
@@:
|
|
|
|
movzx esi, byte[edx]
|
2007-05-04 18:44:43 +04:00
|
|
|
inc edx
|
|
|
|
mcall
|
|
|
|
add ebx, 10
|
|
|
|
add edx, esi
|
|
|
|
cmp byte[edx], -1
|
|
|
|
jne @b
|
|
|
|
; Quantity of devices...
|
|
|
|
movzx ecx, byte [total] ; number to draw
|
|
|
|
mcall 47, 0x00020000,,150 * 65536 + 65, 0x224466
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-07-02 01:54:21 +04:00
|
|
|
mov ebx,ecx
|
|
|
|
mov ecx,2
|
|
|
|
mov edi,[store_text_area_start]
|
|
|
|
add edi,157
|
|
|
|
push edi
|
|
|
|
call binary_to_hex_string
|
|
|
|
pop edi
|
|
|
|
mov [edi+2],byte 'h'
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-02-03 14:22:32 +03:00
|
|
|
mov ah, [MMIO_allowed]
|
|
|
|
or ah, ah
|
|
|
|
jz @f
|
|
|
|
mov ah, [MMIO_Bus] ; =255 if MMIO disabled / not found
|
|
|
|
and ah, 0x7f
|
|
|
|
inc ah
|
2013-06-09 16:28:30 +04:00
|
|
|
jo @f
|
2010-01-02 18:10:39 +03:00
|
|
|
call Try_MMIO
|
2010-02-03 14:22:32 +03:00
|
|
|
@@:
|
2011-08-18 18:08:40 +04:00
|
|
|
.end:
|
2007-05-04 18:44:43 +04:00
|
|
|
mcall 12, 2 ; end of draw
|
|
|
|
ret
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
store_data:
|
|
|
|
mov eax,[store_text_area_start]
|
|
|
|
mov [fileinfo.return],eax
|
|
|
|
mov ebx,[store_text_area_end]
|
|
|
|
sub ebx,eax
|
|
|
|
inc ebx
|
|
|
|
mov [fileinfo.size],ebx
|
|
|
|
mcall 70,fileinfo
|
|
|
|
ret
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-11-02 17:18:23 +03:00
|
|
|
;* Gets the PCI Version and Last Bus
|
2006-08-18 18:32:11 +04:00
|
|
|
Get_PCI_Info:
|
2007-05-04 18:44:43 +04:00
|
|
|
mcall 62, 0
|
|
|
|
mov word [PCI_Version], ax
|
|
|
|
mcall 62, 1
|
|
|
|
mov byte [PCI_LastBus], al
|
|
|
|
;----------------------------------------------------------
|
|
|
|
;* Get all devices on PCI Bus
|
|
|
|
cmp al, 0xff ; 0xFF means no pci bus found
|
|
|
|
jne Pci_Exists ;
|
|
|
|
ret ; if no bus then leave
|
2013-06-09 16:28:30 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2006-08-18 18:32:11 +04:00
|
|
|
Pci_Exists:
|
2010-01-02 18:10:39 +03:00
|
|
|
mov byte [V_Bus], 0 ; reset varibles
|
|
|
|
mov byte [V_Dev], 0 ;
|
2007-05-04 18:44:43 +04:00
|
|
|
mov edx, 20 * 65536 + 110 ; set start write position
|
2006-08-18 18:32:11 +04:00
|
|
|
Start_Enum:
|
2007-05-04 18:44:43 +04:00
|
|
|
mov bl, 6 ; get a dword
|
|
|
|
mov bh, byte [V_Bus] ; bus of pci device
|
|
|
|
mov ch, byte [V_Dev] ; device number/function
|
|
|
|
mov cl, 0 ; offset to device/vendor id
|
|
|
|
mcall 62 ; get ID's
|
|
|
|
|
|
|
|
cmp ax, 0 ; Vendor ID should not be 0 or 0xFFFF
|
2010-01-02 18:10:39 +03:00
|
|
|
je nextDev ; check next device if nothing exists here
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
cmp ax, 0xffff ;
|
2010-01-02 18:10:39 +03:00
|
|
|
je nextDev ;
|
2007-05-04 18:44:43 +04:00
|
|
|
|
|
|
|
mov word [PCI_Vendor], ax ; There is a device here, save the ID's
|
2010-01-02 18:10:39 +03:00
|
|
|
shr eax, 16 ;
|
2007-05-04 18:44:43 +04:00
|
|
|
mov word [PCI_Device], ax ;
|
|
|
|
mov bl, 4 ; Read config byte
|
|
|
|
mov bh, byte [V_Bus] ; Bus #
|
|
|
|
mov ch, byte [V_Dev] ; Device # on bus
|
|
|
|
mov cl, 0x08 ; Register to read (Get Revision)
|
|
|
|
mcall 62 ; Read it
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov byte [PCI_Rev], al ; Save it
|
|
|
|
mov cl, 0x0b ; Register to read (Get class)
|
|
|
|
mcall 62 ; Read it
|
2010-01-02 18:10:39 +03:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov byte [PCI_Class], al ; Save it
|
|
|
|
mov cl, 0x0a ; Register to read (Get Subclass)
|
|
|
|
mcall 62 ; Read it
|
|
|
|
mov byte [PCI_SubClass], al; Save it
|
2010-01-02 18:10:39 +03:00
|
|
|
; by Mario79 august 2006
|
2007-05-04 18:44:43 +04:00
|
|
|
mov cl, 0x09 ; Register to read (Get Interface)
|
|
|
|
mcall 62 ; Read it
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov [PCI_Interface], al ; Save it
|
2006-11-02 17:18:23 +03:00
|
|
|
;
|
2010-01-02 18:10:39 +03:00
|
|
|
; by Ghost april 2007
|
2007-05-04 18:44:43 +04:00
|
|
|
mov cl, 0x3c ; Register to read (Get IRQ)
|
2011-06-26 04:03:00 +04:00
|
|
|
@@:
|
|
|
|
mcall 62 ; Read it
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov [PCI_IRQ], al ; Save it
|
2011-06-03 18:32:52 +04:00
|
|
|
; by CleverMouse juny 2011
|
|
|
|
mov cl, 0x0e
|
|
|
|
mcall 62
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-03 18:32:52 +04:00
|
|
|
push eax
|
2007-05-04 18:44:43 +04:00
|
|
|
inc byte [total] ; one more device found
|
|
|
|
call Print_New_Device ; print device info to screen
|
2011-06-03 18:32:52 +04:00
|
|
|
; don't scan for nonzero functions if zero function says "not multifunction device"
|
|
|
|
pop eax
|
|
|
|
test al, al
|
|
|
|
js nextDev
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-03 18:32:52 +04:00
|
|
|
test byte [V_Dev], 7
|
2011-06-03 19:25:57 +04:00
|
|
|
jnz nextDev
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-03 18:32:52 +04:00
|
|
|
or byte [V_Dev], 7
|
2006-08-18 18:32:11 +04:00
|
|
|
nextDev:
|
2007-05-04 18:44:43 +04:00
|
|
|
inc byte [V_Dev] ; next device on this bus
|
|
|
|
jnz Start_Enum ; jump until we reach zero
|
|
|
|
;(used to be JNO which caused bug!!! 30-4-2006, JMD)
|
2010-01-02 18:10:39 +03:00
|
|
|
mov byte [V_Dev], 0 ; reset device number
|
2007-05-04 18:44:43 +04:00
|
|
|
inc byte [V_Bus] ; next bus
|
|
|
|
mov al, byte [PCI_LastBus] ; get last bus
|
|
|
|
cmp byte [V_Bus], al ; was it last bus
|
|
|
|
jbe Start_Enum ; if not jump to keep searching
|
|
|
|
ret
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2010-02-03 14:22:32 +03:00
|
|
|
no_ummio_allowed:
|
|
|
|
xor al,al
|
|
|
|
mov [MMIO_allowed],al ; re-enter the subroutine
|
2007-05-04 18:44:43 +04:00
|
|
|
;------------------------------------------------------------------
|
2006-08-18 18:32:11 +04:00
|
|
|
;* Print device info to screen
|
2010-02-03 14:22:32 +03:00
|
|
|
|
2006-08-18 18:32:11 +04:00
|
|
|
Print_New_Device:
|
2010-02-03 14:22:32 +03:00
|
|
|
xor esi, esi ; default text color
|
|
|
|
mov cl, [MMIO_allowed]
|
|
|
|
or cl,cl
|
|
|
|
jz no_ummio_here
|
|
|
|
mov ch, byte [V_Bus]
|
|
|
|
mov cl, byte [V_Dev]
|
2010-01-02 18:10:39 +03:00
|
|
|
mcall 62, 11 ; detect uMMIO
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-02-03 14:22:32 +03:00
|
|
|
and ax,0x7fff
|
|
|
|
inc ax ; -1 returned?
|
|
|
|
jo no_ummio_allowed
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-02-03 14:22:32 +03:00
|
|
|
inc ax ; -2 returned?
|
|
|
|
jo no_ummio_here
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-02-03 14:22:32 +03:00
|
|
|
inc ax ; -3 returned?
|
|
|
|
jo no_ummio_here
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-02-03 14:22:32 +03:00
|
|
|
mov esi, 0x990033 ; highlighted text color
|
|
|
|
mov bh, byte [V_Bus]
|
|
|
|
mov bl, byte [V_Dev]
|
|
|
|
mov byte [MMIO_Bus], bh
|
|
|
|
mov byte [MMIO_Dev], bl
|
|
|
|
add bh,'0'
|
|
|
|
mov [PCIWin + 129], bh ; uMMIO bus
|
|
|
|
mov al, bl
|
|
|
|
shr al, 1
|
|
|
|
shr al, 1
|
|
|
|
shr al, 1
|
|
|
|
add al,'0'
|
|
|
|
mov [PCIWin + 131], al ; uMMIO device
|
|
|
|
and bl, 7
|
|
|
|
add bl, '0'
|
|
|
|
mov [PCIWin + 133], bl ; uMMIO function
|
2010-01-02 18:10:39 +03:00
|
|
|
|
|
|
|
no_ummio_here:
|
2007-05-04 18:44:43 +04:00
|
|
|
movzx ecx,word [PCI_Vendor] ; Pointer to number to be written
|
|
|
|
mcall 47, 0x00040100 ; Write Vendor ID
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_4_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
2010-01-02 18:10:39 +03:00
|
|
|
or edx, 54 * 65536 ; X start becomes 54
|
2007-05-04 18:44:43 +04:00
|
|
|
movzx ecx, word [PCI_Device] ; get Vendor ID
|
|
|
|
mcall ; Draw Vendor ID to Window
|
2011-06-26 04:03:00 +04:00
|
|
|
|
|
|
|
call store_4_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
2010-01-02 18:10:39 +03:00
|
|
|
or edx, 98 * 65536 ; X start becomes 98
|
2007-05-04 18:44:43 +04:00
|
|
|
movzx ecx, byte [V_Bus] ; get bus number
|
|
|
|
mcall ,0x00020100 ; draw bus number to screen
|
2011-06-26 04:03:00 +04:00
|
|
|
|
|
|
|
call store_2_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
|
|
|
or edx, 128 * 65536 ; X start becomes 128
|
|
|
|
movzx ecx, byte [V_Dev] ; get device number
|
|
|
|
shr ecx, 3 ; device number is bits 3-7
|
|
|
|
mcall ; Draw device Number To Window
|
2010-01-02 18:10:39 +03:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_2_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
|
|
|
or edx, 155 * 65536 ; X start becomes 155
|
|
|
|
movzx ecx, byte [V_Dev] ; get Function number
|
|
|
|
and ecx, 7 ; function is first 3 bits
|
|
|
|
mcall ; Draw Function Number To Window
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_2_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
|
|
|
or edx, 179 * 65536 ; X start becomes 179
|
|
|
|
movzx ecx, byte [PCI_Rev] ; get revision number
|
|
|
|
mcall ; Draw Revision to screen
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_2_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
|
|
|
or edx, 215*65536 ; X start becomes 215
|
|
|
|
movzx ecx, byte [PCI_Class] ; get PCI_Class
|
|
|
|
mcall ; Draw Class to screen
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_2_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
|
|
|
or edx, 250*65536 ; X start becomes 250
|
|
|
|
movzx ecx, byte [PCI_SubClass]; get sub class
|
|
|
|
mcall ; Draw Sub Class to screen
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_2_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
; from Mario79 august 2006
|
2007-05-04 18:44:43 +04:00
|
|
|
and edx, 0xFFFF ;*****************************************
|
|
|
|
or edx, 280 * 65536 ; X start becomes 280
|
|
|
|
movzx ecx, [PCI_Interface] ; get Interface
|
|
|
|
mcall
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_2_digits
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
;
|
2010-01-02 18:10:39 +03:00
|
|
|
; from Ghost april 2007 ;*****************************************
|
2011-07-01 22:30:18 +04:00
|
|
|
and edx, 0xFFFF
|
|
|
|
or edx, 310 * 65536 ; X start becomes 310
|
2007-05-04 18:44:43 +04:00
|
|
|
movzx ecx, [PCI_IRQ] ; get Interface
|
2011-09-24 15:14:06 +04:00
|
|
|
cmp cl, 23 ; IRQ between 0..23
|
2007-05-04 18:44:43 +04:00
|
|
|
ja @f
|
2011-07-01 22:30:18 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mcall
|
2011-07-01 22:30:18 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
call store_2_digits
|
2011-07-01 22:30:18 +04:00
|
|
|
jmp .PCI_Vendor
|
2013-06-09 16:28:30 +04:00
|
|
|
@@:
|
2011-07-01 22:30:18 +04:00
|
|
|
call store_NA
|
|
|
|
.PCI_Vendor:
|
2007-05-04 18:44:43 +04:00
|
|
|
;Write Names
|
2010-01-02 18:10:39 +03:00
|
|
|
movzx ebx, dx ; Set y position
|
2007-05-04 18:44:43 +04:00
|
|
|
or ebx, 340 * 65536 ; set Xposition to 340
|
2006-08-18 18:32:11 +04:00
|
|
|
|
|
|
|
;------------------------------------------------------------------
|
2007-05-04 18:44:43 +04:00
|
|
|
; Prints the Vendor's Name based on Vendor ID
|
|
|
|
;
|
|
|
|
; Modified on ??-04-2007 by Ghost for size
|
2006-08-18 18:32:11 +04:00
|
|
|
;------------------------------------------------------------------
|
2007-05-04 18:44:43 +04:00
|
|
|
mov edx, VendorsTab
|
|
|
|
mov cx, word[PCI_Vendor]
|
2010-01-02 18:10:39 +03:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
.fn:
|
|
|
|
mov ax, [edx]
|
2007-05-04 18:44:43 +04:00
|
|
|
add edx, 6
|
|
|
|
test ax, ax
|
|
|
|
jz .find
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
cmp ax, cx
|
|
|
|
jne .fn
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
.find:
|
|
|
|
mov edx, [edx - 4]
|
2007-05-04 18:44:43 +04:00
|
|
|
mcall 4,, 0x80000000 ; lets print the vendor Name
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
mov [store_text_size],42
|
|
|
|
call store_text
|
2007-05-04 18:44:43 +04:00
|
|
|
;------------------------------------------------------------------
|
|
|
|
; Get description based on Class/Subclass
|
|
|
|
;
|
|
|
|
; Modified on ??-04-2007 by Ghost for size
|
|
|
|
;------------------------------------------------------------------
|
|
|
|
mov eax, dword [PCI_Class]
|
|
|
|
and eax, 0xffffff
|
|
|
|
xor edx, edx
|
|
|
|
xor esi, esi
|
2011-06-26 04:03:00 +04:00
|
|
|
.fnc:
|
|
|
|
inc esi
|
2007-05-04 18:44:43 +04:00
|
|
|
mov ecx, [Classes + esi * 8 - 8]
|
|
|
|
cmp cx, 0xffff
|
|
|
|
je .endfc
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
cmp cx, ax
|
|
|
|
jne .fnc
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
test ecx, 0xff000000
|
|
|
|
jz @f
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov edx, [Classes + esi * 8 - 4]
|
|
|
|
jmp .fnc
|
2011-06-26 04:03:00 +04:00
|
|
|
@@:
|
|
|
|
cmp eax, ecx
|
2007-05-04 18:44:43 +04:00
|
|
|
jne .fnc
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
xor edx, edx
|
2011-06-26 04:03:00 +04:00
|
|
|
.endfc:
|
|
|
|
test edx, edx
|
2007-05-04 18:44:43 +04:00
|
|
|
jnz @f
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
mov edx, [Classes + esi * 8 - 4]
|
2010-01-02 18:10:39 +03:00
|
|
|
@@:
|
|
|
|
and ebx, 0x0000FFFF ; clear X position
|
2007-05-04 18:44:43 +04:00
|
|
|
or ebx, 0x24E0000 ; set X position to 590 pixels
|
|
|
|
mcall 4,, 0x80000000,, 32 ; draw the text
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
mov [store_text_size],0
|
|
|
|
call store_text
|
|
|
|
call store_CR
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-02 18:10:39 +03:00
|
|
|
movzx edx, bx ; get y coordinate
|
|
|
|
add edx, 0x0014000A ; add 10 to y coordinate and set x coordinate to 20
|
|
|
|
mov [gr_pos], edx
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------
|
|
|
|
; Get the user-MMIO related info
|
|
|
|
;
|
|
|
|
; Added on ??-12-2009 by art_zh
|
|
|
|
;------------------------------------------------------------------
|
|
|
|
Try_MMIO:
|
|
|
|
xor ebx, ebx
|
|
|
|
mov edx, ebx
|
2010-01-04 03:28:31 +03:00
|
|
|
mov bh, [MMIO_BAR]
|
2010-01-02 18:10:39 +03:00
|
|
|
or bx, 12 ; function 12
|
|
|
|
mov ecx, 4096 ; =1 page to map
|
|
|
|
mcall 62
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-04 03:28:31 +03:00
|
|
|
mov [MMIO_Map], eax ; store MMIO lin.addr.
|
2010-01-02 18:10:39 +03:00
|
|
|
mov ecx, 0x80990022 ; print color : red
|
|
|
|
add bh, '0'
|
|
|
|
cmp eax, -3
|
|
|
|
jne @f
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-02 18:10:39 +03:00
|
|
|
mov [bar_um+3], bh
|
|
|
|
mov ebx, [gr_pos]
|
|
|
|
mov edx, bar_um
|
|
|
|
mcall 4
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-02 18:10:39 +03:00
|
|
|
jmp mmio_next_bar
|
|
|
|
@@:
|
|
|
|
cmp eax, -4
|
|
|
|
jne @f
|
|
|
|
mov [bar_io+3], bh
|
|
|
|
mov ebx, [gr_pos]
|
|
|
|
mov edx, bar_io
|
|
|
|
mcall 4
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-02 18:10:39 +03:00
|
|
|
jmp mmio_next_bar
|
|
|
|
@@:
|
2010-01-04 03:28:31 +03:00
|
|
|
cmp bh, '6' ; expansion ROM ?
|
|
|
|
je @f
|
2010-01-02 18:10:39 +03:00
|
|
|
mov [bar_ram+3], bh
|
|
|
|
mov ebx, [gr_pos]
|
|
|
|
mov edx, bar_ram
|
|
|
|
mcall 4
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-04 03:28:31 +03:00
|
|
|
jmp mmio_dump
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2010-01-04 00:38:39 +03:00
|
|
|
@@:
|
|
|
|
mov ebx, [gr_pos]
|
|
|
|
mov edx, bar_rom
|
|
|
|
mcall 4
|
2010-01-02 18:10:39 +03:00
|
|
|
|
2010-01-04 00:38:39 +03:00
|
|
|
mmio_dump:
|
2010-01-04 03:28:31 +03:00
|
|
|
mov edx, [MMIO_Map]
|
2010-01-02 18:10:39 +03:00
|
|
|
mov esi, 64
|
|
|
|
mov ecx, 0x099 ; dump color : blue
|
|
|
|
add ebx, 10
|
|
|
|
mov [gr_pos], ebx
|
|
|
|
mcall 4
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-04 03:28:31 +03:00
|
|
|
mov ecx, [MMIO_Map] ; release the tried page
|
2010-01-02 18:10:39 +03:00
|
|
|
mcall 62,13
|
|
|
|
|
|
|
|
mmio_next_bar:
|
|
|
|
mov bh, [MMIO_BAR]
|
|
|
|
inc bh
|
2010-01-04 00:38:39 +03:00
|
|
|
cmp bh,7
|
2010-01-02 18:10:39 +03:00
|
|
|
je @f
|
2013-06-09 16:28:30 +04:00
|
|
|
|
2010-01-02 18:10:39 +03:00
|
|
|
mov [MMIO_BAR], bh
|
|
|
|
add [gr_pos], 10
|
|
|
|
jmp Try_MMIO
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2010-01-02 18:10:39 +03:00
|
|
|
@@:
|
|
|
|
xor bh,bh
|
|
|
|
mov [MMIO_BAR], bh
|
2007-05-04 18:44:43 +04:00
|
|
|
ret
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
store_CR:
|
|
|
|
pusha
|
|
|
|
mov edi,[store_text_area_end]
|
|
|
|
mov [edi],word 0A20h ; CR (carriage return) + SPACE
|
|
|
|
add dword [store_text_area_end],2
|
|
|
|
popa
|
2013-06-09 16:28:30 +04:00
|
|
|
ret
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
store_text:
|
|
|
|
pusha
|
|
|
|
inc dword [store_text_area_end]
|
2013-06-09 16:28:30 +04:00
|
|
|
mov esi,edx
|
2011-06-26 04:03:00 +04:00
|
|
|
mov edi,[store_text_area_end]
|
|
|
|
push edi
|
|
|
|
xor eax,eax
|
|
|
|
cld
|
|
|
|
@@:
|
|
|
|
lodsb
|
|
|
|
test eax,eax
|
|
|
|
jz @f
|
|
|
|
stosb
|
|
|
|
inc dword [store_text_area_end]
|
|
|
|
jmp @r
|
|
|
|
@@:
|
|
|
|
pop esi
|
|
|
|
mov eax,[store_text_size]
|
|
|
|
test eax,eax
|
|
|
|
jz @f
|
|
|
|
sub edi,esi
|
|
|
|
sub eax,edi
|
|
|
|
add [store_text_area_end],eax
|
|
|
|
@@:
|
|
|
|
popa
|
2013-06-09 16:28:30 +04:00
|
|
|
ret
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2011-07-01 22:30:18 +04:00
|
|
|
store_NA:
|
2011-06-26 04:03:00 +04:00
|
|
|
pusha
|
2011-07-01 22:30:18 +04:00
|
|
|
mov ebx,edx
|
|
|
|
mcall 4,,0x80000000,text_NA
|
2011-06-26 04:03:00 +04:00
|
|
|
mov edi,[store_text_area_end]
|
2011-07-01 22:30:18 +04:00
|
|
|
mov ax,[edx]
|
|
|
|
mov [edi+1],ax
|
2011-07-02 01:54:21 +04:00
|
|
|
add [store_text_area_end],dword 5
|
|
|
|
popa
|
|
|
|
ret
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
store_2_digits:
|
|
|
|
pusha
|
|
|
|
inc [store_text_area_end]
|
|
|
|
mov ebx,ecx
|
|
|
|
mov ecx,2
|
|
|
|
mov edi,[store_text_area_end]
|
|
|
|
call binary_to_hex_string
|
|
|
|
add [store_text_area_end],dword 4
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
;-----------------------------------------------------------------------------
|
2011-07-01 22:30:18 +04:00
|
|
|
store_4_digits:
|
|
|
|
pusha
|
|
|
|
mov ebx,ecx
|
|
|
|
mov ecx,4
|
|
|
|
mov edi,[store_text_area_end]
|
|
|
|
call binary_to_hex_string
|
|
|
|
add [store_text_area_end],dword 6
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
;-----------------------------------------------------------------------------
|
2011-06-26 04:03:00 +04:00
|
|
|
; ebx - value
|
|
|
|
; ecx - digits
|
|
|
|
; edi - output string
|
|
|
|
binary_to_hex_string:
|
|
|
|
add edi,ecx
|
|
|
|
dec edi
|
|
|
|
std
|
|
|
|
.1:
|
|
|
|
mov al,bl
|
|
|
|
and al,0xf
|
|
|
|
shr ebx,4
|
|
|
|
cmp al,9
|
|
|
|
jbe @f
|
|
|
|
|
|
|
|
add al,0x27
|
|
|
|
@@:
|
|
|
|
add al,0x30
|
|
|
|
stosb
|
|
|
|
dec ecx
|
|
|
|
jnz .1
|
|
|
|
cld
|
|
|
|
ret
|
|
|
|
;-----------------------------------------------------------------------------
|
2010-12-27 15:29:39 +03:00
|
|
|
include 'vendors.inc'
|
2011-06-26 04:03:00 +04:00
|
|
|
;-----------------------------------------------------------------------------
|
2006-08-18 18:32:11 +04:00
|
|
|
; DATA AREA
|
2007-05-04 18:44:43 +04:00
|
|
|
DATA
|
2006-08-18 18:32:11 +04:00
|
|
|
|
2007-05-04 18:44:43 +04:00
|
|
|
Form: dw 800 ; window width (no more, special for 800x600)
|
|
|
|
dw 100 ; window x start
|
2010-01-04 03:28:31 +03:00
|
|
|
dw 620 ; window height
|
|
|
|
dw 20 ; window y start
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2011-06-27 21:26:42 +04:00
|
|
|
title db 'PCI Device Enumerator v 2.3', 0
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2013-06-09 16:28:30 +04:00
|
|
|
if lang eq it
|
|
|
|
PCIWin mls \
|
|
|
|
' Don`t forget to enable PCI Access to Applications in Setup Menu.',\
|
|
|
|
'',\
|
|
|
|
'Versione PCI = x.xx; Ultimo Bus PCI = x',\
|
|
|
|
'User MMIO channel = 0F.F:F ',\
|
|
|
|
'Numbero di unità PCI = ',\
|
|
|
|
'',\
|
|
|
|
'VenID DevID Bus# Dev# Fnc Rev Class Subclass/ IRQ Compania Descrizzione',\
|
|
|
|
' Interfaccia',\
|
|
|
|
'----- ----- ---- ---- --- --- ----- --------- --- ------------------------------------------ --------------------------------'
|
|
|
|
|
|
|
|
bar_ram db 'BARx: MMIO block', 0
|
|
|
|
bar_io db 'BARx: porte IO',0
|
|
|
|
bar_um db 'BARx: unmapped',0
|
|
|
|
bar_rom db 'BAR6: Expansion ROM', 0
|
|
|
|
|
|
|
|
text_save_button:
|
|
|
|
db 'Salva lista PCI',0
|
|
|
|
.1: db '(Premere S)',0
|
|
|
|
else
|
2007-05-04 18:44:43 +04:00
|
|
|
PCIWin mls \
|
2010-01-02 18:10:39 +03:00
|
|
|
' Don`t forget to enable PCI Access to Applications in Setup Menu.',\
|
2007-05-04 18:44:43 +04:00
|
|
|
'',\
|
2010-01-02 18:10:39 +03:00
|
|
|
'PCI Version = x.xx; Last PCI Bus = x',\
|
|
|
|
'User MMIO channel = 0F.F:F ',\
|
2011-07-02 01:54:21 +04:00
|
|
|
'Number of PCI units = ',\
|
2007-05-04 18:44:43 +04:00
|
|
|
'',\
|
|
|
|
'VenID DevID Bus# Dev# Fnc Rev Class Subclass/ IRQ Company Description',\
|
|
|
|
' Interface',\
|
2011-06-26 04:03:00 +04:00
|
|
|
'----- ----- ---- ---- --- --- ----- --------- --- ------------------------------------------ --------------------------------'
|
2006-11-02 17:18:23 +03:00
|
|
|
|
2010-01-02 18:10:39 +03:00
|
|
|
bar_ram db 'BARx: MMIO block', 0
|
|
|
|
bar_io db 'BARx: IO ports',0
|
|
|
|
bar_um db 'BARx: unmapped',0
|
2010-01-04 03:28:31 +03:00
|
|
|
bar_rom db 'BAR6: Expansion ROM', 0
|
2010-01-02 18:10:39 +03:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
text_save_button:
|
|
|
|
db 'Save PCI list',0
|
|
|
|
.1: db '(Press S key)',0
|
2013-06-09 16:28:30 +04:00
|
|
|
end if
|
2011-07-01 22:30:18 +04:00
|
|
|
|
|
|
|
text_NA:
|
2011-07-02 01:54:21 +04:00
|
|
|
db '--',0
|
2011-06-26 04:03:00 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
|
|
|
|
|
|
|
err_message_found_lib2 db 'proc_lib.obj - Not found!',0
|
|
|
|
|
|
|
|
err_message_import2 db 'proc_lib.obj - Wrong import!',0
|
|
|
|
|
|
|
|
head_f_i:
|
|
|
|
head_f_l db 'error',0
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
l_libs_start:
|
2007-05-04 18:44:43 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
library02 l_libs system_dir_ProcLib+9, path, library_path, system_dir_ProcLib, \
|
|
|
|
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
|
|
|
|
|
|
|
|
end_l_libs:
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
ProcLib_import:
|
|
|
|
OpenDialog_Init dd aOpenDialog_Init
|
|
|
|
OpenDialog_Start dd aOpenDialog_Start
|
|
|
|
;OpenDialog__Version dd aOpenDialog_Version
|
|
|
|
dd 0
|
|
|
|
dd 0
|
|
|
|
aOpenDialog_Init db 'OpenDialog_init',0
|
|
|
|
aOpenDialog_Start db 'OpenDialog_start',0
|
|
|
|
;aOpenDialog_Version db 'Version_OpenDialog',0
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
OpenDialog_data:
|
|
|
|
.type dd 0
|
|
|
|
.procinfo dd Proc_Info ;+4
|
|
|
|
.com_area_name dd communication_area_name ;+8
|
|
|
|
.com_area dd 0 ;+12
|
|
|
|
.opendir_pach dd temp_dir_pach ;+16
|
|
|
|
.dir_default_pach dd communication_area_default_pach ;+20
|
|
|
|
.start_path dd open_dialog_path ;+24
|
|
|
|
.draw_window dd draw_window ;+28
|
|
|
|
.status dd 0 ;+32
|
|
|
|
.openfile_pach dd file_name ;+36
|
|
|
|
.filename_area dd filename_area ;+40
|
|
|
|
.filter_area dd Filter
|
|
|
|
.x:
|
|
|
|
.x_size dw 420 ;+48 ; Window X size
|
|
|
|
.x_start dw 10 ;+50 ; Window X position
|
|
|
|
.y:
|
|
|
|
.y_size dw 320 ;+52 ; Window y size
|
|
|
|
.y_start dw 10 ;+54 ; Window Y position
|
|
|
|
|
|
|
|
communication_area_name:
|
|
|
|
db 'FFFFFFFF_open_dialog',0
|
|
|
|
open_dialog_path:
|
|
|
|
db '/sys/File Managers/opendial',0
|
|
|
|
communication_area_default_pach:
|
|
|
|
db '/sys',0
|
|
|
|
Filter:
|
|
|
|
dd Filter.end - Filter.1
|
|
|
|
.1:
|
|
|
|
db 'TXT',0
|
|
|
|
db 'LOG',0
|
|
|
|
.end:
|
|
|
|
dd 0
|
|
|
|
|
|
|
|
file_default_path:
|
|
|
|
db '/sys/'
|
2013-06-09 16:28:30 +04:00
|
|
|
start_temp_file_name:
|
2011-06-26 04:03:00 +04:00
|
|
|
db 'pcidev.txt',0
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
fileinfo:
|
|
|
|
.subfunction dd 2
|
|
|
|
.Offset dd 0
|
|
|
|
.Offset_1 dd 0
|
|
|
|
.size dd 4096
|
|
|
|
.return dd 0
|
|
|
|
db 0
|
|
|
|
.name: dd file_name
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
; UNINITIALIZED DATA AREA
|
|
|
|
IM_END:
|
2007-05-04 18:44:43 +04:00
|
|
|
total db ?
|
|
|
|
V_Bus db ?
|
|
|
|
V_Dev db ?
|
|
|
|
PCI_Version dw ?
|
|
|
|
PCI_LastBus db ?
|
|
|
|
PCI_Device dw ?
|
|
|
|
PCI_Vendor dw ?
|
2010-01-02 18:10:39 +03:00
|
|
|
PCI_Bus db ?
|
|
|
|
PCI_Dev db ?
|
|
|
|
PCI_Rev db ?
|
2007-05-04 18:44:43 +04:00
|
|
|
; don`t change order!!!
|
|
|
|
PCI_Class db ?
|
|
|
|
PCI_SubClass db ?
|
|
|
|
PCI_Interface db ?
|
2010-01-02 18:10:39 +03:00
|
|
|
PCI_IRQ db ?
|
|
|
|
|
|
|
|
align 4
|
2010-02-03 14:22:32 +03:00
|
|
|
MMIO_Bus db 255
|
|
|
|
MMIO_Dev db 255
|
2010-01-02 18:10:39 +03:00
|
|
|
MMIO_BAR db 0
|
2010-02-03 14:22:32 +03:00
|
|
|
MMIO_allowed db 1
|
2010-01-02 18:10:39 +03:00
|
|
|
MMIO_Map rd 8
|
|
|
|
|
|
|
|
gr_pos dd ?
|
2007-05-04 18:44:43 +04:00
|
|
|
|
2011-06-26 04:03:00 +04:00
|
|
|
store_text_area_start dd ?
|
|
|
|
store_text_area_end dd ?
|
|
|
|
store_text_size dd ?
|
|
|
|
|
|
|
|
extended_key rb 1
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
library_path:
|
|
|
|
rb 4096
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
path:
|
|
|
|
rb 4096
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
temp_dir_pach:
|
|
|
|
rb 4096
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
file_name:
|
|
|
|
rb 4096
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
file_name_1:
|
|
|
|
rb 4096
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
filename_area:
|
|
|
|
rb 256
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
rb 4096
|
|
|
|
stacktop:
|
|
|
|
;---------------------------------------------------------------------
|
2007-05-04 18:44:43 +04:00
|
|
|
Proc_Info process_information
|
2011-06-26 04:03:00 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
I_END:
|
|
|
|
;-----------------------------------------------------------------------------
|