Announcement

Collapse
No announcement yet.

Kernel Recompiling

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Kernel Recompiling

    I know this has got to be a repeat post but I can't find resources for kubuntu 8.10 on kernel compiling. Learning to work with kubuntu coming from gentoo and slackware. Have not gotten used to not having everything for building pre-installed yet lol.

    What i need to do is recompile the kernel that i'm already using with a couple of minor changes so i can enable dma on my hard drive. Running version vmlinuz-2.6.27-9-generic and just need to move the general ide/sata drivers to modules and my main drivers to built in to do this. Currently running without dma enabled.

    How do I get the source and what do I need to install to compile it? Once I have that I can do the rest.

    #2
    Re: Kernel Recompiling

    Slightly dated, but: How To Compile A Kernel - The Ubuntu Way
    And for the kernel sources:
    The Linux Kernel Archives
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: Kernel Recompiling

      You might want to install hdparm and check whether dma is already enabled, before you go kernel-compiling.

      Comment


        #4
        Re: Kernel Recompiling

        hdparm was installed by default.. no dice till kernel modification.

        Comment


          #5
          Re: Kernel Recompiling

          Stock kernel supports max dma speed on my rig:
          Code:
          dibl@ibex:~$ sudo hdparm -i /dev/sdb
          [sudo] password for dibl:
          
          /dev/sdb:
          
           Model=WDC WD1500ADFD-00NLR1         , FwRev=20.07P20, SerialNo=  WD-WMAP41142727
           Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
           RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=48
           BuffType=DualPortCache, BuffSize=16384kB, MaxMultSect=16, MultSect=?16?
           CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=293046768
           IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
           PIO modes: pio0 pio1 pio2 pio3 pio4
           DMA modes: mdma0 mdma1 mdma2
           UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
           AdvancedPM=no WriteCache=enabled
           Drive conforms to: ATA/ATAPI-7 published, ANSI INCITS 397-2005: ATA/ATAPI-1,2,3,4,5,6,7
          
           * signifies the current active mode

          Code:
          dibl@ibex:~$ uname -a
          Linux ibex 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:06 UTC 2008 x86_64 GNU/Linux

          Comment


            #6
            Re: Kernel Recompiling

            try hdparm -d1 (drive) to see if dma was enabled on the drive.

            hdparm -i gives :

            Model=WDC WD2000JS-60NCB1 , FwRev=10.02E02, SerialNo= WD-WCANL2066908
            Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
            RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50
            BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=?1?
            CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=390721968
            IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
            PIO modes: pio0 pio3 pio4
            DMA modes: mdma0 mdma1 mdma2
            UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
            AdvancedPM=no WriteCache=enabled
            Drive conforms to: Unspecified: ATA/ATAPI-1,2,3,4,5,6,7

            * signifies the current active mode

            But... the kernel builders had the built in modules loading in the wrong order so you get :

            hdparm -d1 /dev/sda :

            /dev/sda:
            setting using_dma to 1 (on)
            HDIO_SET_DMA failed: Inappropriate ioctl for device
            HDIO_GET_DMA failed: Inappropriate ioctl for device


            So even though the drive is using udma5... dma is not set on the drive. So at least with the 'sata_nv' and 'nv' drivers, you have to manually compile the generic ide and sata drivers as 'modules' and the nv drivers as 'built' in so the nv drivers load first. Otherwise my video and audio run a little funny, erratic and irregular pauses in video and audio in movies and music. Done this a few times.. it works i promise .


            Before recompiling the kernel hdparm :

            hdparm -tT /dev/sda

            /dev/sda:
            Timing cached reads: 2332 MB in 2.00 seconds = 1166.49 MB/sec


            And after

            /dev/sda:
            Timing cached reads: 5527 MB in 2.00 seconds = 2763.5 MB/sec

            K now slimming down the new KDE . Thanks for the links.



            Comment


              #7
              Re: Kernel Recompiling

              That's interesting! Having never been a student of DMA and Ultra DMA, but knowing enough to use Google for "dma vs udma", "udma libata", I made a quick study here and here.

              These are important (from the second article):

              Why does HDIO_SET_DMA fail? I want to use DMA!
              Why does HDIO_SET_UNMASKINTR fail?

              libata intentionally does not support all the HDIO_xxx ioctls that were supported by the older IDE driver. It is now preferred to use SG_IO as a generalized ATA command submission method, rather than creating a myriad of ioctls for each specific purpose.

              The design decision was made only to support the HDIO_xxx ioctls that were heavily used by other programs. Generally the driver always programs the hardware to its maximum capability automatically, completely without user intervention. Therefore, for example, HDIO_SET_DMA is not needed for the vast majority of users because DMA is automatically enabled and used where available.
              and

              Linux NCQ (SATA native command queueing) support is enabled automatically, if your SATA drive supports it. At boot, you will see a line in dmesg (or kernel log) like

              ata2.00: ATA-7, max UDMA/133, 321672960 sectors: LBA48 NCQ (depth 31/32)
              So, I learned it depends a lot on your motherboard and hard disk drive. On mine (Intel D975XBX, Western Digital WD1500s), dmesg shows this:

              ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
              ata2.00: ATA-7: WDC WD1500ADFD-00NLR1, 20.07P20, max UDMA/133
              ata2.00: 293046768 sectors, multi 16: LBA48 NCQ (depth 31/32)
              ata2.00: configured for UDMA/133
              So, the stock kernel with libata driver gives me this, for that drive:
              dibl@ibex:/home/dibl$ sudo hdparm -tT /dev/sdb

              /dev/sdb:
              Timing cached reads: 7574 MB in 2.00 seconds = 3789.49 MB/sec
              Timing buffered disk reads: 244 MB in 3.01 seconds = 81.00 MB/sec
              Which is not exactly 100MB/sec as per the marketing claim, but it's close enough for practical purposes.


              Comment


                #8
                Re: Kernel Recompiling

                LoL.. Booted to the old kernel and here is relevant dmesg:

                [ 3.882448] ata6: SATA max UDMA/133 cmd 0x960 ctl 0xb60 bmdma 0xc008 irq 23
                [ 4.676014] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
                [ 4.684093] ata6.00: ATA-7: WDC WD2000JS-60NCB1, 10.02E02, max UDMA/100
                [ 4.684095] ata6.00: 390721968 sectors, multi 1: LBA48 NCQ (depth 0/32)
                [ 4.692093] ata6.00: configured for UDMA/100

                Note multi 1, depth 0, 16 bit I/O instead of 32. Obviously with these setting no wonder why I'm loosing performance. Guess I have one of those odd chipsets thanks for the links.

                Comment

                Working...
                X