Muli Ben-Yehuda's journal

December 20, 2003

Filed under: Uncategorized — Muli Ben-Yehuda @ 2:38 PM

testing posting from centericq (thanks, moshez!)

Filed under: Uncategorized — Muli Ben-Yehuda @ 1:41 PM

what ladypine said. I suggested replying “we’re going to watch it on our laptops, why?”. Hi, choo!.

All Code Sucks – bytesex woes

Filed under: Uncategorized — Muli Ben-Yehuda @ 1:03 PM

Recently, I’ve had the (mis)fortune to work on a driver for an unnamed hardware device. The device in question was little endian, and as long as the driver was working on Intel platforms (which are little endian), all was well and good with the world. Except for the usual hardware woes[1][2][3], which will be elaborated upon in a separate entry. The day came when we had to port the driver to PowerPC, which is a much nicer architecture in general. Alas, it is also big endian. This is where the fun starts.

– The endianness support was added in such a manner, that whenever looking at any given value, you never knew if it was little endian or big endian. No consistency whatsoever. This makes the code, of course, impossible to maintain.

– In some cases, the conversion depended on the platform the code was running on. In other cases, the conversion needed to be absolute (always convert from little endian to big endian, and vice versa). The same macros (hideously named HOST_TO_FOOCARD_XX, FOOCARD_TO_HOST_XX, etc, rather than the sensible Linux cpu_to_le_xx) were used in both cases. This is, of course, buggy.

– This device had registers for programmers to frob. Some of the bits in those registers were reserved (must never be changed by the programmer), and some of them were supposed to be turned on or off occasionally. An unnamed programmer created masks for those bits:

#define MASK_FOR_SOME_BIT 0x80000000 

And then used this mask in her code:

U32 val = readl(card->someoffset); /* read value from register at offset */  
writel(val, card->someoffset); /* write it back */  

Can you spot the bug here? think of the endianness of the value read from the card, and the endianness of the mask, and which bit actually gets changed, and enlightenment shall come.

[1] Insufficient documentation.
[2] Wrong documentation.
[3] No way to figure out why the device doesn’t like what we write to it, except for the documentation. See [1] and [2].

December 19, 2003

Filed under: Uncategorized — Muli Ben-Yehuda @ 10:45 PM

Interesting thread on linux-elitists wrt “best computer books”. This being linux-elitists, I agree with most of the recommendations.

Filed under: Uncategorized — Muli Ben-Yehuda @ 9:28 PM

Haifux, the Haifa Linux club, whose meetings I’ve been attending for over four years now, has a lovely new website look. Kudos, ladypine!

Filed under: Uncategorized — Muli Ben-Yehuda @ 8:40 PM

Sun is working on making computers do floating point math correctly.

“The problem that Gustafson and Papadopoulos referred to stems from the fact that the binary mathematics employed by computers has a hard time accurately representing certain numbers. Fractions, for example, are particularly tough, because they often involve non-terminating numbers that are impossible to accurately express in binary format.”

December 17, 2003

Filed under: Uncategorized — Muli Ben-Yehuda @ 11:21 PM

It’s 11 PM on the night before our first big code delivery, and I have zero open bugs. Damnit, that feels good!

December 16, 2003


Filed under: Uncategorized — Muli Ben-Yehuda @ 12:04 AM

I was betting on RedHat. When I read “We have some very interesting
things planned, and I am totally psyched. Desktop
…”, I started getting afraid. In-kernel GUI, anyone?

December 15, 2003

Filed under: Uncategorized — Muli Ben-Yehuda @ 2:22 PM

There’s an excellent article on groklaw ( on “The GPL is a License, Not a Contract, Which is Why the Sky Isn’t Falling”. Specifically, why this means that companies don’t have quite as much to fear when using GPL’d code as certain fudsters would like us all to believe[1].

[1] This is because it’s a license, not a contract. If you breach a contract, I can come after you and sue you. If you breach a license, all that happens is that the license is revoked. What this means is that if you e.g. distribute GPL’d code without giving the source, you are violating the license, and you have to stop distributing your offending code, because you no longer have permissions (==license) to do so. It doesn’t mean you have to open up the rest of your non-infringing code, for example, as the fudsters would like you to believe, and as *might* have been the case if the GPL had been a contract. IANAL, nor do I play one on TV.

December 11, 2003

Filed under: Uncategorized — Muli Ben-Yehuda @ 2:43 PM

Put up the work-in-progress version of the aib-B1 patch. The patch is by Con Kolivas and me. I supplied the percpu variables and list handling, and Con hooked it into the relevant points in the scheduler.

The purpose is to make the scheduler smarter when choosing which idle CPU to put a new task on, by keeping track of which CPU has been idle longest. This is a work in progress, Con is benchmarking it now, and we are thinking about a bit-field version that should be faster (although I’m concerned about possible contention).

« Previous PageNext Page »

Blog at