Re: Need help trying to patch a driver




On Fri, 2007-11-23 at 12:21 -0500, John Toliver wrote:
-----Original Message-----
From: John Dangler <jdangler@xxxxxxxxxxxxx>
Reply-To: Ubuntu user technical support, not for general discussions
<ubuntu-users@xxxxxxxxxxxxxxxx>
To: Ubuntu user technical support, not for general discussions
<ubuntu-users@xxxxxxxxxxxxxxxx>
Subject: Re: Need help trying to patch a driver
Date: Fri, 23 Nov 2007 11:33:10 -0500

On Fri, 2007-11-23 at 10:49 -0500, John Toliver wrote:
This is the first I am hearing of being able to do this. My T23 has
has
a problem with trackpoint drift for a while and I googled a fix in
the
form of a "driver patch" clicking on the link to me to a document
with
code in it that is all. I know I need to do something with the code
but
I haven't a clue how to "patch" a driver. I have googled the
subject
and all I get are hits on pages of other driver patches available
but
not a howto on how to actually patch your driver.

I'd be interested to see the link.

My question is:

1. is it possible to backup the driver you are going to patch and if
so
how? Is this as simple as a file copy?
Device drivers (I am assuming that this is what you are referring to)
are (usually) a mix of 'C' and Assembler code which provide interface
instructions between the OS and the particular device. They should be
able to be copied.

2. How do you actually patch a driver?
Usually, 'patching' a driver would mean replacing the existing code
with
the updated code, since most people don't write this level of code.
If
the code you found is meant to be inserted into, or a replacement for
certain parts of a particular driver, you'll need the source code for
it
(which is presumably available with the linux source).

3. Once the deed is done, how do you restore it if your system check
out
for a night cap?
Since we're speaking of a relatively minor annoyance here, if the
pointing devices simply go 'south' after the patch is applied and the
system is restarted, going into a text terminal and moving the
original
back should suffice.

Caution: If the device driver is one that is built into the kernel,
this
would mean re-compiling the kernel.

Please correct me if I'm approaching this wrongly.

Thank you in advance.


--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


I'd be interested to see the link
jt- here it is:
http://www.thinkwiki.org/wiki/Patch_to_enable_advanced_trackpoint_configuration#Drift_Correction

The note on this page says -
since 2.6.14-rc5 the patch is included in the mainline kernel
This leads me to believe that this patch is already included in the
currently running kernel.
In Gutsy, my current kernel is _Linux Nebo 2.6.22-14-generic_

Usually, 'patching' a driver would mean replacing the existing code
with
the updated code, since most people don't write this level of code.
If
the code you found is meant to be inserted into, or a replacement for
certain parts of a particular driver, you'll need the source code for
it
(which is presumably available with the linux source).

jt-here is what I think is the assembler and C you are talking
about: http://paste.ubuntu-nl.org/45576/ Now is this source code?
The code looks to be 'C' code (although the code appears to be a header
file for inclusion in a 'C' program.

Caution: If the device driver is one that is built into the kernel,
this
would mean re-compiling the kernel.

jt-how would I determine if the driver I'm using is a part of
the kernel or if it's separate?
Since the code on this page is mentioned as being a part of the kernel,
I would assume it is built-in. If it is a module which is loaded
outside the kernel, there would be a .ko file which would have to be
either loaded at startup via rc, or it would be modprobe+d when you want
to load it.

jt-Does a method (other than speaking assembler or C exist to
determine if
this was malware before I tried to add this to my system?
Not knowing all of the intricacies of what the default Ubu kernel should
or should not interface with, you probably wouldn't know on the surface.
That is a subject left to more knowledgeable minds than mine at the
moment.







--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


Attachment: smime.p7s
Description: S/MIME cryptographic signature

--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


Relevant Pages

  • [PATCH 2.6] Wireless Extension v17 for Linus
    ... WE-17 for kernel 2.6.X. ... The patch already ... included feedback from various driver maintainers, ... * This file define the new driver API for Wireless Extensions ...
    (Linux-Kernel)
  • Re[2]: Where did find_bus() go in 2.6.18?
    ... to query bus set in the kernel was just removed, ... driver here. ... if kernel no longer wants us to enumerate ... So, we won't be posting our 8Mb+ patch just tomorrow, and of course ...
    (Linux-Kernel)
  • Re: broken dpt_i2o in 2.6.23 (was: ext2_check_page: bad entry in directory)
    ... Anders Henke wrote: ... I've manually replaced the dpt_i2o driver by the 2.6.19 one by copying ... kernel; using this kernel fixed the issue for me. ... that the smallest patch actually seams to be the broken one. ...
    (Linux-Kernel)
  • Re: Evaluation of High Precision Event Timer Driver for userland timer facility
    ... I wrote a patch to add following features into acpi_hpet timer driver ... than not, requires kernel privileges. ... Without userland access to the timekeeping hardware, ...
    (freebsd-current)
  • Re: Mirror Driver Architecture
    ... the various VNCs, which do exactly what you are asking, and come with ... we can't use them unless we publish our own source code (this is a commercial ... You are right, of course, any kind of programming in the kernel seems to be ... driver sample code - specifically DrvBitBlt and DrvCopyBits - for sending ...
    (microsoft.public.win32.programmer.kernel)