From owner-cvs-src@FreeBSD.ORG Sun Aug 1 20:04:31 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5938616A4CE; Sun, 1 Aug 2004 20:04:31 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 49ED243D45; Sun, 1 Aug 2004 20:04:31 +0000 (GMT) (envelope-from wpaul@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i71K4V6r086373; Sun, 1 Aug 2004 20:04:31 GMT (envelope-from wpaul@repoman.freebsd.org) Received: (from wpaul@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i71K4V2o086372; Sun, 1 Aug 2004 20:04:31 GMT (envelope-from wpaul) Message-Id: <200408012004.i71K4V2o086372@repoman.freebsd.org> From: Bill Paul Date: Sun, 1 Aug 2004 20:04:31 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/compat/ndis hal_var.h kern_ndis.c ndis_var.h ntoskrnl_var.h pe_var.h subr_hal.c subr_ndis.c subr_ntoskrnl.c src/usr.sbin/ndiscvt ndiscvt.8 ndiscvt.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Aug 2004 20:04:31 -0000 wpaul 2004-08-01 20:04:31 UTC FreeBSD src repository Modified files: sys/compat/ndis hal_var.h kern_ndis.c ndis_var.h ntoskrnl_var.h pe_var.h subr_hal.c subr_ndis.c subr_ntoskrnl.c usr.sbin/ndiscvt ndiscvt.8 ndiscvt.c Log: Big mess 'o changes: - Give ndiscvt(8) the ability to process a .SYS file directly into a .o file so that we don't have to emit big messy char arrays into the ndis_driver_data.h file. This behavior is currently optional, but may become the default some day. - Give ndiscvt(8) the ability to turn arbitrary files into .ko files so that they can be pre-loaded or kldloaded. (Both this and the previous change involve using objcopy(1)). - Give NdisOpenFile() the ability to 'read' files out of kernel memory that have been kldloaded or pre-loaded, and disallow the use of the normal vn_open() file opening method during bootstrap (when no filesystems have been mounted yet). Some people have reported that kldloading if_ndis.ko works fine when the system is running multiuser but causes a panic when the modile is pre-loaded by /boot/loader. This happens with drivers that need to use NdisOpenFile() to access external files (i.e. firmware images). NdisOpenFile() won't work during kernel bootstrapping because no filesystems have been mounted. To get around this, you can now do the following: o Say you have a firmware file called firmware.img o Do: ndiscvt -f firmware.img -- this creates firmware.img.ko o Put the firmware.img.ko in /boot/kernel o add firmware.img_load="YES" in /boot/loader.conf o add if_ndis_load="YES" and ndis_load="YES" as well Now the loader will suck the additional file into memory as a .ko. The phony .ko has two symbols in it: filename_start and filename_end, which are generated by objcopy(1). ndis_open_file() will traverse each module in the module list looking for these symbols and, if it finds them, it'll use them to generate the file mapping address and length values that the caller of NdisOpenFile() wants. As a bonus, this will even work if the file has been statically linked into the kernel itself, since the "kernel" module is searched too. (ndiscvt(8) will generate both filename.o and filename.ko for you). - Modify the mechanism used to provide make-pretend FASTCALL support. Rather than using inline assembly to yank the first two arguments out of %ecx and %edx, we now use the __regparm__(3) attribute (and the __stdcall__ attribute) and use some macro magic to re-order the arguments and provide dummy arguments as needed so that the arguments passed in registers end up in the right place. Change taken from DragonflyBSD version of the NDISulator. Revision Changes Path 1.4 +4 -4 src/sys/compat/ndis/hal_var.h 1.58 +23 -0 src/sys/compat/ndis/kern_ndis.c 1.28 +5 -0 src/sys/compat/ndis/ndis_var.h 1.16 +2 -2 src/sys/compat/ndis/ntoskrnl_var.h 1.8 +25 -16 src/sys/compat/ndis/pe_var.h 1.13 +9 -24 src/sys/compat/ndis/subr_hal.c 1.63 +130 -9 src/sys/compat/ndis/subr_ndis.c 1.41 +48 -91 src/sys/compat/ndis/subr_ntoskrnl.c 1.5 +121 -1 src/usr.sbin/ndiscvt/ndiscvt.8 1.8 +143 -10 src/usr.sbin/ndiscvt/ndiscvt.c