Recompiling the Kernel for better ATA support

Alejandro Pulver alejandro at varnet.biz
Tue Mar 8 05:34:37 PST 2005


On Mon, 7 Mar 2005 15:00:24 -0800
Benjamin Keating <motionsiren at gmail.com> wrote:

> I'm having a problem with my drives and found a promising solution
> (http://lists.freebsd.org/pipermail/freebsd-hackers/2004-October/0088
> 21.html) It looks like i need to modify
> /usr/src/sys/dev/ata/ata-lowlevel.c with the following, but im unsure
> how to read it. Some pointers about how to understand this would be
> awesome.
> 
> %< --------------------------------------
> 
> --- ata-lowlevel.c.orig Fri Oct 29 12:06:09 2004
> +++ ata-lowlevel.c      Fri Oct 29 12:05:38 2004
> @@ -700,7 +700,7 @@
>      ATA_IDX_OUTB(atadev->channel, ATA_ALTSTAT, ATA_A_4BIT);
> 
>      /* only use 48bit addressing if needed (avoid bugs and overhead)
>      */
> -    if ((lba > 268435455 || count > 256) && atadev->param &&
> +    if ((lba > 268435454 || count > 256) && atadev->param &&
>         atadev->param->support.command2 & ATA_SUPPORT_ADDRESS48) {
> 
> >% --------------------------------------
> 

It is just a patch (a file generated by diff(1) that outputs the
difference between two files, generally the original file, and the
modified file).

It just changes the value "268435455" to "268435454".

For more information see diff(1) and patch(1).

> After modifying this file, do I simply recompile my kernel? Here is
> how i go about recompiling mine (open to suggestions):
> 
> # cd /usr/src/sys/i386/conf
> # cp GENERIC MYKERNEL
> # vi MYKERNEL
> # config MYKERNEL
> # cd /usr/src
> # make buildkernel KERNCONF=MYKERNEL
> # make installkernel KERNCONF=MYKERNEL
> 

You have to patch the file '/usr/src/sys/dev/ata/ata-lowlevel.c' with:

# patch /usr/src/sys/dev/ata/ata-lowlevel.c <patchfile>

And then recompile your kernel.

Personally I use the "traditional" way (procedure 1) for just compiling
the kernel.

> Im new to kernel compiling and never patched files in the source
> before.
> 
> Keep up the good work guys! I love this OS.
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"

Best Regards,
Ale


More information about the freebsd-questions mailing list