nxfury

Musings of a *Nix Nerd

Once upon a gloomy day, an innocent programmer (innocent? yeah, right...) stared at his Linux terminal in dismay only to find that the wifi card he installed wasn't supported, and he threw out the old one. This tale of woe documents my actual misadventures with the Linux kernel back in the days of Linux Kernel version 2.6 or so in 2004.

Tell-tale signs

I remember getting my old 2007 Dell XPS right when it came out from a third party seller and how he swapped the included WiFi card with one that was absolutely horrible for the time. Since a replacement card was cheap, I invested in a replacement card for the laptop, which was a Broadcom card.

After a bit of waiting and checking the mailbox constantly, it had arrived and I excitedly popped open the laptop and inserted the card... And threw out the old one- welcome to hell...

I booted my Ubuntu installation, complete with wobbly windows, and fired up bash and excitedly ran ping google.com. The happy smile quickly turned to an analytical frown, wondering why this could be. Running ifconfig didn't list the new wlan card either...

Google-Fu

Since I knew this was a Broadcom WiFi card, I plugged into Ethernet (which thankfully worked) and began a massive googling spree. After a couple hours of searching for “Broadcom Wifi not working Linux”, “Linux Broadcom support”, and so on it was discovered that I needed to utilize a package called ndiswrapper, which effectively allows the loading of Windows XP firmware for wireless card to be loaded under Linux through a wrapper.

NDISWrapper Hell

Excited that there was a solution, I downloaded the firmware for Windows XP and installed the ndiswrapper package. After adding blacklist bcm43xx blacklist b43 blacklist b43legacy blacklist ssb to /etc/modprobe.d/blacklist.conf, I was ready to install the driver. I installed the driver in a Windows XP virtual machine and obtained the .INF file that corresponded to the broadcom card. From there, I believed it to be a simple sudo ndiswrapper -i broadcom.inf to install the driver.

But lo and behold, the driver wasn't written for my CPU Architecture, and the installation failed every single time! Out of desperation, I even experimented with QEMU to see if I could just emulate the driver, to no avail.

After 3 days of banging my head against a desk, rebooting, restoring from a backup and more, I gave up entirely on NDISWrapper and turned back to Google.

The Discovery

After a couple more hours of Google-Fu, I stumbled upon a discovery- A developer was working on a patchset for the same WiFi card I had, and these changes weren't in the kernel! For those who are unaware, patchsets are groups of .patch files you can run the patch command on, to modify source code to look like what the developer made. Excitedly, I downloaded this and a fresh copy of the Linux Kernel source code.

Kernel Games

With everything downloaded, extracted the Linux kernel source code and cd'ed into it. Following this, I ran patch < 1.patch over and over again, but changing the name of the path of patch until I had applied the entire set. Then I executed cp /boot/config-uname -r.config to copy the stock Ubuntu kernel config to the .config file required for compiling a new kernel. After this, it was just a matter of running make menuconfig to customize the kernel and enable the Broadcom driver. After saving and exiting, it was time to compile the kernel.

After running make deb-pkg LOCALVERSION=-broadcom I sat and waited... For 18 hours. After waking up the next day, I noticed compilation completed. As expected according to the Debian manual, the .deb files were one directory up. So after verifying they were there, the kernel was then installed via dpkg and a reboot verified the custom kernel was installed.

It Works, But...

After installing the custom kernel, WiFi was finally working. However, the speed did not increase and the performance wasn't as advertised. This led me to believe it was due to a hardware limitation and I had wasted all this time over a stupid WiFi card...

I later would just install an Ethernet wall jack where I kept my laptop because I wanted the speed at the time, and this laptop would go on to last until 2012, when it gave off magical blue smoke.

Moral of the story: DON'T THROW AWAY GOOD HARDWARE BEFORE YOU TEST!

Read more...

I had an encounter with a friend who had an insatiable craving to talk about his newfound love for this cool new thing called Python. When he claimed that it was the “most popular” and “the best” I had a rough time gathering my thoughts to counter this claim. For those interested in this little rant, this is the point I used to aid in tempering my friends unconditional love for a programming language.

Due to the Python programming language's surge in popularity, people's intense love of the language has also surged. Although this is a blessing for the Open Source community and attracting budding software developers, many of the avid Python programmers (Pythonistas) often claim that it's one of the most popular languages to exist. On top of this, many won't listen to counterclaims about the use of other languages.

What's really the most used?

To tackle this question, one must first define the term popular. For the sake of discussion it is easiest to say that the most widely deployed programming language should be considered the most popular for the simple reason that the enterprise world, the government and many major software companies are still making use of it.

Given this definition, we can safely say that the C Programming language easily is the most popular in this regard, as it is deployed in virtually every Operating System that exists, sees use in most (if not all) of the DNS implementations we use today and more. For those who don't know, DNS provides sites with actual names instead of IP addresses.

Among the most deployed would be JavaScript, as most webpages and many mobile apps utilize it.

According to the definition of popular in this post, this makes COBOL one of the most popular languages, as approximately 90% of the banking system is powered by this old language from the 70s.

COBOL????

Yes. COBOL, I hate it too and I would rather remove my ear with a rusty spoon than code in it. Sadly it's so widely deployed and in so much demand in the enterprise space due to the simple purpose that most of the old Application Programming Interfaces (APIs) for large companies such as banks and car manufacturers were created in the 1980s. Pairing this logic with the fact that it's much more expensive to rewrite these APIs than to just maintain them, COBOL has a permanent place to stay as one of the most popular languages to come.

Remember that as defined above, popular means “most widely deployed” in terms of this discussion. Python definitely outpaces programming languages like LISP or Pascal in terms of popularity, but doesn't quite make the dent that JavaScript, C or COBOL have.

On top of this, due to it's nature of being an interpreted language, it lacks the ability to perform well in environments where every bit of speed matters. As a result, it doesn't appear as much as compiled languages in mission-critical environments.

HOWEVER...

If we define popular as the “most well received” programming language, Python easily lays claim to being one of the most convenient languages to code in and being one of the top languages most programmers choose to learn first nowadays.

On top of this, it's important to note that strides are being made in compiling Python code, though it's not quite stable at the moment. Once this gets achieved, it is possible that it could quickly take over the enterprise space.

The Real Question

How do you change someone's mind about their love of a programming language? You don't- but you can help them clarify their logic more so actual discourse may occur.

That's all. Rant over. Be sure to stick around and bookmark this page for new posts! Next time, I'll share some some (mis)Adventures in building Linux From Scratch and more technical content.

Read more...

Enter your email to subscribe to updates.