Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Jan 2009 21:01:10 +0100
From:      Christoph Mallon <christoph.mallon@gmx.de>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        current@freebsd.org
Subject:   Re: RFC: new utility, kmodpatch
Message-ID:  <495D2106.2090403@gmx.de>
In-Reply-To: <20090101183026.GA15385@onelab2.iet.unipi.it>
References:  <20090101183026.GA15385@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040209030708000900040003
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Luigi Rizzo schrieb:
> In a nutshell, the kmodpatch utility can print or alter the content
> of device/quirk tables in kernel modules (I think Linux has some
> similar tool, though i don't remember the name -- or perhaps it is
> a feature of insmod ?).

This looks useful for experimentation.

> Feedback welcome.

Attached is a slightly cleaned up version of your tool. I style(9)ified 
it a bit, added const and static, removed unused stuff (asm("jmp 
foo")?), added error checks in some places, which were missing, and 
ensured that the table read in from file is NUL-terminated. I also 
marked one place with XXX, where I think there is an off-by-one error.

> DESCRIPTION
> [...]
>      A couple of real life examples:
> 
>      kmodpatch umass.ko - @0 0x4050 0x4a5 0x0101 0x4200
>          set the kernel to use flags UMASS_PROTO_SCSI | UMASS_PROTO_BBB and
>          quirks WRONG_CSWSIG | NO_SYNCHRONIZE_CACHE for a certain GSM phone
>          that implements the umass interface;
> 
>      kmodpatch uscanner.ko - @0 0x04b8 0x084a 0
>          let uscanner.ko recognise a newly introduced MFP scanner device.

I think, this should be moved into the EXAMPLES section.


Regards
	Christoph


PS: Hopefully you haven't forgotten my patch.

--------------040209030708000900040003--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?495D2106.2090403>