Skip to content

Compiling kext for Intel82566mm under Lion 10.7.2 64-bit

I was recently playing with Intel 82566MM device driver for Mac OS X based on the e1000e open source project and noticed that the driver is really targeted for 10.6 and is unable to compile easily under Lion 10.7.2.

I decided to play a little bit and compile it for Lion 10.7.2 x64 bit. Here it is: modified package which compiles under Lion 10.7.2 x64 with already pre-compiled kext file.

Things mostly changed in Makefile:

1) Added “-arch x86_64 -isysroot ${SYSROOT} -mmacosx-version-min=10.7 -Xlinker -kext”

2) Set proper SDK path and paths for gcc & g++

3) Modified some warnings in Intel82566MM.cpp which end up like errors during build in 10.7.2

Changing background color of iGoogle or Google pages?

I noticed that since the beginning Google is not allowing to change background colour of it’s pages. It is pity, as if you take for example DuckDuckGo you are able to modify the background color easialy: DuckDuckGo Settings page. Moreover, you can easily specify to use always HTTPS, which is not yet the case for Google.

I prefer usually gray colors, as the white color is too bright for my eyes. Background with C4C4C4 seems to be ideal for me, and since I am fun of customization, I guess, I will have to use DuckDuckGo for a while :)

Not Idle Task tool for Linux

Since I am using Debian most of my free time, I decided to re-write Not Idle Task tool for Linux. Voilà:

If you have no idea what the “Not Idle Task” tool does, please consult the following page: http://www.shcherbyna.com/?page_id=1382

This version is tested in Debian 6 x86_64 and Fedora 16 x86_64 and is supposed to work in KDE based distributions. I have some ideas about Windows and Mac OS X support, and I guess I will release versions for these operating systems soon.

This software is GPL, you can find the sources here. You can download binary for x64 version of KDE distributions here.

Have fun!

Happy New Year! (2)

New machine, up-to-date, one week old. Was running happily until BSOD occured :)

BugCheck E0010002, {fffffa800703a000, c, 205, 94e}

Probably caused by : nusb3xhc.sys ( nusb3xhc+14bbc )

Followup: MachineOwner
---------

0: kd> !analyze -v
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

Unknown bugcheck code (e0010002)
Unknown bugcheck description
Arguments:
Arg1: fffffa800703a000
Arg2: 000000000000000c
Arg3: 0000000000000205
Arg4: 000000000000094e

Debugging Details:
------------------

CUSTOMER_CRASH_COUNT:  1

DEFAULT_BUCKET_ID:  VISTA_DRIVER_FAULT

BUGCHECK_STR:  0xE0010002

PROCESS_NAME:  System

CURRENT_IRQL:  0

LAST_CONTROL_TRANSFER:  from fffff880064f1bbc to fffff80002c81c40

STACK_TEXT:
fffff880`035c49f8 fffff880`064f1bbc : 00000000`e0010002 fffffa80`0703a000 00000000`0000000c 00000000`00000205 : nt!KeBugCheckEx
fffff880`035c4a00 00000000`e0010002 : fffffa80`0703a000 00000000`0000000c 00000000`00000205 00000000`0000094e : nusb3xhc+0x14bbc
fffff880`035c4a08 fffffa80`0703a000 : 00000000`0000000c 00000000`00000205 00000000`0000094e 00000000`00000000 : 0xe0010002
fffff880`035c4a10 00000000`0000000c : 00000000`00000205 00000000`0000094e 00000000`00000000 00000000`00000000 : 0xfffffa80`0703a000
fffff880`035c4a18 00000000`00000205 : 00000000`0000094e 00000000`00000000 00000000`00000000 fffff880`064dec19 : 0xc
fffff880`035c4a20 00000000`0000094e : 00000000`00000000 00000000`00000000 fffff880`064dec19 fffffa80`00000205 : 0x205
fffff880`035c4a28 00000000`00000000 : 00000000`00000000 fffff880`064dec19 fffffa80`00000205 fffffa80`0703a000 : 0x94e

STACK_COMMAND:  kb

FOLLOWUP_IP:
nusb3xhc+14bbc
fffff880`064f1bbc ??              ???

SYMBOL_STACK_INDEX:  1

SYMBOL_NAME:  nusb3xhc+14bbc

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: nusb3xhc

IMAGE_NAME:  nusb3xhc.sys

DEBUG_FLR_IMAGE_TIMESTAMP:  4da56d4d

FAILURE_BUCKET_ID:  X64_0xE0010002_nusb3xhc+14bbc

BUCKET_ID:  X64_0xE0010002_nusb3xhc+14bbc

Followup: MachineOwner
---------
0: kd> lmv m nusb*
start             end                 module name
fffff880`064dd000 fffff880`06515000   nusb3xhc T (no symbols)
    Loaded symbol image file: nusb3xhc.sys
    Image path: \SystemRoot\system32\drivers\nusb3xhc.sys
    Image name: nusb3xhc.sys
    Timestamp:        Wed Apr 13 11:30:53 2011 (4DA56D4D)
    CheckSum:         000377C3
    ImageSize:        00038000
    Translations:     0000.04b0 0000.04e4 0409.04b0 0409.04e4

I wonder, why do I attract these things? :) I was even trying to keep this machine out of my drivers to make sure my code does not cause problems )))

Happy New Year!

Time is passing very fast, and the new, 2012 Year has just arrived. I wish you all the best in 2012: achievements of your goals, good health, and a very, very positive attitude to life!

A+

Configuring Hamachi autostart under Debian 6 x86_64

I guess most of you know what VPN is and how it may be useful for you. Among different VPN solutions, Hamachi seems to be the most popular and easy to use for home users. You can easially install it in Windows or Mac and create/join VPN network just in a few clicks. Under Linux, however, things are going less smoothly.

First, it is not open source :( However, you can download binaries for Linux for free: http://files.hamachi.cc/linux/ (x86 version only). If by some reason you cannot download files from Hamachi ftp, you can try my blog file storage.

So, download the file hamachi-0.9.9.9-20-lnx.tar.gz to your machine and untar it. Read readme file and perform the installation:

(do this as sudo)

$ sudo apt-get install ia32-libs
$ sudo make install
$ sudo tuncfg

(do this as regular user)

$ hamachi-init
$ hamachi start
$ hamachi login

Now you have a choice. You can either use Hamachi via command line (check README file) or you can download a GUI tool which replicates the UI of a Windows version: hamachi-gui. Download file hamachi-gui_0.9.5-0_i386-gutsy.deb or hamachi-gui_0.9.5-0_amd64-gutsy.deb depending on architecture of your distribution and install it using dpkg -i command, i.e.:

$sudo dpkg -i hamachi-gui_0.9.5-0_amd64-gutsy.deb

Now search “Hamachi” in your program list in section “Internet”. You can do most of the things you can do in Windows version: create networks, join networks, modify your computer name, etc.

However, if you reboot your computer, Hamachi would not autostart. You will have to manually start it via “hamachi start” each time which is quite uncomfortable :) You can solve this problem by editing your /etc/rc.local file and starting there “tuncfg” as a root and “hamachi start” as a regular user:

/sbin/tuncfg
/bin/su - USERNAME -c "hamachi start"
exit 0

Store this in your /etc/rc.local and make sure you set USERNAME to a name of your user, and after reboot everything will be autostarted properly.

CdRom is not detected in Debian installer

When playing with different linux distributions I am using unetbootin tool to “flash” linux iso file on a USB flash drive, so I can boot from USB flash drive and avoid burning real CD or DVD disk.

This way it is cheaper & faster. However, recently I noticed that the latest Debian isos (6.0.3) are not working properly with unetbootin: during installation the installer complains that it cannot detect CdRom. And so it fails.

However, there is a workaround. Once installer complains about absence of CdRom, it shows you a screen of options where you can select “Execute shell” option. You can pick-up this options and perform the actual mount in shell window:

 # mount -t vfat /dev/sdb /cdrom

In this particular scenario /dev/sdb is my flash drive which is “flashed” with debian-6.0.3-amd64-CD-1.iso. The device /dev/sdb may be different for you, so pay attention to this.

After you successfully mounted /dev/sdb to /cdrom hit exit and retry again the “Detect CdRom task” in installer. It should work this time. So, do everything as usual – configure disk layout, specify passwords for root and users, etc and let it go.

For me it went well and installed base system, however it failed at “configuration of packages” task. Trying to re-mount disk did not help, so I choose to install GRUB and let the installer finish the job without actually installing the rest packages.

In the end installer asks you to reboot, and when you reboot you see a fancy command line prompt and absolutely no indication of kde or gnome desktop. Well, this is fixable :)

At this point, once you have base system, you can just configure apt to point to regional servers and install the require packages from command line. This way it is more fun :)

So, the file of interest is /etc/apt/sources.list – it tells apt where to get packages from. Because your installer did not work properly, most likely the sources.list file will just contain a reference to CdRom, which is not what we want.

You can generate a default debian sources.list file for your regional servers using http://debgen.simplylinux.ch/. Follow the form and specify the following details:

1. Select your country (for me it is Ukraine)

2. Select your release (for me it is squeeze stable)

3. Debian Branches (I use only main, i.e., free packages only)

4. Debian Updates (select all items)

Click “Generate list” button and it will generate your list which looks like this for me:

#############################################################
################### OFFICIAL DEBIAN REPOS ###################
#############################################################

###### Debian Main Repos
deb http://ftp.ua.debian.org/debian/ squeeze main
deb-src http://ftp.ua.debian.org/debian/ squeeze main 

###### Debian Update Repos
deb http://security.debian.org/ squeeze/updates main
deb http://ftp.ua.debian.org/debian/ squeeze-proposed-updates main
deb-src http://security.debian.org/ squeeze/updates main
deb-src http://ftp.ua.debian.org/debian/ squeeze-proposed-updates main

Now, store this data in /etc/apt/sources.list file and perform the apt-get update in shell:

sudo apt-get update

Now you your apt knows where to get packages from and it’s time to install kde desktop:

sudo aptitude install kde-desktop

It will take a while to download packages and install them. After everything is finished, reboot machine and login to your KDE :)

Disabling “kexec” kernel reboot in Debian

Have you noticed that by default Debian actually does not reboot machine when you try to reboot? Instead it uses kexec to “restart” the kernel.

This is not very useful sometimes, because in some cases if you have multiple operating system installed, and you need to boot one of these, you’d prefer actual reboot really to happen so you can select target OS from grub menu. In order to make this, you need to uninstall kexec-tools package:

sudo apt-get remove kexec-tools

After uninstallation of kexec-tools your reboots will actually become reboots.

Mac OS X vs Windows kernel development

I always thought that Mac OS is something poorly documented and developing kernel modules under “Mac” will be hard & complex. Until I actually tried it. It turns out, many things under Mac are actually more simple than under Windows.

Just to give you some thoughts:

On Mac OS X:

1. If you are going to write kernel module for Mac you are free to use standrad IDE called xCode to develop & compile code.

On Windows:

1. You have to download DDK or WDK and use command line tools to develop kernel driver. You can trick Visual Studio to use ddkbuild.bat, but this is unsupported way. Good luck making IntelliSense to work. It took Microsoft quite some time to make WDK for Windows 8 to be integrated in Visual Studio.

On Mac OS X:

2. You have nice documentation to start from for newbies, samples and explanations.

On Windows:

2. You have some documentation and samples dir in WDK dir, however, this is rather “see and figure out how it works on your own” approach. It is just different.

On Mac OS X:

3. If you are confused about some piece of functionality, you are free to see how it is implemented in BSD kernel or pick-up any module from http://opensource.apple.com/ and see how it is done.

On Windows:

3. If you have some questions and you cannot find any replies, feel free to take Ida Pro and go start disassembling binaries. Takes more time, and is not a very pleasant process.

Among things which annoy me is, of course, legal restriction not to use Mac OS X in virtual machines (VmWare, VirtualBox), thus making the driver debugging only on physical machine. I used to have dozens of Windows vms with dozens of snapshots ready to be restored and debugged via WinDbg.

In general, from developers point of view, it seems like Apple has invested a lot into usability of documentation, samples and even code writing to make it nice & easy to use. Well done.

Buying Russian watches from www.vostok-inc.com

I have always been dreaming about owning “Vostok” watches when I was a kid. Back in those days, Soviet Union was still alive, and finding Vostok “Komandirskie” or “Amfibiya” was quite hard :) Now, when everyone has swiss or japanease quartz watches, owning a pair of Russian/Soviet made mechanical watches might be not a bad idea.

So, I started to search and I finally came up with the website of a Vostok factory: www.vostok-inc.com situated in Russia. Contacted them via “Contact” page asking if they ship outside Russian, and voila:

Two weeks later I finally got my watches delivered at home. I am very happy with their services as they suggested multiple options to pay for the watches including paying by Visa via 2Checkout.com. They sent the watches and gave me the post tracking number which allowed me to trace the package in Russia untill it reaches Moscow (takes 6 days) and then I used my country post web site to trace it till it came to my doors.

I recommend using www.vostok-inc.com for purchasing watches as you can buy there watches directly from factory, thus it is cheaper and more secure.

P.S. If you wish to see high resolution pictures, feel free to click on this links: image 1, image 2, image 3.