Archive for the ‘English’ Category

Sunday, March 15th, 2009

Gentoo and KDE4

Everyone wanting to upgrade to KDE4 with Gentoo should be adviced not to trust the official guide completely. It’s a good start but incomplete and misleading. You should have a look at it nevertheless:

http://www.gentoo.org/proj/en/desktop/kde/kde4-guide.xml

You should know the following facts before getting yourself into trouble:

  • You need KDE 3.5.10 (unstable) prior to KDE 4 if you plan to use both along each other. Some applications of KDE 3.5.10 will break nevertheless, at least if you install without kdeprefix (see below). You will be blocked otherwise.
  • You don’t need an unstable portage 2.2 for EABI 2. Well, you kind of need it nevertheless. portage 2.1.6.* IS portage 2.2 but with all new features (except EABI 2) disabled. If you have enough time, know Python and want to help the portage developers please do it, you know where you find them. If you run a more experimental system (you are unmasking KDE 4, right?), you could unmask 2.2 nevertheless and help Gentoo by testing and submitting bug reports.
  • You need to unmask lots and lots of packages. You can use this file and NOT the file you get there (both are linked in the KDE4 guide but the last one is for kde-testing overlay only). Unfortunately you will need to unmask even more. You can use unmasker, a nice tiny tool that does all that nasty unmasking stuff for you while you can do better things. Following the comments you will end up with a directory /etc/portage.keywords/ and some files in it. Emerge will use all of them. Have a look at the generated file(s) and modify/comment/delete any lines you don’t like. There will be some (e.g. SVN versions).
  • Before starting that huge 250 ebuild session (twice that size if you need KDE 3.5.10), make sure you have kdeprefix in your USE flags! The guide says it would not be necessary to use it but trust me: it is if you want to save yourself some headaches.
  • Having compiled all ebuilds and noticing random crashes and disfunctionality? Start dbus and hald first – you need them in KDE4 or you get weird problems. (that’s not in the guide either :( )
  • Using unstable xorg 1.5 and have no keyboard anymore? Or are you just wondering why you should use 1.5? See this short thread.
  • You use NVidia drivers and see flickering red or black checkerboards covering your videos? Well, guess you are using Amarok. It took almost a year to find that out. Just exit Amarok or open and close the playlist and control window a few times, the flickering will disappear. BTW that also happened with Compiz Fusion and KDE 3.5.
  • Having stability problems? Make sure you use nvidia-drivers 180.27 or 180.29 for the time being, do NOT use 180.37 for now.
  • Your icons disappeared? Check for the Inherits=hicolor setting to be correct (find the icon set configs and possible options for Inherits using locate index.theme), also check for deprecated icons (folder icons etc.) and switch them. Maybe it also helps to upgrade to QT 4.5 and of course x.org 1.5 if you didn’t do that already; this could also fix some weird stuff going nuts in your system tray. Still missing icons? Bad luck I guess. The Oxygen icon set still seems incomplete and Inherits doesn’t seem to work in all cases, so you may try switching to some other icons instead. (Although this is 4.2, isn’t it? But what did other distributions do to fix it if it’s really incomplete/broken?)

These won’t be the only problems you come across, and I wrote some of them from memory because I upgraded about a month ago. Maybe it’s not sufficient what I wrote but it should save you at least 5 hours of work (or even more) figuring everything out yourself.

Good luck!

Saturday, March 14th, 2009

Stack Overflow

Stack Overflow is a community-driven website where you can ask any programming related questions and answer other people’s questions. Based on a good reputation system you start being restricted to only post questions and answers. By getting “up” votes on your posts you will gain reputation points and more permissions like voting other people’s posts and commenting them. With a rather large amount of reputation points you will even get moderator permissions for the platform.

Registration is quite easy. If you have any account supporting OpenID (such as Yahoo/Flickr) you will be able to login right away. Avatars are being loaded from Gravatar. Before asking questions you should try searching for earlier posts on that topic; one idea behind Stack Overflow is to build a large FAQ of programming questions. I’ve recently got Stack Overflow threads in Google search results as well (and in most cases they immediately solved my problem).

The speed of questions and answers is rather high paced. Many people are monitoring the list of newest questions and respond in about 3-30 minutes. It’s not uncommon to be overtaken while still writing on an answer – in these cases you will get a notification on top of the site which you can click to see the latest answers while still retaining your unsent answer. Voting is quick, too. But in almost any case quality matters and since there will be some extra points for accepted answers you are never wrong to submit your own one if it adds some new aspects, even to highly frequented threads.

It’s best to try it yourself but be warned: That site is addictive! :)

Thursday, February 19th, 2009

Browser warning for IE6 users

Since the will to do all that annoying extra bugfixes for IE6 is pretty low 7 1/2 years after its release, I finally decided to display a little nag notice on top of my page after having been encouraged to do so by others (see below). The script is multi-language and customizable and you are free to use, distribute and modify it for your websites (even commercial ones) without any further agreement (consider this a license; needed in Germany). It’s multi-language and offers some small options for quick setup.

Please note this does not mean this site (and others I create in my freetime or at work) will completely stop working in IE6 in near future but some functionality or design might be incomplete/broken because I will no longer optimize my personal web sites for IE6. (At work we and our customers cannot afford stopping to optimize for IE6 yet since some companies still won’t upgrade in near future for – in most cases – comprehensable reasons, so either our customers or theirs would not be able to use the websites we build.) Nevertheless it won’t hurt to display a relatively unobtrusive message.

The icon I used for it is from famfamfam’s free mini icon set: http://www.famfamfam.com/lab/icons/mini/

Other sites that encourage their users to upgrade: (not using my script)

Get a preview here: (Note: this may not display correctly in browsers other than IE 6 – no sense to support it elsewhere ;) )

English
German

JavaScript and CSS (quick setup options on top; language and download arrays inside warn-function)

You will also need jQuery in case you don’t have it already. (include jQuery and CSS before including the nag-script)

Tuesday, November 25th, 2008

Broken

In case anyone should be wondering why I didn’t continue my project to install Gentoo: Well… Unfortunately that slug is broken.

USB seems to be damaged in some way as it reports nothing but rubbish to the kernel and something causes bad noises to come from the beeper. Some forum threads pointed out that might be caused by a bad power supply. However, after changing the AC adapter it doesn’t run any better in my case. Since I wasn’t able to flash the original firmware correctly (it was just too obvious that I manipulated that box) I decided to open it up and take a look at its PCB.

Unfortunately I can’t see any physical damages on that board so I must assume there’s some hidden defect somewhere. I doubt I can fix it, so I must consider that box to be broken after just 4 months. After all I read I must advice everyone NOT to buy a NSLU2 – except you are out for some soldering on the board. The hardware fails much too often from what I could find, be it for overheating, manufacturing or just design errors (like the fancy “feature” that you can power the box solely by an external USB hub). Sadly, if I cannot find the error or a workaround for it, I may not continue on this project since I am not willing to buy another box for full price that’s broken by design.

Either I buy one very very cheap at eBay or I will just let it die. Maybe someday I might be able to fix it – could be my studies might be of some help at some later point.

Anyway; this project was no complete loss of time. Much of the knowledge I gained can be helpful in getting Gentoo onto the Pandora when it finally arrives (which unfortunately may take another 3-4 months depending on LCD production since I assume I’m somewhere in the last third of the preorder queue).

Thursday, October 2nd, 2008

msleep() vs. mdelay()

Arrrrgh…. I finally got it….

For months I have been trying to figure out why my cross-compiled kernel and rootfs won’t boot on the NSLU2 aka Slug. Since I didn’t want to solder pins for the serial I/O onto the board I tried a quite unique approach: Since the Slug has 4 LEDs that can be easily controlled through GPIO, I could hook up at some function and send all output through the LEDs. Sure this would be slow (~1 character per second, maybe 1.5) but that would be enough to at least read kernel panic messages while retaining full warranty on the hardware.

Finding out how LEDs were controlled took me about 1,5 hours, hooking up and testing first things another hour. I hooked up before the call of init (disk 2 on), right after init (disk 1 on) and on kernel panics (both disk leds on). So what happened: It got init and then crashed with a panic after a few seconds. I figured out I could hook up at uart_console_write() or panic() and then read any output by blinking a byte in 4 steps (one byte on each disk LED, signal indication by setting power to green and “clock” indication through power amber). Well it started blinking for hours and hours and hours… But all I could decode was just infinite rubbish, no matter what I tried. Even a comparison i

Nothing worked - until now....

For some reason I chose msleep() over mdelay(). That was the critical fault.

msleep() seems to suspend the currently running task, so it is non-blocking regarding the whole system.

mdelay() blocks the system (or at least the active CPU) if running single-threaded.

So why was that small change critical to my code? I don’t know exactly. But I know that panic() disables scheduling before any further action. So what happens if some code fragment used by panic() tries to relay on scheduling? Something seems to get corrupted very seriously, maybe some kind of heap or stack overflow happens. Maybe some process/scheduler data gets screwed up. I don’t know. But that seemingly tiny difference of blocking vs. non-blocking functions (what function does what isn’t always that clear if you’re new to Linux kernel programming) really makes a very big difference.

I finally recorded my kernel panic on dv tape and will decode it tomorrow using a simple tool I wrote. If it is finished I will make it available from this website.

Here’s a small excerpt from the ~20 minutes long message transmitting “BUG: sched[...]” (I did not decode more than that yet):

Edit: I decoded all 20 minutes. What was readable (the decoder was a quick and dirty solution since yet) led me to “BUG: scheduling while atomic:” in kernel source and was simply caused by a remaining msleep in my LED function. I got rid of it and now got a clean message “Attempted to kill init!”. Now, that’s where the debugging begins…

Sunday, July 13th, 2008

Slug (Linksys NSLU2)

After I read about a quite inexpensive (about 65 to 75€) embedded system on a forum two weeks ago, I needed to get one of these myself. The system has two USB host ports and an ethernet interface, 32MB SD-RAM, 8MB flash memory and a 266MHz ARM (Intel XScale) CPU (underclocked @133 MHz until mid 2006 production dates). It’s running Linux with a modified RedBoot bootloader. It’s originally intended to be a NAS server for USB hard drives but can be flashed with different Linux kernels and images. Unfortunately it’s already getting old (first released in 2004) and was reported to be discontinued so I had to decide to buy it now or never. I bought it:

If that device is completely new to you, the article on Wikipedia (en/de) may provide a good starting point for more information on what is possible. If you get interested in it, nslu2-linux.org provides a great resource to answer almost all your questions.

My goal is to get Asterisk, DHCP, DNS, OpenVPN and maybe a small webserver to run on it. However I haven’t reached that yet. (Click the link below to read more.) (more…)

Saturday, May 24th, 2008

Java JAX-WS tutorial and standalone

If you’re wondering why I post this in English: I felt the urge to post in a way so Google & Co. can find it on the keywords I was unable to get any helpful results for.

In a homework we have to use JAX WS to implement a sample SOAP web service. I don’t understand why we were not simply allowed to continue using Axis (well, they said setting it up on server-side would be too complex – but if you’re just deploying the WAR archive and use the JWS approach without complex types/classes that would have been enough for such an exercise). It’s not only demanding you to use Java 1.6 (which Apple doesn’t think is worth providing a 32 Bit JRE/JDK for; so I can’t use my iBook to work on it) but compared to Axis I found JAX extremely bad documented (or their web site too confusing). I was unable to find the information I was looking for and got stuck on pages telling me how generated files look like after they have been generated. For some reason they just missed to give a fast introduction like “Getting started on implementing a web service” to give a short overview of what’s necessary just to get your workspace and environment up and running.

I thought I would need to setup Tomcat 6, compile, wsgen, write lots of configuration files, WAR everything and then deploy it. I was wrong. After hours of unsuccessful attempts and searches I remembered I saw something about JAX WS on IBM DeveloperWorks some time ago. I headed for their website and there it was: Design and develop JAX-WS 2.0 Web services describes everything you need to know to get started with JAX. It even shows a one-liner to start the web service standalone – without the hassle to deploy it. Just read until at least section 4 (page 8 on PDF) and have a look into the example code, class OrderWebServicePublisher. You’ll be surprised.

BTW: In case you are using Gentoo you may notice some JDK tools are not yet linked to /usr/bin (e.g. wsgen :P ). You may want to have a look into /opt/sun-jdk-…/bin. Doesn’t affect the Ant task though.