Print some errors to the debug board when it all goes wrong.

git-svn-id: svn://kolibrios.org@6716 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2016-11-15 20:29:47 +00:00
parent 7b008eb65c
commit 4fcfa2351b

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2010-2014. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2010-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; netcfg.asm - Network driver control center for KolibriOS ;; ;; netcfg.asm - Network driver control center for KolibriOS ;;
@ -14,6 +14,9 @@
format binary as "" format binary as ""
__DEBUG__ = 1
__DEBUG_LEVEL__ = 1
use32 use32
org 0x0 org 0x0
@ -25,9 +28,8 @@ use32
dd (I_END+0x100) ; esp dd (I_END+0x100) ; esp
dd param, 0x0 ; I_Param , I_Icon dd param, 0x0 ; I_Param , I_Icon
type_ethernet equ 1
include '../../macros.inc' include '../../macros.inc'
include '../../debug-fdo.inc'
START: START:
; first, check boot parameters ; first, check boot parameters
@ -304,12 +306,12 @@ load_and_start:
call get_drv_ptr call get_drv_ptr
cmp eax, lbl_none cmp eax, lbl_none
je .next je .notsupp
mov ecx, eax mov ecx, eax
mcall 68, 16 mcall 68, 16
test eax, eax test eax, eax
jz .next jz .fail
mov [IOCTL.handle], eax mov [IOCTL.handle], eax
mov al, [V_Dev] mov al, [V_Dev]
@ -325,11 +327,19 @@ load_and_start:
mcall 68, 17, IOCTL mcall 68, 17, IOCTL
.next: .next:
cmp byte[param], 'A' cmp byte[param], 'A'
je Start_Enum.nextDev je Start_Enum.nextDev
jmp exit jmp exit
.fail:
DEBUGF 1,"Could not load network driver %s\n", ecx
jmp .next
.notsupp:
DEBUGF 1,"Unsupported PCI network card detected: 0x%x:0x%x\n", [PCI_Vendor]:4, [PCI_Device]:4
jmp .next
;------------------------------------------------------------------ ;------------------------------------------------------------------
@ -458,38 +468,32 @@ get_drv_ptr:
mov ebx, driverlist ; ebx is the current pointer mov ebx, driverlist ; ebx is the current pointer
mov ecx, dword[PCI_Vendor] ; the device/vendor id of we want to find mov ecx, dword[PCI_Vendor] ; the device/vendor id of we want to find
driverloop: .driverloop:
inc ebx inc ebx
cmp byte[ebx], 0
cmp byte[ebx],0 jne .driverloop
jne driverloop
inc ebx ; the device/vendor id list for the driver eax is pointing to starts here. inc ebx ; the device/vendor id list for the driver eax is pointing to starts here.
deviceloop: .deviceloop:
cmp dword[ebx],0 cmp dword[ebx], 0
je nextdriver je .nextdriver
cmp dword[ebx], ecx
cmp dword[ebx],ecx je .driverfound
je driverfound
add ebx, 4 add ebx, 4
jmp deviceloop jmp .deviceloop
nextdriver: .nextdriver:
add ebx, 4 add ebx, 4
cmp dword[ebx], 0
je .nodriver
mov eax, ebx
jmp .driverloop
cmp dword[ebx],0 .nodriver:
je nodriver
mov eax,ebx
jmp driverloop
nodriver:
mov eax, lbl_none ; lets print the vendor Name mov eax, lbl_none ; lets print the vendor Name
ret ret
driverfound: .driverfound:
ret ret
include 'vendors.inc' include 'vendors.inc'
@ -516,7 +520,9 @@ btn_start db 'Start device',0
btn_reset db 'Reset device',0 btn_reset db 'Reset device',0
btn_stop db 'Stop device',0 btn_stop db 'Stop device',0
lbl_none db 'none',0 lbl_none db 'none',0
load_error db 'Could not load driver!',0 load_error db 'Could not load network driver!',0
include_debug_strings
hardwareinfo: hardwareinfo:
.type db 1 ; pci .type db 1 ; pci