Home page of this blog

Tuesday, August 23, 2011

Custom 32 bit ubuntu kernel 3.0.3 optimized for core2 and above

Kernel Configuration

  1. Followed Ubuntu way of building kernel (to know more follow this link)
  2. I disabled kernel debugging in kernel configuration
  3. Changed to use SLAB instead of SLUB
  4. Changed kernel frequency to 300 HZ from 250 HZ
  5. Selected processor as CORE2
  6. Edited main Makefile to append -march=core2 -mtune=core2
  7. Used PAE and highmem64 to support more than 4 GB
  8. Used SPARSE memory instead of FLAT memory model
  9. Edited arch/x86/Makefile_32.cpu and changed i686 to core2 for CORE2 optimization
How to install

Extract the zip file, and enter into the extracted folder in terminal (using open in terminal in nautilus)

sudo dpkg -i *.deb

Screenshot of core2 kernel running in my i7 processor 32 bit ubuntu system

Ubuntu reports more memory (it seems sparse memory means more memory to user rather than kernel)


1a74c1ea4b4ddcb6cd73f298960ce3dbdf4e8b88b9832ed9915e301ebce4f268  BuildKernel3.0.3core2.sh
c94ed3fa2e048bb284af97299ccf6e50ad328e8c89851c3936f44cddade75505  linux-headers-3.0.3-030003_3.0.3-030003.201108180913_all.deb
16f3ade6cf647697049ae11413d039b016188c86d661af5663913195e10e153d  linux-headers-3.0.3-030003-core2_3.0.3-030003.201108180913_i386.deb
5c84925996fe87be9e6391c59894f2367b585e0021ff99aae71fa2762b795784  linux-image-3.0.3-030003-core2_3.0.3-030003.201108180913_i386.deb

Download Link


Custom 32 bit ubuntu kernel 3.0.3 optimized for atom processors or netbook

I did a build of latest 3.0.3 kernel for my netbook running Ubuntu 11.04 (and my friends netbook who runs Linux Mint 11)

What I did to increase speed?
  1. Followed Ubuntu way of building kernel (to know more follow this link)
  2. I disabled kernel debugging in kernel configuration
  3. Changed to use SLAB instead of SLUB
  4. Changed kernel frequency to 300 HZ from 250 HZ
  5. Selected processor as Intel Atom
  6. Edited main Makefile to append -march=atom -mtune=atom
  7. Used PAE and highmem64 to support more than 4 GB
What I did?

I already uploaded the files and shared here.

I restarted and tested it, seems good.

How do I install it ?

Download the three .deb files into a new folder. Enter into the folder and give open in terminal (if you don't have this sudo apt-get install nautilus-open-terminal) and give sudo dpkg -i *.deb

What to do if my driver does not work?

Boot into default Ubuntu kernel

Feeling happy and think it is fast?

Share your happiness (like me :) ). How ? Post your experience in your blog or comment here. Share it.

What now?


Mediafire download links







72ff4f112f59c064512310962b3fa38318fac5b44b609711183f371e468b3d6d  BuildKernel3.0.3atom.sh
79156f9a21e7ffcf91c80a9353de82525ae30b9584b7114aa117033af759e67a  linux-headers-3.0.3-030003_3.0.3-030003.201108180913_all.deb
c5655bfefdff3b29f25a06300d4a9e1cb9bbbc1818f955ded2db9c9cc4a643ce  linux-headers-3.0.3-030003-atom_3.0.3-030003.201108180913_i386.deb
fce58cc31e374dd5035393bcc1472e777b12bb33c30ee52453126fa075b67f44  linux-image-3.0.3-030003-atom_3.0.3-030003.201108180913_i386.deb

Saturday, August 20, 2011

AMD Phenom II optimized 64bit kernel 3.0.3 ubuntu packages for testing

Someone asked in the comments if the i7 optimized kernel will run on AMD phenom six core. i7 optimized will run only on i3, i5 or i7 processors.

Here is a build optimized for amd phenom 2. I dont have amd phenom processor to test. So feel free to test yourself. In case of errors, reboot into Ubuntu default kernel

If it works for you great, post in the comment about your experience

Here is what I did to optimize the amd phenom 2 compilation of kernel

I took the safe cflags from Gentoo Wiki for march settings and built the kernel


From the wiki I understood, amdfam10 or barcelona is used for latest phenom chips (I may be wrong)

The following are the configuration settings

  1. Processor is selected as K8
  2. Makefile and Makefile_32.cpu modified to reflect march settings to barcelona for K8 processor
  3. Configuration of oneiric kernel is taken as base. See the kernel ppa for 3.0.3 here, http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0.3-oneiric
  4. Kernel Timer Frequency is 100 HZ
  1. Changed to use SLAB allocator instead of SLUB (as this seems to give a speed boost in my barcelona processor and SLAB is proven to work everywhere)

How to install

To install go into the directory where the header, header all and linux image deb are downloaded, just give

sudo dpkg -i *.deb

I have provided a Readme.pdf and Readme.odt in the dropbox download link which is in detail for whoever wishes

Dropbox download links

SHA256SUMS as text
56e98c00d05179cc7ad1799df261e405eb1c319283ddd2869c90d17c6fff8a7e  BuildKernel3.0.3.sh
9d3ee43079a1fe0f0d1a1821c9d0705ef86a66d78bd00ccdf1dcb975082d9871  linux-headers-3.0.3-030003_3.0.3-030003.201108180913_all.deb
345fafa7ab1cf0b36e9488d4c8c1684cbf19a751d98fd9597acbf13053516656  linux-headers-3.0.3-030003-barcelona_3.0.3-030003.201108180913_amd64.deb
0d933a931fbe8d151454303d1cf0efdd67f8e5c2f63bb42351edaedce4914242  linux-image-3.0.3-030003-barcelona_3.0.3-030003.201108180913_amd64.deb
adb017be7f2fe285435eceedb88c963bd1c2f94f138b2b3d7789f795e1474d56  Readme.odt
ca0f10413393e9b98f82000031b5e2314f75a0c2acdb557f2e2d784fff9fd7ff  Readme.pdf

Superfast i7 optimized 3.0.3 kernel for 64bit ubuntu 11.04

This kernel is very very fast! atleast for me

To try yourself or install in Ubuntu 11.04 (if you have i7 system as it is optimized with march=native, I edited main Makefile and added march=native and mtune=native), use the following command after downloading

sudo dpkg -i linux-headers-3.0.3-030003_3.0.3-030003.201108180913_all.deb linux-headers-3.0.3-030003-i7_3.0.3-030003.201108180913_amd64.deb linux-image-3.0.3-030003-i7_3.0.3-030003.201108180913_amd64.deb  

To test the new kernel, reboot. If you feel the kernel has problems, reboot into default ubuntu kernel and delete this kernel from synaptic

Download links


136f21e33233eb3b0de05dbb1fe58a302ed55edb716b80bc629d8aef96cabff7  CONFIG-3.0.3-I7
29f0290b6a5b5da952f6d591ed45f4a36649ec04581ca807f48fe170fd1daf00  linux-headers-3.0.3-030003_3.0.3-030003.201108180913_all.deb
cf2b99e3ed3188a2dbce748b812f7f1db8c88ccb97eb3943eeeb0918a1572992  linux-headers-3.0.3-030003-i7_3.0.3-030003.201108180913_amd64.deb
d4c83a30b77e2c581e3900d5b8cbfcb6ebf2ceca7bf448ba978de4b378f44691  linux-image-3.0.3-030003-i7_3.0.3-030003.201108180913_amd64.deb

Saturday, August 13, 2011

Optimizing libc6 package for core2 in Ubuntu/Mint

Disclaimer: The following is only for who would love to take risks. Rebuilding/Resinstalling libc6 may make the system totally unrecoverable. Use the following at your own risk and hence I am not uploading the packages I built optimized for core2

This is how I fetched and built libc6 package optimized for core2. 

Install build dependencies for libc6

sudo apt-get build-dep libc6

Create a directory for building libc (preferably inside /usr/src/)

cd /usr/src/
mkdir -p glibcbuilds
cd glibcbuilds

Get the source package of libc6 from Ubuntu/Debian repository (deb-src should be enabled for getting source packages)

apt-get source libc6

Enter into eglibc folder extracted

cd eglibc-2.13/

Edit debian/rules  and modify CFLAGS

#edit the required cflags like march and mtune
#modify run test suite to no
vi debian/rules

BUILD_CC = gcc-4.5 -fno-stack-protector -U_FORTIFY_SOURCE -march=core2 -mtune=core2
BUILD_CXX = g++-4.5 -fno-stack-protector -U_FORTIFY_SOURCE -march=core2 -mtune=core2


The above are the changed in debian/rules for targeting/optimizing to core2

Enable parallel build

#set 8 for a i7, 4 for a quadcore, 2 for a core2, 1 for others
export DEB_BUILD_OPTIONS="parallel=8"

Clean before building

fakeroot debian/rules clean


time fakeroot dpkg-buildpackage -uc -us

Install the built packages

cd ..

sudo dpkg -i libc6_2.13-0ubuntu13_amd64.deb libc6-dev_2.13-0ubuntu13_amd64.deb libc6-i386_2.13-0ubuntu13_amd64.deb libc6-dev-i386_2.13-0ubuntu13_amd64.deb

Custom 32 bit ubuntu kernel 3.0.1 optimized for atom processors or netbook

I did a build of Kernel 3.0.1 ubuntu way for my netbook. The kernel is 32 bit and optimized for atom processors.

A nice pdf explaining how to install or how to build yourself is here

I installed the kernel in my netbook and broadcom dkms modules worked fine(as the kernel was built the ubuntu way it should build dkms modules)

Here are the screenshots of Kernel 3.0.1 running inside my netbook

Once again, I used Linux Mint 10 running inside virtualbox to build.

Here are the dropbox download links 


Here are the SHA256SUMS

ade0a894882e07fcffda3ba311e1722301c1837e47fd96c24699655b6499e165  config-3.0.1-030001-atom
0af74f8dc06e5163e21b57eddd8beebbabacac399b018a3a3fb52969439e52e2  BuildKernel3.0.1.sh
e96f6f1e21eebd1b129d5da19d13f6166d12e2447b3f7d6537aeaad614fc51ff  linux-headers-3.0.1-030001_3.0.1-030001.201108060905_all.deb
e4492e7e36722e1949629da4aea7e2a96be996d340f6a67a95e293fe56b2c901  linux-headers-3.0.1-030001-atom_3.0.1-030001.201108060905_i386.deb
8815bc101694b2d10cdadf3cc18b8837bfaf72cca86a391b9d726bb2786ba4e6  linux-image-3.0.1-030001-atom_3.0.1-030001.201108060905_i386.deb
c206308a04940da0742c269e5fb6b8b4cb736d20f997a2413a7e9ebe9eb2bc7a  Readme.odt
9a01497bce1a58d0663e4f4e7aa9e317b6724ff8c8036cb8fc23561e768bb659  Readme.pdf

Thursday, August 11, 2011

Custom kernel 3.0.1 ubuntu 64 bit kernel optimized for i3, i5 and i7 processors

For a nice pdf of document of the same click here
Download links are provided at the bottom of this article along with SHA256SUMS

Again thanks to Linux Mint 11, I am enjoying it

I faced the following with earlier kernel builds

  1. Symlink errors while installing kernel debs in another system where the kernel build did not happen and lots of comments in the blog also reported the same
  2. DKMS modules did not work in different systems where the kernel build did not happen
  3. Cross compiling 32 bit kernels from my 64 bit PC was cumbersome

This kernel tries to address the above problems and give a kernel as similar to Ubuntu but with optimization. Towards the end of this document I have explained a step by step way of building the kernel Ubuntu way . Also I have made the same as a shell script which can be rerun again and again to build kernels Ubuntu way

This document is divided into two major sections, the first one is enough info about deb files and the second one is about how to build them

Info about the deb files


This package is created in Linux Mint 11 and should install fine in all versions of Linux Mint 11 (as well Mint 10) and Ubuntu 11.04 (as well 10.10) (should as well in debian squeeze but not sure about dkms).

The build is done with march=core2 and mtune=native

This ensures the build will run on all core2 and above but will run with optimum speed on i3, i5 and i7 processors, so

The build is for 64bit i3,i5 and i7 processors

The following are the configuration settings

  1. Processor is selected as CORE2
  2. Makefile and Makefile_32.cpu modified to reflect march settings to core2 and mtune settings to native (my processor is i7 920)
  3. Configuration of oneiric kernel is taken as base, http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.0.1-oneiric/
  4. Kernel Timer Frequency is 300 HZ

How to install

To install

sudo dpkg -i linux-headers-3.0.1-030001_3.0.1-030001.201108060905_all.deb linux-headers-3.0.1-030001-i7_3.0.1-030001.201108060905_amd64.deb linux-image-3.0.1-030001-i7_3.0.1-030001.201108060905_amd64.deb

After this reboot into the newly installed kernel from grub (use update-initramfs in case of 10.04 or older if it is not building initramfs)

Kernel Source

I downloaded the kernel source tarball from kernel.org

Version: 3.0.1

Ubuntu Oneiric Patches

How to build yourself

This kernel follows Ubuntu way of building kernel and has all ubuntu oneiric patches

The following is a documentation of building it the Ubuntu way, I used my article about Ubuntu Maverick kernel compilation as a base for this, with some modifications. Here is a step by step of the same (and this explains the shell script commands which I created for my own reference)

Install dependencies for building Kernel

Here are the apt-get commands to install the dependencies required for building kernel the Ubuntu way
sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge libncurses5 binutils-dev libelf-dev libdw-dev libnewt-dev libncurses5-dev
sudo apt-get --no-install-recommends install asciidoc xmlto

Get the Kernel source and Ubuntu Patches

Create a directory for the building kernel source

#Enter into Home directory of the user
cd ~

#create a kernel directory if it is not there
mkdir -p kernel3.0.1

#enter into kernel directory
cd kernel3.0.1

The following wget commands is used to fetch the Kernel source and Ubuntu Patches

#get the kernel sources and ubuntu patches
#kernel 3.0.1

#Ubuntu Oneiric Patches from kernel ppa

Create a soft link of extracted kernel folder

#unpack linux kernel 3.0.1
tar xjf linux-3.0.1.tar.bz2

#create a soft link for the kernel directory
ln -s linux-3.0.1 linux

#enter into unpacked directory
cd linux

Install Ubuntu patches we downloaded earlier

#install the ubuntu/debian patches
patch -p1 < ../0001-base-packaging.patch
patch -p1 < ../0002-debian-changelog.patch
patch -p1 < ../0003-default-configs.patch

Create and configure a new kernel flavor, here I create it as i7

After the patches are applied, we come here to create a new flavor

Before this we need to give execute permissions to debian scripts and debian rules

Give execute permissions to debian/rules and debian/scripts

#make debian/rules as executable
chmod -Rv +x debian/rules
#make debian/scripts directory executable
chmod -Rv +x debian/scripts/

Copy existing generic flavor (or use existing flavor to create new flavor, here i7)

#create i7 flavor
cp debian.master/config/amd64/config.flavour.generic debian.master/config/amd64/config.flavour.i7

Configure the newly created flavor i7

fakeroot debian/rules clean
fakeroot debian/rules updateconfigs

When calling editconfigs, say n to avoid editing any other flavor except the created flavor, here i7. When a prompt asks us to edit i7 (or any other flavor you created) give y, this will open menuconfig of the kernel, feel free to change kernel configurations to hearts wish and dont forget to save while exiting the menuconfig screen. This is the place where I gave CORE2 as the processor type and changed kernel timer frequency to 300 HZ (or whichever you prefer)

#give y only to i7 flavor, leave the rest untouched
fakeroot debian/rules editconfigs

Edit debian related abi information for newly created flavor, here i7

#copy the abi entries for i7 flavor and add i7 entries in vars and amd64.mk
cp debian.master/abi/3.0.0-7.9/amd64/generic debian.master/abi/3.0.0-7.9/amd64/i7
cp debian.master/abi/3.0.0-7.9/amd64/generic.modules debian.master/abi/3.0.0-7.9/amd64/i7.modules
sed -i s/getall\ amd64\ generic\ server\ virtual/getall\ amd64\ generic\ server\ virtual\ i7/g debian.master/etc/getabis
sed -i s/\=\ generic\ server\ virtual/\=\ generic\ server\ virtual\ i7/g debian.master/rules.d/amd64.mk
cp debian.master/control.d/vars.generic debian.master/control.d/vars.i7
sed -i s/\"Generic\"/\"core\ i7\"/g debian.master/control.d/vars.i7

Edit architecture dependent Makefiles to finetune gcc flags for compilation

Architecture dependent Makefiles for kernel compilation will reside in arch//Makefile
For x86 architecture, the following are the two Makefiles
arch/x86/Makefile and arch/x86/Makefile_32.cpu

#edit arch/x86/Makefile and arch/x86/Makefile_32.cpu if you want to tweak the march and mtune params of gcc
vi arch/x86/Makefile
vi arch/x86/Makefile_32.cpu

After opening the Makefile search for CORE2 and change march=core2 and mtune=native

In Makefile the following will be the change

cflags-$(CONFIG_MCORE2) += \
                $(call cc-option,-march=core2,$(call cc-option,-mtune=native))

In Makefile_32.cpu the following will be the change

cflags-$(CONFIG_MCORE2) += -march=core2 $(call tune,native)


Clean before building

fakeroot debian/rules clean

Build source and headers debian package which is independent of architecture or flavor, hence indep

#build headers/source deb files
skipabi=true skipmodule=true fakeroot debian/rules binary-indep

Set the CONCURRENCY_LEVEL for concurrent builds which will speed up the kernel compilation tremendously

#set the CONCURRENCY_LEVEL to the number of processor cores in system to do parallel compilation and thus speed up the kernel compilation
#`cat /proc/cpuinfo | grep "cpu cores" | head -1 | cut -d":" -f2 | cut -c2-` is used to get the number of cores
export CONCURRENCY_LEVEL=`cat /proc/cpuinfo | grep "cpu cores" | head -1 | cut -d":" -f2 | cut -c2-`

cat /proc/cpuinfo gives all info about cpu in the system
grepping for “cpu cores” gives multiple lines one fore each core
head -1 takes the first line of output
cut -d”:” -f2 uses : as delimiter and gives the second field, which is the number of cores
cut -c2- skips leading space

export makes this variable exported for the coming lines


Build the flavor

It is nice to time a build, just prefix time command before any other command, here the kernel build command. While calling debian/rules, we are invoking the newly created flavor which is binary-i7 in this case

#build the actual kernel flavor i7 (and time it)
time skipabi=true skipmodule=true fakeroot debian/rules binary-i7

Wait for some time, have a coffee, relax and wait for your system to finish build. My system took 20 minutes to finish the build


Dropbox Download Links



1291a52bbcbb74f6b044171ae10d4efe399cff2a615ac03ff8b4ff2c64983e53  BuildKernel3.0.1.sh
202e4bef97a05f1df4c93fb6821036018f1a4ccd25745eb16f21aca02c8e6be8  config-3.0.1-030001-i7
7ef4a2f7e22335498535e980bfed3afe58999922120ff2ae735970994d1d1318  linux-headers-3.0.1-030001_3.0.1-030001.201108060905_all.deb
05ba8bc60980868ac299a473c832768e4d185b3764e00b9012527578449afc71  linux-headers-3.0.1-030001-i7_3.0.1-030001.201108060905_amd64.deb
48bb53f0e50b6da024f40189bf859d686daad6801b76464829737a69ac93583e  linux-image-3.0.1-030001-i7_3.0.1-030001.201108060905_amd64.deb
f0cd271d2d4413a29b08963a9b9d99ef966513ecf815def2fed2c63a3638eb8b  Readme.odt
e56ef8600f25f99ea6707d87b3a48f793327111d6579031779acc54a8e61ea7c  Readme.pdf

Tuesday, August 9, 2011

On top of the hills

Linux Mint 11

Well nothing much to tweak, whatever needs to be tweaked is already tweaked. It is boring to see when everything is working extremely well and not motivating enough for me to rebuild a new kernel (as this feel extremely fast already).

I thought Linux Mint 11 is same as Ubuntu 11.04, how wrong. Everything is fast, flying with speed

Thanks Linux Mint

Friends comment: green house  effect   is  good, but  so  much greeeeeen 

Sunday, August 7, 2011

Trying Fedora 15

Last week I updated my nvidia drivers in Ubuntu through x swat ppa

I had my root filesystem as btrfs and somehow Ubuntu did not boot into graphical login. I was having lots of work and could not sit to fix it and started using Windows 7. After a week of no Ubuntu I felt handicapped and wanted to restore it.

Today morning I tried removing ppa from command line, reinstall nvidia, tested if it works. Nothing brought back GUI and I wanted linux badly. I had a Fedora 15 iso and used dd to write it (something similar to the following command).

sudo dd if=Fedora-15-x86_64-Live-Desktop.iso of=/dev/sdc bs=4M

After that I booted into Fedora 15. It looked very elegant though it has no right click on desktop.

I got tempted to try it and I distro hopped into Fedora 15. To my amazement Fedora 15 had gcc 4.6

Next surprise to me is Kernel 3.0!!
After doing

sudo yum update

and rebooting I found a new kernel 2.6.40 (there is no kernel 2.6.40 in kernel.org and only kernel 3.0 after 2.6.39). Fedora wanted to maintain compatibility between existing programs and avoid breakups due to version confusion, so it badged kernel 3.0 as 2.6.40, how sweet

Next is I installed kmod-nvidia after adding rpmfusion

After rebooting I can see the full effects of Gnome 3, which looks glorious. When opening new windows they come as if falling from top and looks amazing to eyes. Nvidia got upgraded to 280 series.

Gnome3 and Fedora 15 feels fresh with animations coupled with subtle elegance

Installing Adobe Flash plugin was easy. I downloaded Adobe Flash Player 11 beta from http://download.macromedia.com/pub/labs/flashplatformruntimes/flashplayer11/flashplayer11_b1_install_lin_64_071311.tar.gz

After extracting, I copied the libflashplugin.so into /usr/lib64/mozilla/plugins/ as follows

sudo cp Flashplugin/libflashplayer.so /usr/lib64/mozilla/plugins/

Yes while installing Fedora 15, I ticked the Administrator privileges and it added my user to wheel group, thus enabling me to use sudo

Also package installation requires my own password as I added my user to administrator group

The icons with ON and OFF is a mimic of iOS (iPhone or iPad), see the below screenshot. Also the combo boxes look beautiful

When Activities in top left corner is clicked, active windows are shown with small overlay X button (once again like iOS, in Safari, when we click a tab, it shows all tabs open with a overlay x button). The buttons Windows and Applications used for tabbing reminds me of seeing it somewhere, but can't remember

See below for the overlay x button

See below for multiple windows shown with overlay buttons, similar to multiple tabs shown in iOS safari when clicking tab button

To open more instances of folders or any apps in the tray I used Ctrl + Left mouse click

Hovering mouse over Activities in the top left brings pleasant surprise. Another cool ripple effect which does not look obtrusive and looks very mild and beautiful, see below near the activities to see the mild ripple in action

To add more apps to the tray is easy. Just drag the app to the tray and it is there, see below the tray has Screenshot tool added

Standard gnome3 scrollbars look really elegant


Double clicking the title bar of any window toggles between maximizing and restoring the window size. Another beautiful aspect of gnome3 is its tabs look very attractive unlike the boring rounded rectangles, see the tabs inside nautilus which are different and good

Dragging a window titlebar towards edge works similar to Windows 7. Window just snaps half the screensize

Dragging the titlebar towards the top just snaps it to full size (or just maximizes)

Slider of sound reminded once again of iOS, see the following snapshot (in the top right corner there is a callout overlay window showing volume adjustment slider which looks similar to iOS slider)

To change the desktop background is different in Gnome3. Click the username in top right corner to bring system settings menu item

In system settings, click background and change it

Fedora 15 with a beautiful background

Every line drawn or pixel shown exudes quality in Gnome3. I think the way it renders is for the first time utilizing the capabilities of graphics card.

I am still exploring gnome3, starting to like it