The King

I am apparently a “Cool Nerd King”:

NerdTests.com says I'm a Cool Nerd King.  What are you?  Click here!

I think I’m happy about that, actually.

Xfce and Google's Summer of Code

While we haven’t been accepted into the program yet, we (Xfce) are applying to participate in the 2008 Google Summer of Code as a mentoring organisation. Please see our wiki page for more information, and add your name to the students list if you’d like to work on one of the projects. Feel free to add to the project ideas list as well.

If you’d like to act as a mentor, you still have a few more days before I submit the application. Add your name to the mentors list and email me to let me know.

Video

Sweet! I got a brief mention in TiNDC #35. Now that I’m back to Linux after a 2-week stint on MacOS X, hopefully I’ll be able to help out some more. Not that I don’t have other things I’m supposed to be working on…

Really Persistent Connections

A little background: a month or so ago, I set up a 6to4 IPv6 tunnel at home, and set up IPv6 addressing on my home LAN. All the machines on my home LAN are routable on the IPv6 internet now. I put a corresponding tunnel on the router of my development network at work (yes, I properly firewalled both networks).

So, here’s the progression of events today:

  1. My MacBook is on the dev network at work via wired ethernet. I ssh to my laptop at home on my LAN through the IPv6 tunnel.

  2. Later, I need to go to a meeting, so I unplug the ethernet cable and turn wireless on, connecting to our corporate WLAN, which has no IPv6 support at all, and connects to the internet via a completely different pipe than the dev network.

  3. I’m in the conference room downstairs for a half hour during the meeting.

  4. I come back to my desk, switch off wireless, and plug the original ethernet cable back in.

  5. A bit later, I switch back to iTerm, and notice the terminal with the ssh session open, which hasn’t timed out on my end yet. Not too surprising, so I go to hit enter a few times to see if it’ll die before I take the more drastic action of closing the window and opening a new one.

  6. I press enter, and… the other end responds! The ssh session is still alive, despite the fact that I’ve been on another network for a good 30 minutes.

Say what?

Reverse Blog

Over the past year-ish I’ve turned this blog into more of a private journal, sometimes writing a public post here and there (from mostly public, with occasional private entries). I just updated Wordpress to version 2.3.2, which was long overdue, as I’d been running 2.0.9 for a very long time. Not much has changed, it seems, which is good in some ways (I didn’t have to touch my theme for the new version), and not so great in others (I was hoping for a couple new features, maybe stuff that I hadn’t even thought of but would find cool).

At any rate, I’d like something a bit opposite of what Wordpress currently offers. I want the default action to be post privately, with a separate button or setting I can hit to publish it. Currently it’s a little awkward. There’s a per-post “Post Status” setting, which can be one of Published, Pending Review (not sure what this does; 2.0.9 didn’t have it), Draft, and Private. The default is Draft, but that’s a little misleading. There are three buttons: Save and Continue Editing, Save, and Publish. The two Save buttons keep the Draft status. The Publish button acts like the Save button, but “helpfully” also sets Post Status to Published.

This UI is kinda confusing, and a bit prone to error: on more than one occasion I’ve published something I’ve wanted to keep private (fortunately no harm was done as I noticed the error quickly). I’m not sure what a better UI might be. One option is to just have two buttons: Save and Continue Editing, and Save. Then the Post Status field would always be maintained when clicking either of those buttons. As a consequence, the default Post Status would probably be Published. As a bonus, it would be great if the default Post Status were configurable. Then I could set it to Private and selectively change things to Published when I want to. Anyone know if there’s a way to achieve a similar effect (with Wordpress)?

On Broken ACPI DSDTs

A couple months ago, I replaced the AMD Sempron 3100+ (1.8GHz) in my HTPC with a newer AMD Athlon64 3200+ (2.2GHz). It’d been having some trouble multitasking: specifically recording and watching HD content at the same time could often cause stuttering, especially if the commercial flagger was running at the same time. It also had issues with some higher-bitrate 1080p content. So, I got the replacement CPU.

I swapped CPUs (scaring myself to death when I realised I’d almost broken the socket when the CPU got stuck to the heatsink, and I yanked the CPU out of the socket without lifting the ZIF lever), and noticed an odd error on boot:

powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3200+ processors (1 cpu cores) (version 2.00.00)
ACPI Exception (processor_perflib-0234): AE_NOT_FOUND, Evaluating _PSS [20070126]
powernow-k8: BIOS error - no PSB or ACPI _PSS objects
ACPI Exception (processor_perflib-0234): AE_NOT_FOUND, Evaluating _PSS [20070126]

Basically, that means the powernow-k8 driver was reporting that it wasn’t provided a _PSS or PSB block in the ACPI DSDT, so it didn’t know about any CPU P-states, and thus CPU frequency scaling wouldn’t work. Since I do sometimes leave the machine on idle, this was a bit annoying, since it’d be burning some power that it wouldn’t otherwise need to burn.

So, I googled a bit (oh, sorry, “performed some Google searches”), but didn’t find anything particularly promising. I checked the BIOS settings; yes, the “AMD Cool’n’Quiet” feature is enabled. I tried disabling it, rebooting, and then re-enabling, and rebooting, but no luck.

Fast-forward a couple months. A few days ago, I ran across something that reminded me of the problem. Some stuff about many motherboard manufacturers/BIOS writers providing crappy DSDTs in their ACPI implementation (the DSDT is what tells an ACPI-compliant OS what ACPI features are supported, and how to used them). So, I found a nice resource that told me how to fetch the DSDT from my BIOS, and decompile it for inspection.

According to the decompiled source, the DSDT was compiled with Microsoft’s compiler, which, I understand, is kinda crappy in that it lets a lot of errors past. When I tried to recompile my DSDT with Intel’s compiler, it threw 6 errors and around 20 warnings. I poked around at the errors, and, with some helpful pointers, I managed to fix the errors, or just comment out the portions causing fatal errors that I was pretty sure don’t do anything useful anyway.

The errors, however, didn’t seem to have anything to do with the missing P-state descriptions, though I did notice that the DSDT source was missing either a _PSS section or PSB section, as the kernel complained about.

So I googled some more, and came across this guy, who seemed to have a similar problem, but with his Athlon64 X2. He basically said he noticed that his processor description sections were empty, and found a DSDT on the Linux ACPI website for a similar motherboard that happened to have the proper _PSS entries, and copied them over, tweaking them a bit. Fortunately he also posted the sections he added.

Now, the X2 isn’t really the same chip as mine, but it was a place to start. I googled a bit more, and found another guy with a similar problem, and this guy even has the exact same CPU (down to the generation) as I do! Unfortunately, though his post seems to indicate he resolved the problem, he didn’t post a how-to, but did mention he got some information from some documentation from AMD.

So, off to AMD’s website. Cool, they provide quite a bit of technical documentation for their CPUs. I grabbed the BIOS and Kernel Developer’s guide to my CPU, and started looking for stuff about “_PSS”. Fortunately, it wasn’t hard to find (the doc is over 450 pages long). The structures and values I found from the X2 guy’s website are documented, and it gave some good defaults for some of the timing-related pieces.

Unfortunately, AMD’s specs don’t cover my particular spin of the CPU, so I couldn’t figure out what P-states my CPU supports, or what voltages they should run at, or what the power dissipation is for each state.

So, I had to fudge some values and make some stuff up. Wikipedia says my CPU runs at 59 W. Fair enough. But that’s for the default 2.2GHz frequency and 1.4V voltage. But what about lower frequencies? I decided to arbitrarily pick 1.6GHz at 1.3V and 800MHz at 1.2V for my other 2 P-states (presumably I could pick more, at 200MHz increments, but I wanted to keep it simple). Running a CPU at a lower lower voltage when underclocking is generally a reasonable thing to do; though dropping the voltage too low is probably a bad idea. But what about power dissipation? According to the specs, only the max/default P-state has to have its power dissipation value specified exactly. All slower P-states can be estimated. Good news. I just simply took the 59 W value and scaled it down based on both the frequency ratio and voltage ratio. Is that exact? No, certainly not. But it’s probably not totally off the mark.

One value eluded me. One of the values is a control register that needs to get set. The control register has 7 different sub-values. AMD’s documentation gives good defaults for six of them. The last one, PLL_LOCK_TIME, seems pretty important: it’s the time it takes for the processor PLLs to re-lock after a state change. A PLL is essentially a clock generator. You have a phase detector and some kind of oscillator (where you can change the freqency), and then a feedback path that has some kind of divider circuit. Anyhow, I lucked out on this one: the X2 guy provided values for these, and since his values for all the other six seemed to match mine, I crossed my fingers and hoped his PLL_LOCK_TIME is the same as mine.

So, whew. I added the missing _PSS section to my DSDT, with the three P-states, and recompiled it, fortunately without errors. (I decided not to bother with the existing warnings because I’m lazy.) Now, how do we use it? According to the original Gentoo forum page I was looking at, you can either patch the kernel to use a file that you have to put in the kernel source tree in a particular location, or you can patch the kernel to read the DSDT out of an initrd. Boo, I don’t wanna patch my kernel. So I googled a littler more, and it appears that recent kernels have a better option: you can enable a kernel config parameter, and it’ll let you specify a path to a header file (helpfully generated by the DSDT compiler) to use. So, ‘make menuconfig’, and I dig around for the option. Not there. Oh, I need to disable the “Select only drivers that don’t need compile-time external firmware” option. Ok… still not there. I search for config options with “DSDT” in them, and find that the one I want requires that CONFIG_X86_VOYAGER isn’t set (which it isn’t), CONFIG_ACPI is set (which it is), and CONFIG_STANDALONE isn’t set (which it isn’t, now that I disabled it). But still, no option. So, let’s try another tack. I quit menuconfig, and open .config in a text editor. I remove the one DSDT-related line, save it, and run ‘make oldconfig’. Now, it prompts me for the DSDT-override option, and, when I select it, I get prompted for a file location. Nice. And lame. But mostly nice. So, I recompile (first intentionally negelcting to copy the header file to the location I specified, just to make sure it would error out, confirming that the option was enabled), install the kernel image, and reboot. The box comes up, I ssh in, and check dmesg:

powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3200+ processors (1 cpu cores) (version 2.00.00)
powernow-k8:    0 : fid 0xe (2200 MHz), vid 0x6
powernow-k8:    1 : fid 0x8 (1600 MHz), vid 0xa
powernow-k8:    2 : fid 0x0 (800 MHz), vid 0xe

Oh, yes. Yes, that’s nice. I cat /proc/cpuinfo, and see that my CPU is now running at 800MHz (I have the machine set up to use the ‘ondemand’ cpufreq governor, which sets the frequency to the lowest needed given the system load). I dig around in /sys/devices/system/cpu/cpu0/cpufreq/, setting different governors and speed values, and checking that /proc/cpuinfo reports the new speed. Success!

Presumably, I could add more P-states, but I think 1600MHz and 800MHz will do. For those of you with similar problems, my motherboard is a DFI K8M800-MLVF. Feel free to use my hacked DSDT if you have the same motherboard, or as a reference point if you have another Socket 754 system or similar CPU. Of course, I offer this with no warranty and accept no liability, and if your system explodes, it’s your responsibility and all that.

See also: my AMD _PSS notes, and my AMD _PSS value table.

Air

I’m a bit disappointed in the newly-announced MacBook Air. I want one, but… I don’t.

The good:

  1. Super-thin form factor: 0.16” to 0.76”.

  2. MacBook Pro-style aluminum case.

  3. Small size: 13.3” widescreen display.

  4. 802.11n wireless (dual-band 2.4/5 GHz).

  5. Intel GMA graphics (very well supported on Linux, even if it’s not as ‘powerful’ as nvidia/ATI).

  6. Backlit keyboard.

  7. LED-backlit display.

  8. Multi-touch trackpad (though I have no idea how well-supported or useful it’ll be on Linux).

Unfortunately, we have quite a bit of the bad:

  1. No built-in ethernet (USB dongle sold separately, but that rules out gigabit).

  2. No built-in optical drive (I expected this; I don’t mind).

  3. Only one USB port. So if I get the USB ethernet dongle and/or the external USB optical drive, I have to choose which one I want to use. And if I’m somewhere where there’s no wireless, and I have to use a USB flash drive, I have to disconnect the network. Lame.

  4. Non-user-replaceable battery. (I imagine it’s possible, though somewhat difficult, like replacing the hard drive in my PowerBook was.) This is somewhat annoying for me since I tend to have the machine on 24/7, and as such I’m a bit harsh on the battery (I leave it plugged in while fully charged for long periods of time).

  5. RAM is not upgradeable (soldered to motherboard). Comes with 2GB standard, so probably not too much of a problem.

  6. Relatively slow CPU given today’s state-of-the art. (Granted, 1.8GHz dual-core should be plenty for me.)

  7. The IBM X-series used to use the 1.8” 4600 RPM hard drives, but switched back to 2.5” drives because of large performance problems with the 1.8” drives.

  8. No dedicated graphics memory (144MB shared with system RAM).

  9. Only a single speaker (mono sound). Though, do you really notice stereo separation with a pair of crappy speakers about a foot apart?

  10. A concern: will the laptop hold up? It’s very thin. Aluminum is definitely bendable (as my 12” PowerBook which no longer sits flat will confirm).

  11. MacBook-style keyboard. I’m not a huge fan of the keyboard on the MacBook I have at work. I far prefer the keyboard on my PowerBook (and on the MacBook Pro).

I’m not considering buying one now; not only should I not be spending the money now, but I wouldn’t dare buy first-gen Apple hardware. So fortunately there will be time to see if my concerns about the laptop’s durability are warranted, ditto for my concerns about hard drive performance. And it’s possible there might be a refresh in 6-8 months that includes better graphics, more RAM, a faster CPU, or even (however unlikely) an extra USB port or an ethernet jack.

I guess the issue is that I was really hoping for a 12” (or 13.3”, though I’d prefer 12”) MacBook Pro, essentially an Intel-based replacement for the 12” G4 PowerBook. I knew that wasn’t what Apple was going to announce, but I was hoping it wouldn’t be too far off the mark.

I’m still undecided, but I’m going to give myself at least 6 months to think about it, and probably more. Likely I wouldn’t buy one until the fall. There’s also the hope that there will be a major MacBook Pro refresh before then that improves the MBP situation a bit. Given the introduction of the MBA, I seriously doubt they’d start selling a 13.3” MBP, but it’s possible they might somehow make the 15” MBP more attractive to me. Unfortunately, I just don’t really like the MacBook’s aesthetics; I wouldn’t really consider buying a 13.3” MacBook for myself. We’ll see what happens, I suppose.

Git-svn Xfce Repositories

I recently started messing around with git, partly just to see what all the fuss is about, and partly because I want an easy way to do ‘offline commits’ when I don’t have an internet connection (I spend a decent amount of time on planes and in airports, and sometimes in wifi-less cafes with my laptop). I’ve looked at SVK, but I’m not a huge fan, and it seems ridiculously complicated for what it does (or rather, what I need it for). It also means learning another tool that’s only useful for a very small thing.

So: git. It’s been hyped like crazy since its inception, and frankly I’ve avoided it mainly because of the hype. But I’m surprised at how much I like git. Being able to have lots of little throwaway branches to do various related tasks on is really useful, and merging them back to the main branch is trivially easy. The offline operation is obviously a great bonus.

To make things even better, I was absolutely thrilled when I found out that git comes with a sub-app called ‘git-svn’. In a basic sense, it’s a ‘svn2git’ script that lets you import all of your commit history from a svn repository into a git repository. But it’s so much more. It’s bidirectional, so after you create the git-svn repository (which is really just a git repository with a bunch of extra info to keep things in sync with svn), you can continually update your local repo as changes are made to the master svn repository, and you can push changes in your local repository up to the master svn server. And when pushing changes, it actually does one svn commit for each local git commit, so your local git history gets replicated on the server.

Anyhow, git-svn is a little hard to figure out at first, so I figured I’d ‘convert’ all the Xfce core core modules into git-svn repos and post them so other people don’t have to figure it out. Also, doing the conversion over a network via http or svn+ssh takes quite a long time (and wastes quite a lot of bandwidth), and I can do them locally on the svn server. You can grab them here. Please read the README in its entirety first, as these repos will not work properly with the Xfce svn repo out of the box, and there are a few extra git commands you’ll need to know to interact with the svn server.

Good luck and enjoy. If you have issues with them, please don’t comment here, and don’t email me. Email the Xfce dev list instead.

« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next »