Roy's Blog

A Hacker's musings on Code | Tech | Life

Ever since I first got my AMD64 box one think always annoyed me - my on-board VIA velocity didn't work with ifplugd or netplug as it always thought there was a cable plugged in. This was less than optimal as with the new coldplug functionality in baselayout it started by default and tried to get a DHCP lease by default.

So I finally got of my lazy rear end and filed a kernel bug. With Francois Romieu I wrote a patch that has been accepted into the mainline kernel :) OK, he wrote the actual fix, but still. It gives a very big warm fuzzy feeling that you've contributed something to the kernel as every Linux user uses it :D

I've also filed a bug requesting the inclusion of the patch in gentoo-sources so hopefully Gentoo users will get the fix a bit quicker :)

The morale of this story is to file a bug if something doesn't work for you as it gets fixed much quicker!

Continue reading...

Everyone should know about grep. Most of the time it's used for testing the existence of a specific regex pattern somewhere. baselayout uses grep frequently for many tasks like so :-

grep -q '^envID:[/proc/self/status

Did you know that bash can do this without the use of grep? Here's how ...

[[ $'\n'$(/proc/self/status) =~ $'\n''envID:[[:space:]([:space:]]*[1-9]')]*[](1-9]')]

(NOTE: everything that matches the regex is now in the array BASH_REMATCH)

One important point is that the file is read as one big string, so the ^ $ anchors don't work in the same way as they now point to the start and end of the file. The work around is to match on \n instead. As such we always put one at the start of the file incase the match is on the first line.

Now, which is faster? Well, I ran all our existing is_foo_sys checks in /sbin/functions.sh 500 times in a row. grep was around 1 whole second slower than bash! :jawdrop:

That's impressive, but then again I've already shown bash to be faster than some other C programs ;)

What I don't know is how it performs on large files .... I would guess that grep is faster as it can return once a match is found whereas bash has to read the entire file, but as all files checked should be quite small there shouldn't be a problem :)

Continue reading...

Notified the local Registrar of my intention to marry Abbey ...... was strange :OFelt weird walking back to the car as its sort of becoming more and more official!

Continue reading...

So spyderous has been spouting the virtues of the new r200 and r300 stuff in xorg-7.1, so I finally decided to give it a whirl. Thanks to the new modular structure of X, the upgrade went very fast. Everthing was very peachy up until the starting any OpenGL application as it gave me a ton of errors in dmesg like so

[drm:r300_emit_3d_load_vbpntr] *ERROR* Offset failed range check (k=0 i=2) while processing 3D_LOAD_VBPNTR packet.
[drm:r300_emit_packet3] *ERROR* r300_emit_raw_packet3 failed
[drm:r300_do_cp_cmdbuf] *ERROR* r300_emit_packet3 failed

Which is not good.

Luckily, the culprit turned out to be mesa and this issue is fixed upstream in cvs - the error is apparently exclusive to PCIE r300s cards (which my X600 is) :) I'll see if I can cut a patch against 6.5, but I doubt I have the skills or the time :(

So now I have working 3D and no 3rd party binary crap (ok, ATI's fglrx driver isn't crap, but it sure is bloated and has a few issues - see below) :D. Well, I do, but that's just firmware for my ipw2200 and prism54 cards.

Although the 3D works it's not exactly error free - there are artifacts with some KDE screen savers and my favourite game Eternal Lands doesn't work with a few options - however it's very playable.

The big win for me is that it works with vesa-tng, although sadly not radeonfb. Also, I no longer need to force KDM to restart X on logout and while 3D is slower and obviously spotty 2D is faster and smooter. Which is important for me as I mainly code on my laptop and play games on my AMD64.

I may even try ut2004-demo and Quake4 on my lappy just to see how they fair :jawdrop:

Continue reading...

Kernel monkey and all round slacker dsd has convinced me to attend the Gentoo UK 2006 conference on July 8th :)So if you wonder what I look like, have questions about baselayout, what my plans are for it or just want buy me a pint then come along! I won't be speaking 8) much to everyones great relief ;)

Continue reading...