Compare commits

...
Author SHA1 Message Date
YVishere b878e4e8cc Conditional compile for array helper proc
Build system / Check kernel codestyle (pull_request) Successful in 56s
Build system / Build (pull_request) Successful in 10m8s
2026-03-19 21:12:50 -05:00
YVishere cd73ea0da6 Improved logic flow and code readability based on suggestions
Build system / Check kernel codestyle (pull_request) Successful in 1m21s
Build system / Build (pull_request) Successful in 10m31s
2026-03-19 18:24:42 -05:00
YVishere 3c8782552d Added some documentation on register use
Build system / Build (pull_request) Successful in 17m52s
Build system / Check kernel codestyle (pull_request) Successful in 48s
2026-03-17 23:39:44 -05:00
YVishere 057fef4115 Helper function returns pointer in esi instead of eax
Build system / Check kernel codestyle (pull_request) Successful in 27s
Build system / Build (pull_request) Failing after 3h11m3s
2026-03-17 23:32:53 -05:00
YVishere 30c3ba690c removed sys file added by accident
Build system / Check kernel codestyle (pull_request) Successful in 39s
Build system / Build (pull_request) Successful in 18m3s
2026-03-17 23:11:06 -05:00
YVishere 09c542d28a Modified VirtIO driver detection to identify device
Build system / Check kernel codestyle (pull_request) Successful in 1m31s
Build system / Build (pull_request) Successful in 19m30s
2026-03-17 23:09:15 -05:00
YVishere 09cae90edf Initial library file
Build system / Check kernel codestyle (pull_request) Successful in 1m9s
Build system / Build (pull_request) Successful in 10m5s
2026-03-16 23:37:02 -05:00
YVishere e358772d76 Cleaned up the code and removed unneeded checks and procs
Build system / Check kernel codestyle (pull_request) Successful in 59s
Build system / Build (pull_request) Successful in 9m56s
2026-03-16 18:43:22 -05:00
YVishere 574cbc4f21 Fixed a typo in vendor ID comparison
Build system / Check kernel codestyle (pull_request) Successful in 54s
Build system / Build (pull_request) Successful in 17m32s
2026-03-15 23:35:28 -05:00
YVishere 1481ee0bbc Init VirtIO detection test
Build system / Check kernel codestyle (pull_request) Successful in 1m34s
Build system / Build (pull_request) Successful in 18m31s
2026-03-15 23:31:49 -05:00
3 changed files with 175 additions and 0 deletions

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include 'devices.inc'
VEN_STRIDE = 8
; Returns pointer to the device id stored in data
; clears and returns value in esi
proc PCI_find_dev stdcall ven_id, dev_id
push edx
xor esi, esi
mov esi, ven1_array
cmp [ven_id], VirtVendorID1
jz .next_device_id
mov esi, ven2_array
cmp [ven_id], VirtVendorID2
jnz .not_found ;unknown vendor id
.next_device_id:
mov edx, [esi] ;fewer memory accesses
test edx, edx
jz .not_found ;end of array
add esi, VEN_STRIDE
cmp edx, [dev_id]
jnz .next_device_id
;Found device
sub esi, VEN_STRIDE ;The loop adds it an one time extra
pop edx
ret
.not_found:
pop edx
xor esi, esi
ret
endp
; Follow convention: {id, msg}
align 4
ven1_array dd idDevNetwork,msgDevNetwork
dd idDevBlock,msgDevBlock
dd idDevBalloon,msgDevBallon
dd idDevConsole,msgDevConsole
dd 0,0
ven2_array dd idDevNVME,msgDevNVME
dd 0,0
+27
View File
@@ -0,0 +1,27 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VirtVendorID1 = 0x1af4
VirtVendorID2 = 0x1b36
; Device description strings
align 4
idDevNetwork = 0x1000
idDevBlock = 0x1001
idDevBalloon = 0x1002
idDevConsole = 0x1003
idDevNVME = 0x0010
align 4
msgDevNetwork db "Network",0
msgDevBlock db "Block",0
msgDevBallon db "Balloon",0
msgDevConsole db "Console",0
msgDevNVME db "NVME",0
+87
View File
@@ -0,0 +1,87 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
format PE DLL native 0.05
entry START
DEBUG equ 1
__DEBUG__ equ 1
__DEBUG_LEVEL__ equ 1
section '.flat' code readable writable executable
include '../proc32.inc'
include '../struct.inc'
include '../macros.inc'
include '../peimport.inc'
include '../fdo.inc'
include 'device_table.inc'
proc START c, state:dword, cmdline:dword
cmp [state], 1
jne .exit
.entry:
push esi
mov esi, msgInit
invoke SysMsgBoardStr
call detect
pop esi
.exit:
mov eax, 1
ret
endp
proc detect
push ebx
invoke GetPCIList
mov ebx, eax
.next_dev:
mov eax, [eax+PCIDEV.fd]
cmp eax, ebx
jz .finish
mov esi, msgVirtIO
mov edx, [eax+PCIDEV.vendor_device_id]
mov ecx, edx
shr ecx, 16 ;cx upper half - device id, dx lower half - vendor id
;prepare regs for find dev proc
movzx edx, dx
stdcall PCI_find_dev, edx, ecx
test esi, esi
jz .notVirt
add esi, 4
DEBUGF 1, "I: VirtIO Driver %x:%x -> %s\n", dx, cx, [esi]
.notVirt:
jmp .next_dev
.finish:
xor eax, eax
pop ebx
inc eax
ret
endp
align 4
msgInit db 'I: detecting VirtIO drivers',13,10,0
msgVirtIO db 'VirtIO driver',0
align 4
data fixups
end data
include_debug_strings