An aggregation of our Blog Roll, made up of acmqueue authors.   more

All Postings, Matthew Garrett:  (143 posts)

Source blog: Matthew Garrett's Journal

Thu, 01 Mar 2012 15:43:33 UTC

Not here

Posted By Matthew Garrett

For anyone still trying to read this, I am now here.

Fri, 23 Sep 2011 15:48:21 UTC

Supporting UEFI secure boot on Linux: the details

Posted By Matthew Garrett

(Update January 18th 2012 - you probably want to read this for details on why the technical details described below are not the difficult bit of the problem)An obvious question is why Linux doesn't support UEFI secure booting. Let's ignore the issues of key distribution and the GPL and all of those things, and instead just focus on what would be required. There's two components - the signed binary and the authenticated variables.The UEFI 2.3.1 spec describes the modification to the binary format required to produce a signed binary. It's not especially difficult - you add an extra entry to the image directory, generate a hash of the entire binary other than the checksum, the certificate directory entry and the signatures themselves, encrypt that hash with your key and embed the encrypted hash in the binary.

Fri, 23 Sep 2011 13:01:14 UTC

UEFI secure booting (part 2)

Posted By Matthew Garrett

Updated: Three things happened to defuse this situation:Microsoft mandated that it be possible to disable Secure Boot on any Windows certified systemsMicrosoft mandated that it be possible for the user to replace the original Secure Boot keys on any Windows certified systemsMicrosoft were willing to sign alternative OS bootloaders with their signing keysAs a result, the worst case scenario did not come to pass and it's still possible for users to install Linux on their systems.Original content follows:Microsoft have responded to suggestions that Windows 8 may make it difficult to boot alternative operating systems. What's interesting is that at no point do they contradict anything I've said.

Tue, 20 Sep 2011 18:23:22 UTC

UEFI secure booting

Posted By Matthew Garrett

Since there are probably going to be some questions about this in the near future:The UEFI secure boot protocol is part of recent UEFI specification releases. It permits one or more signing keys to be installed into a system firmware. Once enabled, secure boot prevents executables or drivers from being loaded unless they're signed by one of these keys. Another set of keys (Pkek) permits communication between an OS and the firmware. An OS with a Pkek matching that installed in the firmware may add additional keys to the whitelist. Alternatively, it may add keys to a blacklist. Binaries signed with a blacklisted key will not load.There is no centralised signing authority for these UEFI keys.

Thu, 01 Sep 2011 21:39:38 UTC

The Android/GPL situation

Posted By Matthew Garrett

There was another upsurge in discussion of Android GPL issues last month, triggered by couple of posts by Edward Naughton, followed by another by Florian Mueller. The central thrust is that section 4 of GPLv2 terminates your license on violation, and you need the copyright holders to grant you a new one. If they don't then you don't get to distribute any more copies of the code, even if you've now come into compliance. TLDR; most Android vendors are no longer permitted to distribute Linux.I'll get to that shortly. There's a few other issues that could do with some clarification. The first is Naughton's insinuation that Google are violating the GPL due to Honeycomb being closed or their "license washing" of some headers.

Fri, 29 Jul 2011 16:51:34 UTC

Posted By Matthew Garrett

I've turned off the automatic crossposting, so all future updates will only be here.

Thu, 14 Jul 2011 17:14:53 UTC

Booting with EFI

Posted By Matthew Garrett

One of the ways in which EFI is *actually* better than BIOS is its native support for multiple boot choices. All EFI systems should have an EFI system partition which holds the OS bootloaders. Collisions are avoided by operating system vendors registering a unique name here, so there's no risk that Microsoft will overwrite the Fedora bootloader or whatever. After installing the bootloader the OS installer simply sets an NVRAM variable pointing at it, along with a descriptive name and (if they want) sets the default boot variable to point at that. The firmware will then typically provide some mechanism to override that default by providing a menu of all the configured variables.This obviously doesn't work so well for removable media, where otherwise you'd have an awkward chicken and egg problem or have to force people to drop to a shell and run the bootloader themselves.

Thu, 09 Jun 2011 01:42:28 UTC

IPv6 routers

Posted By Matthew Garrett

I have a WRT-54G. I've had it for some years. It's run a bunch of different firmware variants over that time, but they've all had something in common. There's no way to configure IPv6 without editing text files, installing packages and punching yourself in the face repeatedly. Adam blogged about doing so today, and I suspect he may be in need of some reconstructive surgery now.I spent yesterday looking at disassembled ACPI tables and working out the sequence of commands the firmware was sending to the hard drive. I'm planning on spending tomorrow writing x86 assembler to parse EFI memory maps.

Tue, 07 Jun 2011 19:54:52 UTC

A use for EFI

Posted By Matthew Garrett

Anyone who's been following anything I've written lately may be under the impression that I dislike EFI. They'd be entirely correct. It's an awful thing and I've lost far too much of my life to it. It complicates the process of booting for no real benefit to the OS. The only real advantage we've seen so far is that we can configure boot devices in a vaguely vendor-neutral manner without having to care about BIOS drive numbers. Woo.But there is something else EFI gives us. We finally have more than 256 bytes of nvram available to us as standard. Enough nvram, in fact, for us to reasonably store crash output.

Tue, 31 May 2011 18:45:19 UTC


Posted By Matthew Garrett

You'd think it'd be easy to reboot a PC, wouldn't you? But then you'd also think that it'd be straightforward to convince people that at least making some effort to be nice to each other would be a mutually beneficial proposal, and look how well that's worked for us.Linux has a bunch of different ways to reset an x86. Some of them are 32-bit only and so I'm just going to ignore them because honestly just what are you doing with your life. Also, they're horrible. So, that leaves us with five of them.kbd - reboot via the keyboard controller. The original IBM PC had the CPU reset line tied to the keyboard controller.

Wed, 25 May 2011 16:06:08 UTC

Trials and tribulations with EFI

Posted By Matthew Garrett

I wrote about some EFI implementation issues I'd seen on Macs a while back. Shortly afterwards we started seeing approximately identical bugs on some Intel reference platforms, and fixing it actually became more of a priority.The fundamental problem is the same. We take the EFI memory map, identify the virtual addresses of the regions that will be required for runtime (mapping them into virtual address space if needed) and then call the firmware's SetVirtualAddressMap() implementation in order to let the firmware convert all its pointers. Sadly it seems that some firmware implementations call into sections of boot services code to do this, which is unfortunate because we've already taken that back to use as RAM.

Wed, 18 May 2011 19:00:10 UTC

Macs and Linux

Posted By Matthew Garrett

Firstly: If you want to buy a computer to run Linux on, don't buy a Mac.Secondly: If you have a Mac and want to run Linux on it, the easiest approach is going to be to run it under virtualisation. Virtualbox is free, and worth every bit of what you're paying.Thirdly: If you're going to boot Linux on bare-metal Apple hardware, boot it via BIOS emulation.Fourthly: If you're going to boot Linux on bare-metal Apple hardware via EFI, and it doesn't work, write a patch. Apple's firmware has a number of quirks that I'm aware of and we're working through them, but anyone filing bugs against Apple hardware on EFI right now is likely to be ignored for a significant period of time until there's an expectation that it'll actually work.

Tue, 17 May 2011 17:21:20 UTC

Copyright assignment

Posted By Matthew Garrett

The fundamental problem with projects requiring copyright assignment is that there's an economic cost involved in me letting a competitor sell a closed version of my code without letting me sell a closed version of their code. If this cost is perceived as larger than the cost of maintaining my code outside the upstream tree, it's cheaper for me to fork than it is to sign over my rights. So if I have my own engineering resources, what rational benefit is there to me assigning my copyright?( Comments |Comment on this)

Thu, 12 May 2011 16:06:12 UTC

LightDM, or: an examination of a misunderstanding of the problem

Posted By Matthew Garrett

LightDM's a from-scratch implementation of an X display manager, ie the piece of software that handles remote X connections, starts any local X servers, provides a login screen and kicks off the initial user session. It's split into a nominally desktop-agnostic core (built directly on xcb and glib) and greeters, the idea being that it's straightforward to implement an environment-specific greeter that integrates nicely with your desktop session. It's about 6500 lines of code in the core, 3500 lines of code in the gtk bindings to the core and about 1000 in the sample gtk greeter, for a total of about 11,000 lines of code for a full implementation.

Wed, 27 Apr 2011 17:20:16 UTC

On platforms

Posted By Matthew Garrett

At some stage the seminal KDE vs Gnome paper vanished from its original home, and while it's still available in a few places (such as here) it set me thinking. What are the fundamental differences between Gnome and KDE development? There's lots of little differences (2006: Gnome parties on a beach. Akademy has melted ice cream in the rain) but they're both basically communities made up of people who are interested in developing a functional and interesting desktop experience. So why do the end results have so little in common?Then I read this and something that had been floating around in my mind began to solidify.

Wed, 23 Mar 2011 21:33:39 UTC

HTC are still incredible fuckheads

Posted By Matthew Garrett

Update: Despite another email yesterday reasserting the 90-120 days lie, the source code has now landed on HTC's site.As has been discussed before, HTC have a somewhat "interesting" interpretation of the GPL that allows them to claim they don't need to provide source code until between 90 and 120 days after the release of binaries. It's probably noteworthy that the FSF (who, you know, wrote the license and all) disagree with this interpretation, as do the kernel copyright holders (who, you know, wrote the code that the license covers) I've talked to about it. Anyway, after a pile of screaming and shouting from all sides HTC have tended to release their source code in a timely manner.

Tue, 22 Mar 2011 14:28:27 UTC

Archos update

Posted By Matthew Garrett

Archos confirmed to me that they don't have source code for their RK2818-based models at the moment, which means the 7" home tablet (version 2) and the Arnova range all appear to be infringing. For a company that is actually on the better end of the scale for compliance, that's somewhat disheartening. My understanding is that the Arnova and "home tablet" ranges (as opposed to the "internet tablet" range) are subcontracted or rebadging exercises, so there's probably less corporate oversight than for the internally developed hardware. This is, obviously, not an excuse.( Comments |Comment on this)

Sun, 20 Mar 2011 14:25:17 UTC

Archos tablets

Posted By Matthew Garrett

Has anyone tried to obtain the kernel source for the Archos 7 home tablet V2 or the Arnova range (ie, anything Archos is shipping that's based on the RK2818 rather than the RK2808)? If so, what was the response? The source from their site only appears to be for the RK2808 devices.( Comments |Comment on this)

Mon, 28 Feb 2011 23:46:26 UTC

Further adventures in mobile Linux

Posted By Matthew Garrett

I picked up a couple of cheap Linux devices at the weekend. First of all, a $99 Android tablet from CVS, made by Craig. It's a generic RK2818 device and of course it's lacking any kind of GPL offer in the documentation. As far as I know the only company that's released any Rockchip source so far has been Archos, and even then they haven't released the tools you need to actually build an image - they seem to be floating around the internet anyway. But it's straightforward to get it to run the Android market, and it runs Shortyz quite well, so fit for purpose from my point of view.

Wed, 09 Feb 2011 19:50:21 UTC

LCA 2011

Posted By Matthew Garrett

I'm both back from LCA 2011 and also over the associated brutal jetlag, so if you sent me mail and I still haven't replied then it's fallen down some sort of cliff and you should probably shout at me until I do something about it. LCA was, as usual, excellent. Especially given that the original venue was the same distance above the river as the now somewhat misleadingly described dry dock on the opposite bank.I did a bunch of talks this year, and they're now all online, so without further ado:Enterprise power management - a discussion of power management with a focus on enterprise users, given at the plumbers miniconf.

Mon, 07 Feb 2011 20:34:21 UTC

Hardware vexation

Posted By Matthew Garrett

My laptop (an HP 2530p) gets quite a lot of abuse. It's been with me enough to have done the equivalent of going round the world 4 or 5 times, and it's typically just thrown in a bag without any particular care or attention being given to its care or wellbeing. It's been dropped a couple of times with the only damage being some corners that aren't really as even as they should be. All in all, it's survived amazingly well. But it recently started refusing to boot, merely flashing its LEDs. After finally finding a list of what these mean, I narrowed it down to the memory.

Sat, 22 Jan 2011 05:39:34 UTC

Open embedded GPUs

Posted By Matthew Garrett

Luke: It's great to see open code for the 6410, but I'm pretty sure that that chip uses Samsung's own GPU design rather than being anything PowerVR based. What makes you think it's an SGX? The listing here implies that it's an unrelated part.

Tue, 18 Jan 2011 19:43:46 UTC

LCA 2011 has moved

Posted By Matthew Garrett

I haven't seen this widely publicised yet, so just to help make sure people know: Linux Conf AU 2011 is going ahead in Brisbane next week, but due to the flooding it's been moved to the QUT Kelvin Grove campus about 4KM north of the original venue. There are good bus links between it and the CBD. More details here.

Sat, 15 Jan 2011 03:13:34 UTC

In other news

Posted By Matthew Garrett

I'm thrilled to discover that GNU-Darwin, which carried the bold claim that "GNU-Darwin aims to be the most free software distribution", distributes copies of the XNU source code with Apple's additional license rider of "The rights granted to you under the License may not be used to create, or enable the creation or redistribution of, unlawful or unlicensed copies of an Apple operating system, or to circumvent, violate, or enable the circumvention or violation of, any terms of an Apple operating system software license agreement", which certainly sounds like a restriction of use to me.Free software's awfully like sausages - wonderfully tasty, but sometimes you suddenly discover that you've been eating sheep nostrils for the past 15 years of your life.

Sat, 15 Jan 2011 02:52:04 UTC

Joojoo, once more

Posted By Matthew Garrett

Having complained about the GPL compliance of the Fusion Garage Joojoo tablet in the past, I'm thrilled to say that I spoke to their new CTO earlier in the week and they now have full source availability here[1]. Previous engineering practices involved editing binary Debian packages rather than rebuilding from the Debian source packages, so there may be a small number of cases where it's awkward to rebuild an identical binary, but I think it's pretty clear at this point that they've done everything practical to make up for past mistakes. I've been assured that all further product development will take license compliance into account from the start, so while things may have taken a little longer than I'd have liked I think everything has worked out for the best.

Fri, 17 Sep 2010 18:07:18 UTC

USB runtime power management

Posted By Matthew Garrett

I've just committed some patches to the rawhide (not F14) tree that re-enable USB autosuspend on some devices. This set includes a workaround in the bluetooth input code that should handle the case where people were seeing their input devices become laggy when autosuspend was enabled, but there's still some chance that other bluetooth devices will behave slightly oddly. If that's the case then try:echo on >/sys/class/bluetooth/hci0/device/power/controland see if it improves things. If so then please file a bug and include information about the device you're trying to connect to.The other thing this patchset does is enable USB HCD runtime power management by default.

Wed, 15 Sep 2010 13:37:09 UTC

Thoughts on upstreams

Posted By Matthew Garrett

Last month I gave a presentation on the interaction between Android and kernel upstream at Linuxcon. The video for that is now available here (requires registration). Contrary to stories you may have heard, I do not dropkick anyone through a window.There's some parallels between the Android/upstream scenario and Canonical's approach to upstream. Mark wrote a lengthy defence of Canonical's focus on components that they feel need development, while not putting development effort into things they feel are good enough already. That's pretty consistent with the discussions I had with him at the Ubuntu development meeting in Oxford over six years ago.

Thu, 09 Sep 2010 21:43:34 UTC

Linux backlight control

Posted By Matthew Garrett

Backlight control is one of those things that you'd think would be simple, but ha ha this is computing so of course it's an utter disaster and everything is a huge mess. There's three main classes of backlight control in the x86 world, all of which have drawbacks:ACPI specifies a mechanism for backlight control, and the majority of modern machines implement it. It has the advantage that the brightness query interface is generally aware of anything else in the system which may have changed the brightness, so it's unlikely to get out of sync with reality if the platform tries to do something odd like change the backlight itself in response to an ambient light sensor or some other event.

Thu, 09 Sep 2010 13:58:36 UTC


Posted By Matthew Garrett

The last few months have been busier than I expected, resulting in various failures to get stuff done. The good news is that things are a little more relaxed now and I'm gradually catching up, but if you've emailed me and I haven't replied then you should probably do so again.A couple of updates - the source code for the Augen Android tablets I wrote about still hasn't been released, but the vendor does seem to be doing their best. Their supplier seems to be refusing to hand over the source code (they were given a tarball that was supposed to be it, but in fact just turned out to be the various GPLed bits of Android) and they're obviously stuck between a rock and a hard place.

Fri, 06 Aug 2010 20:44:00 UTC


Posted By Matthew Garrett

If you get messages like this:ACPI Error (psparse-0537): Method parse/execution failed [\_SB_._OSC] (Node ffff8801e8c62b30), AE_AML_BUFFER_LIMITthen you've fallen foul of one of the less appealing aspects of ACPI. _OSC methods are defined as methods to allow the operating system and the firmware to handshake over their support of optional features. Different _OSC methods apply to different types of hardware. CPU _OSC methods allow the operating system to inform the firmware that it supports ACPI 3.0 throttling states, while PCIe _OSC methods allow the operating system to indicate that it can manage native PCIe hotplug. The firmware can choose whether or not to give up control of these features, and the OS then has to cope.The problem arises when we get to the _OSC method on the system bus.

Thu, 29 Jul 2010 21:51:22 UTC

Kmart Android tablets and the GPL

Posted By Matthew Garrett

The Augen Android tablet being sold in Kmart stores at the moment is (shockingly) running a 2.6.29 kernel and Android 2.1 on top of that. It's also (shockingly) currently impossible to get hold of the source code for the kernel - Augen (whose corporate address is a small unit in Florida) say that the software comes installed on the units by the OEM and they don't have any access to the source either. This isn't an excuse, of course, and they say that they hope to have it on their website within the next few days - but even so, it seems that the Android device GPL violation trend is still on course.

Fri, 23 Jul 2010 19:22:22 UTC

Meego kernel watch

Posted By Matthew Garrett

sgx535 drivers in today's Meego kernel tree: 3 (GMA600, CE4100, N900)sgx535 drivers submitted upstream: 1 (Tungsten GMA500 driver, submitted March 2009, rejected due to significant chunks of functionality there purely to support closed userspace)To be fair, the rest of the Moorestown support code seems to be shaping up fairly nicely. But the lack of a coherent story about what graphics support is going to look like isn't hugely reassuring.

Mon, 12 Jul 2010 13:53:43 UTC

Power management at Plumbers

Posted By Matthew Garrett

I'm running a power management track at the Linux Plumbers Conference again this November. Unlike most conferences which focus on presenting completed work, Plumbers is an opportunity to focus on unsolved problems and throw around as many half-baked solutions as you want in order to try to find one that seems to stick. The suspend/resume problem in Linux is mostly solved[1], which means that it's time for us to focus on runtime power management and quality of service.This has been an especially interesting year in the field. We've landed the infrastructure for generic runtime power management, glued that into PCI and started implementing that at the driver level.

Tue, 29 Jun 2010 18:41:21 UTC


Posted By Matthew Garrett

It turns out that it's actually really, really easy to set up an l2tp tunnel. You just need to install xl2tpd, configure some address ranges and then add an authentication entry to chap-secrets. It's just that the entire known universe appears to be more interested in using ipsec as well, and that looks worse than setting up Kerberos and I've already done that enough in my life thanks. I don't care about my connection being encrypted (I've got encrypted protocols for that), so this seems to be an entirely reasonable solution.

Tue, 29 Jun 2010 17:37:04 UTC

The paradox of choice

Posted By Matthew Garrett

Searching for information on setting up an L2TP VPN takes me here, where I get to choose between OpenSWAN, KAME and some OpenBSD port. Searching for information on setting up a PPTP VPN takes me here, where I'm told exactly what I need to do.Given choices, I chose the one that reduced my choices. THERE IS A LESSON HERE.(Sadly, I'm now going to have to deal with L2TP anyway because something in the intermediate network is dropping GRE)

Fri, 25 Jun 2010 00:09:17 UTC

In better news

Posted By Matthew Garrett

The GNOME Foundation released their conference speaker guidelines today. This is an important step not just in helping speakers know what's acceptable, but also in helping audience members understand in advance what the community is likely to find objectionable and ensure that they can feel comfortable in raising concerns.Of course, guidelines mean little without enforcement. My original draft of these suggested that event runners be able to stop presentations if they felt they were gratuitously in breach of the guidelines. Opinions on this were fairly strongly split, with several people concerned that this effectively allowed individuals to immediately shut down presentations with little oversight.

Thu, 24 Jun 2010 16:10:37 UTC


Posted By Matthew Garrett

I've had the opportunity to look into the Joojoo tablet recently. It's an interesting device in various ways, ranging from the screen being connected upside down and everything having to be rotated before display, to the ACPI implementation that's so generic it has no support for actually attaching most embedded controller interrupts to ACPI devices and so relies on a hacked kernel that exposes individual interrupts as ACPI events that are parsed in userspace, to the ChangeOrientation binary that's responsible for switching between landscape and portrait modes containing gems like ps aux | grep fgplayer | grep -v grep and containing references to org.freedesktop.PandaSystem, a somewhat gratuitous namespace grab.

Tue, 22 Jun 2010 16:05:12 UTC


Posted By Matthew Garrett

The benefits of Meego's "Upstream first" policy are amply demonstrated by the Meego kernel tree now carrying two separate PowerVR drivers with significant quantities of duplicate code, neither of which is upstream.Wait. What?

Thu, 10 Jun 2010 19:39:51 UTC


Posted By Matthew Garrett

The WIndows 7 installer runs using vesa, in the wrong resolution and aspect ration, and does sub-pixel anti-aliasing anyway?

Mon, 07 Jun 2010 17:47:53 UTC

Lie Bot, what is the saddest thing?

Posted By Matthew Garrett

The saddest thing is a laptop firmware that provides a valid embedded controller operation region but which then proceeds to read and write embedded controller registers by banging on ioports itself rather than listening to the operating system.

Thu, 03 Jun 2010 14:03:58 UTC

Poulsbo still makes me sad

Posted By Matthew Garrett

Meego 1.0 was released last month. Predictably enough, it lacks any form of support for the GMA500 graphics chipset[1], which is reasonably in line with Intel's placing of US15W as an embedded product for MID-type devices rather than having anything to do with netbooks. Of course, the market pretty much ignored that detail, so we're left with the release of a netbook experience that's incompatible with a large number of netbooks.There's been hints that there might be some sort of new driver coming, though, and Intel's rapidly heading towards the release of Moorestown - their new MID platform that's x86 but not a PC, that replaces Poulsbo (unless you want to run Windows) and which has the same SGX 3D core[2] as Poulsbo.

Fri, 28 May 2010 14:46:41 UTC

10:45: Restate my assumptions.

Posted By Matthew Garrett

all software contains bugs.all bugs can be represented and understood through files.if you graph files against bugs, a pattern emerges. Therefore: We must reduce the number of files.

Fri, 14 May 2010 17:59:11 UTC

Using qemu to instrument Windows

Posted By Matthew Garrett

Part of the problem that we face in providing Linux hardware support is that we're lucky if there's a spec, and even if there's a spec there almost certainly isn't a test suite. Linux still isn't high on the list of things that vendors test with, so as a result hardware and firmware tend to be written to work with Windows rather than some more ideal notion of what a spec actually says.This can lead to all kinds of problems. If the spec says we can do something and Windows never does that, we'll often find that there's at least one piece of hardware out there somewhere that breaks in response.

Mon, 03 May 2010 23:19:56 UTC


Posted By Matthew Garrett

It turns out that even failing a Google interview isn't enough to keep Google recruiters away.

Mon, 03 May 2010 21:25:26 UTC

PCI power management problems

Posted By Matthew Garrett

I've previously written about some of the implementation details of runtime PCI power management. One of the key aspects for PCI devices is that the PME line on the device be able to generate a wakeup event. Unfortunately, it turns out that since Windows makes no use of this functionality at present, some vendors have started failing to wire this up. This is problematic because the device itself still announces PME support and will even raise a PME signal when it gets woken up - but it's pretty much screaming as hard as it can and nobody's listening because somebody's replaced the air with cheese.Bother, etc.The obvious question is what to do next.

Wed, 28 Apr 2010 13:07:05 UTC

Radeon reclocking update

Posted By Matthew Garrett

The code I mentioned here is now all in the drm-radeon-testing branch of drm-2.6.git.

Tue, 27 Apr 2010 23:28:02 UTC

Radeon reclocking

Posted By Matthew Garrett

Alex released another set of Radeon power management patches over the weekend, and I've been adding my own code on top of that (Alex's patches go on top of drm-next, mine go on top of there). I've left it stress-testing for a couple of hours without it falling over, which tells me that it's stable enough that I can feel smug. This is a pleasing counterpoint to the previous experiences I've been having, which have been rife with a heady mixture of chip lockups or kernel deadlocks. It turns out that gpus are hard.There's a few things you need to know about gpus.

Thu, 22 Apr 2010 22:33:51 UTC

Looks like I picked the wrong week to give up crystal meth

Posted By Matthew Garrett

One of the features of Windows 7 is that hitting windows+p will pop up a little dialog that allows you to configure your active display outputs. This is an improvement over previous versions of Windows, which would generally instead have a variety of random vendor-specific tools that would function differently, look ugly and make you cry. So, hurrah to Windows for moving into the 21st century.Most laptops have a display switch key. This is sent in a variety of ways, generally either via the keyboard controller, via WMI or via ACPI. In Linux we take all of these events and turn them into KEY_SWITCHVIDEOMODE, making it easy to implement standardised behaviour.This is, obviously, far too straight forward.Microsoft, rather than introducing an input mechanism that allows all of these events to hook into the windows+p infrastructure, provide the following recommendation:As documented in this Launchpad bug, vendors are starting to do this.

Fri, 26 Feb 2010 18:31:26 UTC

Nook update (again)

Posted By Matthew Garrett

Barnes and Noble released the nook source code last week. This includes the code to busybox, uboot and their kernel. Unfortunately, the uboot and kernel code both appear to be missing swathes of code found statically linked in the binaries that they're distributing. License compliance is hard, let's flail wildly.

Wed, 24 Feb 2010 19:21:58 UTC

You know it's a bad day when:

Posted By Matthew Garrett

ld gives you "Can not allocate memory".(turned out to be a corrupt object file)

Fri, 19 Feb 2010 21:35:36 UTC


Posted By Matthew Garrett

As I mentioned, I headed to Pittsburgh last week to give some talks at CMU and find out something about what they're doing there. Despite the dire weather that had closed the airport the day before, I had no trouble getting into town and was soon safely in a hotel room with a heater that seemed oddly enthusiastic about blasting cold air at me for ten seconds every fifteen minutes. Unfortunately, it seems that life wasn't as easy for everyone - ten minutes after I arrived, I got a phone call telling me that the city had asked CMU to cancel classes the next day.This turned out to be much less of a problem than I'd expected - whether because of their enthusiasm to learn about ACPI or because they simply hadn't noticed the alert telling them about the cancellation, a decent body of students turned up the next morning.

Wed, 17 Feb 2010 21:56:54 UTC

Gobi 2000

Posted By Matthew Garrett

Anssi Hannula posted a patch to add Gobi 2000 support to qcserial and provided me with support for gobi_loader. I've added the gobi_loader code here. You'll need Anssi's kernel patch from here, and probably also my followup patch with extra IDs from here. Note that the 2000 devices need an extra firmware file (UQCN.mbn) as well as the apps.mbn and amss.mbn files.The qcserial driver is currently broken in 2.6.32 and later. It's due to the switch to using kfifo for usb serial, but we haven't been able to work out the actual cause. I'm looking at alternative approaches.

Fri, 05 Feb 2010 18:54:34 UTC

Shaping young minds

Posted By Matthew Garrett

I'm off to CMU at the weekend, in order to do a couple of talks on Monday (the 8th). I'll be giving an introduction to ACPI to the operating systems class in the morning, and an open presentation on Fedora, some of the challenges we face and how to get involved in Linux in the afternoon. This is as a result of our cooperation with CMU, which has led to things like the request on the right. How could we refuse?

Wed, 03 Feb 2010 02:36:18 UTC


Posted By Matthew Garrett

Mon, 18 Jan 2010 23:00:00 UTC

Nook GPL update

Posted By Matthew Garrett

"We are currently working on getting the code shipped out, we have your shipping address on file and will ship the code out as soon as it is ready, this will be by the end of this month." 2/10, must try harder. Even ignoring the fact that it's taking the best part of two months to get from shipping binaries to shipping source, it'll be interesting to see which version of the firmware the source release corresponds to given that the 1.1.0 update included a new kernel.Speaking fo firmware updates - as shipped, the nook was a disaster. The firmware update improved things greatly, but I'm still stuck with cases where books render with the last couple of words in a page left out, and the order of books in the local content library is now based on last modification time rather than, say, author name.

Thu, 07 Jan 2010 15:53:36 UTC

ACPI drivers

Posted By Matthew Garrett

The article I wrote for lwn on writing ACPI drivers is now available for free.

Thu, 10 Dec 2009 23:33:38 UTC

Nook update

Posted By Matthew Garrett

My nook arrived today, along with an email asking for my shipping address in order to be sent a CD with the source on. So that's progress. The nook itself is an interesting device - it comes in impressively well produced packaging, which looks easily as attractive as any Apple product I've laid hands on lately. Except that it then includes a double-sided sheet of instructions in the outer packaging to tell you how to get the damn thing out.And so far, that seems like a pretty good summary of the device. There's a huge quantity of form here, but the function is lacking.

Tue, 08 Dec 2009 22:39:55 UTC

Barnes & Noble's GPL fun

Posted By Matthew Garrett

Barnes and Noble's new nook ebook reader is now shipping to people. Mine[1] is due to turn up tomorrow, but the instruction manual is available for download already. Quoting from it:Notwithstanding anything to the contrary in this Agreement, certain components of theSoftware are licensed subject to the General Public License Version 2.0, a copy of which is attachedas Exhibit A (the “GPL License”). You may not use these components except in compliance withthe GPL License. In addition, you may have additional rights with respect to such componentsunder the GPL License, including, without limitation, the right to obtain the source code for suchcomponents from us.

Fri, 20 Nov 2009 16:56:40 UTC

Why SHMConfig is off by default

Posted By Matthew Garrett

Bastien mentioned the Chromium OS xorg.conf file, which includes an irritating wart - namely, Option "SHMConfig" "on". This tells the Synaptics touchpad driver to export its configuration data to a shared memory region which is accessible to any user on the system. The reason for this is that in the past, there was no good way for configuration information to be passed to input drivers through the X server at runtime. This got fixed with the advent of X input properties, and synaptics can now be configured sensibly over the X protocol.But why was it off by default? Because, as I said, the configuration data is exported to a shared memory region which is accessible to any user on the system.

Thu, 19 Nov 2009 20:32:10 UTC


Posted By Matthew Garrett

If only eeepc-laptop sent standard keycodes, or something.Oh, wait.Writing a Linux distribution is hard. There's a huge range of interconnected dependencies. It takes a long time to learn how everything fits together, and fixing things properly rather than adding device-specific hacks often requires rewriting a lot of code. I'm sure Google will figure it out in time[1], and I'm also sure that the majority of their work is going into their UI rather than the underlying infrastructure.

Fri, 13 Nov 2009 14:32:35 UTC

Legacy PC design misery

Posted By Matthew Garrett

I've spent chunks of the last couple of days fighting a problem that's existed for about 25 years. The 8086 was a 16-bit processor with a 20-bit address space, limiting the maximum physical address that could be accessed to 1MB. However, quirks of the segmented memory system meant that addresses greater than 1MB could be constructed - these would wrap around to the bottom of memory. Because loading the segment registers was a time consuming operation, some programmers used this behaviour as a performance optimisation.The 80286 introduced 24 bit address space. Unfortunately, this meant that the addresses that previously wrapped to the bottom of memory now pointed at real addresses - not ideal if you were expecting the old behaviour.

Tue, 10 Nov 2009 14:58:52 UTC

The ACPI Embedded Controller

Posted By Matthew Garrett

Of course, the event model I described before is far too simple to be worthy of a place in the ACPI spec. At the most basic level, there's more possible events than there are GPEs to attach them to, so there's a need for some further complexity. This manifests itself in the form of the ACPI embedded controller (EC).The EC is typically a small microprocessor sitting on your motherboard, often implemented in the same hardware as the keyboard controller. It shares a lot in common with the keyboard controller - on PCs it'll usually appear in system io space, with one register for writing a command or reading a status, and a second register for passing data back and forth[1].

Tue, 10 Nov 2009 03:08:36 UTC

ACPI general purpose events

Posted By Matthew Garrett

ACPI is a confusing place. It's often thought of as a suspend/resume thing, though if you're unlucky you've learned that it's also involved in boot-time configuration because it's screwed up your interrupts again. But ACPI's also heavily involved in the runtime management of the system, and it's necessary for there to be a mechanism for the hardware to alert the OS of events. ACPI handles this case by providing a set of general purpose events (GPEs). The implementation of these is fairly straightforward - an ACPI table points at a defined system resource (typically an area of system io space, though in principle it could be something like mmio instead), and when the hardware fires an ACPI interrupt the kernel looks at this region to see which GPEs are flagged.

Mon, 09 Nov 2009 20:56:21 UTC

Looking to the past

Posted By Matthew Garrett

It's an oft-voiced suggestion that rather than looking at the bad things that happen in our communities, we should focus on the good things. There's a number of highly successful geek women already ¿ should we not be concentrating on encouraging more of them, rather than scaring people away with tales of thoughtlessness, discrimination and outright abuse?Let's draw an analogy. One day, a $20 charge appears on your credit card. You didn't make it. You report it to your credit card company, who assure you that they take fraud seriously and then do nothing. A few days later, another $20 charge. Your credit card company tells you that such events are rare, unrepresentative of the general credit card experience and continue to do nothing.

Wed, 28 Oct 2009 18:05:16 UTC

More GMA500

Posted By Matthew Garrett

But is Intel really the party at fault, here?For shipping a gpu without open drivers? Given that the alternatives involve someone else designing, fabbing and releasing a piece of hardware under Intel's name without being sued in the process, I'm going to have to say "Yes".(Note that while is a website owned by Intel, the writers don't appear to be Intel employees)

Mon, 12 Oct 2009 18:30:07 UTC

Asymmetries in offence

Posted By Matthew Garrett

I wasn't going to write about this since I thought that Chris's post covered pretty much everything I would have said, but after reading Scott's entry on how people would have interpreted Mark's remarks differently if he'd said "We'll have less trouble explaining to boys what we actually do" instead I realised that people are still confused about the fundamental issue here.The assumption that Scott's making is that "girls" and "boys" are semantically equivalent in this case. They're not. There's various ways in which the symmetry is broken, but the most basic one is that Mark's a straight man. When the overwhelming stereotype is that "we" as a community are heterosexual males, using "we" as a shorthand for "People who are straight men" is unfortunate because it supports that stereotype.

Thu, 24 Sep 2009 18:24:23 UTC

Intel IGD opregion and GMA500

Posted By Matthew Garrett

A while back, Intel defined a specification for binding ACPI-defined methods for controlling hardware to the OS-specific driver, ensuring that the two don't get out of synchronisation. I added support for this to the in-kernel i915 driver last year, and after a couple of awkwardnesses it works well now. One consequence of this that showed up slightly later is that it's necessary to do some of the setup from the i915 driver rather than the ACPI driver, which meant that we had to defer the ACPI driver from binding until the drm driver had done that setup.The problem with GMA500 is that it also implements the IGD Opregion spec, and the ACPI video driver detects this and refuses to bind.

Thu, 17 Sep 2009 00:04:36 UTC


Posted By Matthew Garrett

I'm off to Boston in under 16 hours, and I'll be getting into Portland around lunchtime on Monday. I'll be talking at Linuxcon about how we're broadening power management on Linux to be applicable from phones through netbooks up to supercomputers - that's 10:15 on Tuesday. At 10AM on Friday I'll be presenting at the Linux Plumbers conference on how userspace can express its requirements to the kernel more clearly, thereby allowing the kernel to be smarter about powering down hardware. And after a short hop down to SF for the weekend, I'll be back in Portland at the X developers conference talking about the role of X in providing relevant information to the kernel and using that to facilitate more aggressive power management.

Tue, 15 Sep 2009 11:16:36 UTC


Posted By Matthew Garrett

I'm moving to the US on Thursday, so I will be here on Wednesday evening from about 7. If your presence is unlikely to make me stupifyingly angry, feel free to join me.

Mon, 07 Sep 2009 14:13:20 UTC

Posted By Matthew Garrett

Good thing: VicodinBad thing: The broken arm that necessitates the vicodin

Tue, 25 Aug 2009 11:31:12 UTC

Posted By Matthew Garrett

I moved out today, and in a bit over a month should be firmly relocated in Boston. Which means a bit over a month of living and working out of bags, but I'm in a park, it's sunny and I'm relaxed enough that even working through Bugzilla isn't making me sad.

Tue, 11 Aug 2009 20:18:04 UTC

Defective by Design

Posted By Matthew Garrett

You know what's Defective by Design? Thinking that this kind of functionality is a good thing, resulting in this.

Mon, 27 Jul 2009 18:32:04 UTC

Posted By Matthew Garrett

Though people might be forgiven for having gained the opposite impression, I don't yearn for a future where open source development involves spending 25% of the time coding and 75% of the time where we have earnest conversations about the precise social nature of our utopian society and hold votes on whether to send polite but firm telegrams to people who accidently swore at some point in the recent past. I've never really yearned to live in a commune. I hate the idea of singing around campfires and there are many people who I never, ever want to be polite to.No.

Mon, 27 Jul 2009 03:09:55 UTC

Intel graphics in rawhide

Posted By Matthew Garrett

I've just committed some new Intel driver code to rawhide, which should be in the next kernel build. There's a chance that some people with Intel laptops will see some screen flickering. If you do, could you please file a bug against the kernel in the Red Hat bugzilla and make sure you Cc: me ([email protected]). Include the output of the xrandr command.

Fri, 24 Jul 2009 02:47:16 UTC

LCA 2010

Posted By Matthew Garrett

Depending on timezones, you currently have somewhere between 8[1] and 33[2] hours to submit a presentation for this year's Linuxconf Australia[3]. If you think you have something interesting to talk about, then do it and enjoy an unarguably top-tier Linux conference. Also, New Zealand is excellent.[1] Kiribati is weird.[2] For all those of you stuck on Howland or Baker islands. If you start swimming now you might reach civilisation before the conference starts.[3] In New Zealand, obviously

Thu, 16 Jul 2009 00:44:30 UTC

RMS and virgins

Posted By Matthew Garrett

Many of the comments here and here are disheartening, but part of the problem is that many people didn't see the presentation. Dave linked to a previous iteration of the same presentation[1]. Here's a transcription (errors are mine and mine alone):I am Saint Ignucius of the church of emacs. I bless your computer, my child. Emacs started out as a text editor. An extensible text editor, which became a way of life for many users because it was extended so much they could do all their computing work without ever exiting from emacs. And then, it became a religion, with the launch of the newsgroup alt.religion.emacs.

Sat, 11 Jul 2009 05:32:17 UTC

Simple conference organisation suggestion

Posted By Matthew Garrett

If you find the comments discussed here unacceptable, don't invite RMS to keynote at your conference without an explicit apology and expression of understanding beforehand. I'm seriously at the end of my patience with people being unwilling to call others on behaviour they perceive as unacceptable. Either make it obvious or accept that people will treat your failure to do so as implicit support.

Fri, 10 Jul 2009 15:47:11 UTC

Chrome OS

Posted By Matthew Garrett

It turns out that I was entertainingly wrong a while ago, though I persist in claiming that this is an utterly ridiculous idea and I should be forgiven for thinking that Google were sane. The whole thing really still doesn't make sense to me. Worthwhile support of hardware is difficult. I'm going to take it as a given that Google aren't going to claim to support arbitrary hardware. People who would never otherwise try Linux will install it, and the state of many Linux drivers is sufficiently poor that it'd do a great deal to damage their brand. The logical assumption is that it'll be available pre-installed on devices where Google have worked closely with the hardware vendors.Which concerns me somewhat.

Mon, 06 Jul 2009 18:07:00 UTC

What does the desktop want from the kernel?

Posted By Matthew Garrett

I'll be running a session on Wednesday at GCDS to find out what desktop developers would like to see from the kernel. There's a lot of interest in making things easier for file indexers, but if anyone has other problems that could be made easier with some level of kernel support then please turn up. No precise time or location yet, but probably around 3PM at the university. More details forthcoming.

Mon, 06 Jul 2009 17:18:10 UTC

Posted By Matthew Garrett

One of the strengths of the open source community is that so much happens in the open. It's generally easy to find out what's happening in a project and directly interact with the developers. Code is out in the public. People frown upon closed discussion and implementation. But there's also a cost. Personality conflicts get hidden in the corporate world. We air them in public. And while in some ways that's arguably an advantage, it also results in things like this.Now, to be fair, I've never been an especially big fan of Sam's work. His journalism generally leans towards lazy sensationalism rather than any attempt to actually understand the issues.

Thu, 25 Jun 2009 21:38:42 UTC

Posted By Matthew Garrett

I've had hard drives die before, but this one seems to be doing it in an especially pathological way. It started with the kernel throwing irq timeout errors and then stepped up into actual read errors, culminating in a corrupt journal, a read-only block device and a forced fsck. It's been behaving a little better since then, though occasional io stalls (without any kernel error) suggest that it's having to repeatedly retry some sectors. SMART says it's all fine, so obviously I'm backing it all up now before a new disk arrives tomorrow and I can sort out access to the data centre.

Wed, 24 Jun 2009 14:07:17 UTC

Posted By Matthew Garrett

I spent last week in the US, during which I discovered that my preconceptions of Albany as a post-industrial wasteland with no redeeming features was incorrect (it's actually a post-industrial wasteland with some decent bars), made minor contributions (mostly in the form of pesto) to a prize winning chalk picture and cycled on the wrong side of the road for the first time in a ridiculous number of years.But more relevantly, I spent most of the week trapped in Westford. One of the things I've been looking into lately is USB autosuspend, a kernel feature which allows devices to be powered down when they're not in use.

Tue, 23 Jun 2009 20:41:44 UTC

Posted By Matthew Garrett

It's now been over 6 months since Poulsbo hardware with Intel's GMA500 graphics core started shipping in volume. And we're still utterly lacking in any sort of worthwhile driver. It's an impressive turnaround from the recent days when the straightforward recommendation for mobile Linux hardware was "anything that has lots of Intel stuff in lspci", and while the Poulsbo situation in itself doesn't change that hugely it's potentially symptomatic of a worrying trend within parts of Intel.The first thing to realise here is that, like most large companies, Intel consists of a large number of business units with different priorities. Their open-source technology center has historically had responsibility for providing Linux support for hardware, but this obviously depends on other business units cooperating with them.

Wed, 10 Jun 2009 14:41:10 UTC

Palm Pre

Posted By Matthew Garrett

I'm in the UK and even if I weren't I wouldn't be using a CDMA phone, but the Palm Pre is undoubtedly an interesting device and so I've spent a short while looking at the root filesystem that can be extracted from the downloadable ROM image. There's some interesting things there. Bear in mind that this could be some QA internal image, so chunks of what I talk about may be wrong - on the other hand it seems to have been produced in May, so it's probably pretty close to what's shipping.HardwareAs others have figured out by now, the Pre is codenamed Castle and there's some references to another device called Pixie.

Tue, 09 Jun 2009 15:24:03 UTC

Antler customer service

Posted By Matthew Garrett

In what makes a surprising change from my normal bitching about customer service, I called Antler last week after the rubber coating on the wheels of my luggage disintegrated. I've had that bag for almost 5 years and travelled something like 300,000 miles in that time, so it wasn't an especially surprising result - but the bag had a 7 year warranty covering defects in materials and manufacture, so they picked it up last week and dropped off a new one today. I'm impressed.

Mon, 04 May 2009 00:53:57 UTC

Thinkpad mixers

Posted By Matthew Garrett

Older (up to the *60 series) Thinkpads have a slightly odd mixer setup. There's a mixer stage that sits between the software controllable mixer and the speakers. This is controlled by the firmware in response to the volume keys being hit and can't be prevented by the OS. This is unfortunate, since users are quite enthusiastic about seeing an on-screen display when they hit various keys and if we do the obvious thing and map the volume keys to KEY_VOLUMEUP and KEY_VOLUMEDOWN then they get the OSD but also get their software-controlled mixer changed at the same time as their firmware-controlled mixer.

Sun, 19 Apr 2009 00:32:55 UTC

Extended Qualcomm Gobi features

Posted By Matthew Garrett

And while I'm on the subject of bitching about hardware support, I had some time to poke at the Qualcomm Gobi hardware a bit more last week. With the aid of Dan Williams of Network Manager fame we identified[1] that the hardware actually does rather more than is obvious from the qcserial driver. There's two extra ports - one is for diagnostics, and the other claims to be an NMEA port. Poking support for these into qcserial is easy enough, but they don't seem especially chatty. The more interesting factor is that the fourth interface on the endpoint is a network device.

Fri, 17 Apr 2009 00:14:18 UTC

Intel's commitment to open source driver support

Posted By Matthew Garrett

By and large, working with Intel is a pleasure. In fact, a while ago I said so in a fairly obvious way. So it's a shame that the support for Poulsbo is still an absolute fucking mess with absolutely no obvious end in sight. Intel's Moblin group (the people who seem to be closest to having responsibility for providing any public Linux support for that hardware, though it's really not clear if they've got any more say in this than I do) have a kernel team that don't want or need a git tree despite having someone who's working on forward porting the driver to modern kernels - probably a job that requires more than one person given what a godawful fucking mess the last public release was, but it'd at least be nice to see what the current state is.

Sat, 04 Apr 2009 18:05:15 UTC

HP EliteBook 2530p

Posted By Matthew Garrett

HP apparently decided my 2510p was cursed and replaced it with a 2530p which arrived earlier this week. A bit of playing later and it all seems pretty happy. Backlight control works fine, though you'll need hal-info git to get the hotkeys working out of the box. Sound needs alsa from 2.6.30 or for snd_hda_intel to be loaded with the "model=laptop" parameter. Suspend seems to work out of the box. Hotkeys and rfkill work with hp-wmi. The webcam is supported by the uvcvideo driver. The wwan modem needs qcserial from 2.6.30 and a tool for loading the firmware. It's happy to boot from EFI which probably saves a second or so of boot time.

Sat, 04 Apr 2009 16:26:31 UTC

Qualcomm Gobi firmware loading

Posted By Matthew Garrett

Shortly after I posted this entry on the qualcomm modem driver, Alexander Shumakovitch posted a shell script to do the loading. I've turned this into a C app and added checksumming support and udev integration, and now things seem to be working happily. There aren't many device IDs in the qcserial driver upstream right now, but I've just sent a patch to add a bunch. If you have a device this works for and you had to add the ID manually, let me know and I'll update things. You can get it here.

Thu, 02 Apr 2009 18:43:23 UTC

The curious tale of the driver that did nothing

Posted By Matthew Garrett

Several vendors are now shipping Qualcomm's Gobi chipset, a cunning dual CDMA-GSM wireless broadband device. There's a driver for it in the Linux kernel called qcserial which claims to support it.Do not be fooled. This driver is a vile lie.The hardware comes up in a dumb state and requires firmware to be loaded before it'll do anything. The only way to obtain this firmware is from a Windows driver. The only way to load this firmware is under Windows. This isn't helpful, especially given that it drops the firmware whenever you use rfkill or suspend or power down the machine. In fact, the only way you can use this driver is to boot Windows, let it load the firmware, reboot into Linux, get online and then never turn off or suspend your computer or the radio.So, don't be like me - swearing viciously and trying to generate useful USB packet ...

Sat, 28 Mar 2009 03:39:41 UTC

Posted By Matthew Garrett

"Open"Solaris. Especially ironic given that there's a 2-clause BSD implementation out there already.

Fri, 27 Mar 2009 00:21:51 UTC

Reducing disk use

Posted By Matthew Garrett

UNIX filesystems generally store three pieces of timing information about files - ctime (when the file was changed in any way), mtime (when the file contents, as opposed to its metadata, was last changed) and atime (when the file was last accessed by any process). This is a usefully flexible system, but the semantics of atime can be troublesome. atime must be updated every time a file is read, causing a read operation to instead become a read/write operation. This results in a surprising amount of io being generated in normal filesystem use, slowing the more relevant io and causing disks to spin up due to atime updates being required even if the file was read out of cache.

Tue, 24 Mar 2009 23:59:00 UTC

Posted By Matthew Garrett

Today is Ada Lovelace day, a project to celebrate the women involved in technology and make it easier to give examples of female role models in the industry. I've had the opportunity to meet many women working on Linux over the past few years, and if there's one thing that's tended to overshadow the achievements and dedication to their work it's the sheer amount of effort they've had to go to in order to gain equal recognition. And that made me realise that in many ways, the woman who's had the greatest impact on my career is Hanna Wallach[1]. About ten years ago she spent a ridiculous amount of effort teaching me that it didn't matter how much I professed to be entirely free of sexism if I then proceeded to do things that implicitly excluded women from being involved in computing communities.

Wed, 18 Mar 2009 18:59:53 UTC

ext4 and spinups

Posted By Matthew Garrett

As a followup to my discussion of ext4, I did some trivial testing today. This consisted of generating a file, writing to it, closing it, opening another file, writing to it, closing it and then renaming the second file over the first. Then repeating about 10,000 times. fsync() wasn't called at any point. I used the /proc/sys/vm/block_dump knob to get an idea of when stuff was actually hitting disk. This was using the current rawhide kernel, which has the various workarounds for avoiding data corruption merged. The good news is that I was unable to get into an inconsistent state - the files always contained either the original or the new data, and the absolute worst case was having a zero length temporary file.

Wed, 18 Mar 2009 02:27:06 UTC

Important typographical update

Posted By Matthew Garrett

¿Unicode 5.1 added the inverted interrobang¿

Sat, 14 Mar 2009 21:04:01 UTC

ext4, application expectations and power management

Posted By Matthew Garrett

Edited to add: Sorry, it turns out that ext4 does now have a heuristic to deal with this case. However, it seems that btrfs doesn't. My point remains, though - designing a filesystem in such a way that a useful behaviour is impossible is unhelpful for the vast majority of application writers, even if it does improve performance in some other use cases.Original text:There's been a certain amount of discussion about behavioural differences between ext3 and ext4[1], most notably due to ext4's increased window of opportunity for files to end up empty due to both a longer commit window and delayed allocation of blocks in order to obtain a more pleasing on-disk layout.

Fri, 06 Mar 2009 04:46:26 UTC

Posted By Matthew Garrett

After a bit of back and forth with Peter, we came up with a straightforward way of dealing with the fact that the Wacom driver needs a logical input device per input type[1], but the X server only generates an input device per hal device. The simplest solution turned out to be a hal callout that generates additional hal devices on demand, which also means we can add information to the fdi files to only add the appropriate device types. Ought to land in rawhide in the near future, at which point tablets should be basically working out of the box.

Mon, 23 Feb 2009 18:43:34 UTC


Posted By Matthew Garrett

Minor Fedora updates - I fixed up the FDI file in the wacom package, so tablet PCs should have a working stylus out of the box in rawhide. The eraser won't work right now - the driver needs some reworking to bind multiple X devices to a single logical input device. I've also added support for brightness control via smartdimmer to nouveau, which should increase the number of machines that have working brightness control. I don't think this has landed in the rawhide kernel yet, but should do soon. There's the potential for some conflict with the mbp_nvidia_bl driver. We may end up dropping that.HP updates - The button bar on my 2510 got replaced last week.

Thu, 19 Feb 2009 01:29:01 UTC

Posted By Matthew Garrett

In other news, my HP 2510p's screen was replaced last month after the hinge snapped. A chunk of plastic off the hinge cover snapped off two days ago. I'm somewhat puzzled by this, since I can't see any plausible way force could be applied to it - it's as if it came away slightly and then got crushed when I tried to close the lid. On top of the motherboard having been replaced 4 times now (twice due to faulty power connectors, one due to the fan being replaced and the motherboard being swapped at the same time, once because the machine started refusing to boot at LCA) and it still being slightly tempremental when booting, I'm not overly impressed - especially when I've only had it 18 months.

Thu, 19 Feb 2009 01:18:20 UTC

Posted By Matthew Garrett

Aside from the inherent humour in Opensolaris's attempt to migrate to a 15 year old shell, today brings the thrilling news that I'll be moving to Boston to join the engineering team in Westford, MA. I look forward to the Applebee's.

Sun, 01 Feb 2009 04:51:41 UTC

Posted By Matthew Garrett

I'm sitting on a plane. The screen in front of me is currently displaying X root weave. Xorg fo life, yo.

Thu, 29 Jan 2009 09:31:01 UTC

Posted By Matthew Garrett

One of the points I made in my presentation at LCA this year was that for power management to be effective, it needs to be something that works without anyone having to think about it. One aspect of that is ensuring that it doesn't get in the way of the user, since otherwise the user will eventually get irritated and turn it off. Part of my work at Red Hat is coming up with ways to not only offer power management functionality, but to make it sufficiently useful and inobtrusive that manual configuration is almost never required.Screensavers are an interesting case.

Mon, 26 Jan 2009 11:58:00 UTC


Posted By Matthew Garrett

Intel have a magic communciation channel between the system firmware and the graphics hardware. It's based on a region of shared memory and judicious use of interrupts, and it's documented here.Nvidia have a magic communication channel between the system firmware and the graphcis hardware. It's based on WMI and bonghits, and it's not documented.Why, yes, I have spent half the day trying to work out how the NVIF method works.

Thu, 22 Jan 2009 13:33:57 UTC

Posted By Matthew Garrett

I had a deeply fucked up dream last night. For some reason we'd paid huge quantities of money to obtain nothing of value and George W Bush had been president for 8 years. I clearly need to drink less.

Tue, 20 Jan 2009 05:52:39 UTC

Posted By Matthew Garrett

Hey! My laptop's died again! Neat!

Fri, 09 Jan 2009 18:19:36 UTC

Posted By Matthew Garrett

Dear HP,How does "Next business day warranty" translate into it being somehow acceptable for you to be unable to source a replacement part until February, especially when I reported the problem at the end of December?No love,Matthew.

Sun, 04 Jan 2009 02:23:19 UTC


Posted By Matthew Garrett

While it's obvious that being a kernel developer is absolutely the best thing anyone in life could ever aspire to, I'm finding it increasingly difficult to justify not having just given up and gone off to be an analyst instead. Two stories stuck with me this week. The first claims that we can expect Android netbooks to be on sale within a year or so. The reasoning behind this? Android runs on x86 and has a MID profile. Oh, yeah, and it sounds like a cool idea. Sure, we need to ignore straightforward facts like, oh, I don't know, it being UNSPEAKABLY PAINFUL TO DO OS DEVELOPMENT ON ARM, and hence it being NO SURPRISE WHATSOEVER TO FIND THAT BUILDS AND RUNS ON COMPUTERS THAT ACTUALLY GO FAST AND SIT ON PEOPLE'S DESKS.

Sat, 27 Dec 2008 22:25:11 UTC

Posted By Matthew Garrett

So. Burning down the house. Uniquely Welsh concept[1] or near-inevitable consequence of design failure? I present the following:Innocent Christmas ornament or HARBINGER OF DOOM?Note how the candle descends into the foliage. There's a good inch and a half of candle left there, embedded into a block. The foliage is, in fact, plastic. The block it's embedded into is some sort of hydrocarbon-based foam. It turns out that lighting one of these and leaving it for a while is a good way to trigger all kinds of excitement. Of the "Goodness me, there appears to be a large lump of petroleum byproduct burning quite vigorously in the hall" variety.The software design moral: Everything is shit and will attempt to kill you when you're not lookingNow.

Fri, 26 Dec 2008 02:37:52 UTC

Posted By Matthew Garrett

Christmas is a time to ignore such trifling details as nearly accidently burning the house down, and instead to focus on what's important in life - working out which hoops to jump through to make new hardware useful without installing less convenient operating systems. This year was more straightforward than some, and merely involved attempting to work out how to give people money in return for books that could then be read on my Sony reader thingy. Shockingly enough, the Sony Ebook Store requires a windows app, so not a good start. There's no shortage of sites that sell ebooks in a variety of formats without any platform dependent awkwardness, though - of course, most of them are inconveniently DRMed.

Sun, 14 Dec 2008 09:11:35 UTC


Posted By Matthew Garrett

Dear humanity,When I provide shower-related metaphors about software design, it is because I am interested in software design. Not showers. Except to the extent that showers make me clean, which is beneficial from a functional aspect but still not the point.

Sat, 13 Dec 2008 23:48:16 UTC

Showers and UI design

Posted By Matthew Garrett

Travelling rather a lot this year has left me spending plenty of time staring at showers[1]. There seem to be three broad categories of shower UI design. The first is the one that exposes the raw functionality of the underlying implementation:(image by bean, reused under cc-by-nc 2.0)Showers work by mixing hot and cold water and feeding them through a shower head. This implementation allows direct control of the hot and cold feeds. The user can obtain any combination of pressure and temperature that the supply contraints make possible, but at the cost of it being impossible to adjust single variables. Changing the pressure without changing the temperature is difficult.

Thu, 11 Dec 2008 06:45:21 UTC

Worrying realisations

Posted By Matthew Garrett

The entire lifecycle of Ultrix from first to last release was on the order of 12 years.I first ran Linux in 1995.

Thu, 04 Dec 2008 02:57:43 UTC

In other news

Posted By Matthew Garrett

Travel plans:7th December - 11th December - Boston. And Westford. Sob.11th December - 15th December - New York18th January - 25th January - Hobart (LCA)25th January - 1st February - Melbourne, probably. But who really knows?1st February - 4th February - San Francisco6th February - 8th February - Brussels (FOSDEM)And that's currently it. Anywhere else I should be? GUADEC's probably a given, but otherwise this is your opportunity to ensure that my bed lies cold and empty for large periods of the year.

Thu, 04 Dec 2008 02:36:44 UTC

Advantage of Linux over Solaris

Posted By Matthew Garrett

In response to this:Idle power draw of Fedora 10: 100WIdle power draw of Opensolaris 2008-11: 135WSure, there are other arguments. But with energy prices the way they are, choosing Solaris is choosing to spend significantly more money on your hosting. Remember to factor that into your TCO calculations.(Testing done on a 4-way AMD with a Radeon X1900 graphics card, which is what I happen to have to hand. Out of the box configuration.)

Tue, 02 Dec 2008 16:22:28 UTC

Posted By Matthew Garrett

Life imitates Team America.

Tue, 02 Dec 2008 03:28:00 UTC


Posted By Matthew Garrett

ICH8 docs, section eliminate the audible noise caused by aggressive voltage ramps when exiting C4 states at a regular, periodic frequency, the ICH8 supports a method to slow down thevoltage ramp at the processor VR for certain break events.Sounds good. Section Bit 6 Slow-C4 Exit Enable –When 1, this bit enables the Slow-C4 Exit functionality.Well, hey, we can quirk this on and make life better for everyone oh wait section 0 C-STATE_CONFIG_LOCK: When set to 1, this bit locks down the C-State configuration parameters. The following configuration bits become read-only when this bit is set:...The entire C4 Timing Control Register (C4_TIMING_CNT)Thanks, Intel.

Mon, 01 Dec 2008 21:49:07 UTC

Posted By Matthew Garrett

Aigars:1703 called. They wanted to let you know that you haven't been paying attention to modern linguistic trends.

Tue, 25 Nov 2008 16:06:33 UTC

Unexpected results

Posted By Matthew Garrett

On my test setup, disabling the blinking cursor in Gnome saves me 2 Watts.

Mon, 24 Nov 2008 15:48:40 UTC

Good power management practices

Posted By Matthew Garrett

Based on feedback from my last couple of posts, I've written a guide to some good power management practices. It's aimed at people implementing desktop environments and power management interfaces for the most part, rather than end users or driver developers. Any suggestions for additions or corrections happily received.I'm not aware of any OS that currently gets all of these correct.

Sun, 23 Nov 2008 16:49:43 UTC


Posted By Matthew Garrett

Sebastian Kügler dissects my dissection, except in fact he appears to be responding to a pile of stuff I didn't write.First of all, Matthew assumes that the setting "powersave" will actually use the powersave cpufreq governor - citation needed.the "conservative" governor, which indeed is an "ondemand" governor, meaning it gives you the extra needed CPU power when you ask for it - more slowly than ondemand does, resulting in extra power draw. Never run conservative unless your P-state latency is so high that ondemand won't work.Powerdevil doesn't offer such option, so Matthew will be happy about this item - I didn't say it did.

Sun, 23 Nov 2008 14:45:30 UTC

Making sure we do power management the right way

Posted By Matthew Garrett

I saw a posting about PowerDevil, the new KDE power management interface. It's somewhat disheartening - for the most part, it falls into the same traditional errors made in power management (ie, letting you change cpufreq settings, using "presentation" as a power management setting rather than getting applications to actually do the right thing). But my point isn't to bitch about PowerDevil. My concern is more about why we're still failing to get the message across about certain power management myths. Implementing power management incorrectly leads to wasted power, dead polar bears and wet carpets. It's important that we get this right.To a first approximation, the Powersave governor will only save you power if you're playing 3D games.

Thu, 20 Nov 2008 23:39:12 UTC

Separated at birth?

Posted By Matthew Garrett

Christoph HellwigNuclear Man from Superman IV

Tue, 18 Nov 2008 20:20:25 UTC

Aggressive graphics power management

Posted By Matthew Garrett

My current desktop PC has an RS790-based Radeon on-board graphics controller. It also has a Radeon X1900 plugged in. Playing with my Watts Up, I found that the system was (at idle!) drawing around 35W more power with the X1900 than with the on-board graphics.This is clearly less than ideal.Recent Radeons all support dynamic clock gating, a technology where the clocks to various bits of the chip are turned off when not in use. Unfortunately it seems that this is generally already enabled by the BIOS on most hardware, so playing with that didn't give me any power savings. Next I looked at Powerplay, the AMD technology for reducing clocks and voltages.

Sat, 15 Nov 2008 20:36:02 UTC

And another thing

Posted By Matthew Garrett

I swear I'm going out in a minute, but:Running strings on the firmware for a Dlink wireless bridge I have gives output that includes the following:From isolation / Deliver me o Xbox - / Through the ethernet Copyright (c) Microsoft Corporation. All Rights Reserved. Device is Xbox Compatible. Copyright (c) Microsoft Corporation. All Rights Reserved.. This confused me for a while until I plugged it into an Xbox 360 and discovered that despite it being plugged into the ethernet port, I could control the wifi options including network selection and encryption method. Does anyone have the faintest idea how this is implemented?

Sat, 15 Nov 2008 18:35:11 UTC

Hybrid suspend

Posted By Matthew Garrett

One often requested feature for suspend support on Linux is hybrid suspend, or "suspend to both". This is where the system suspends to disk, but then puts the machine in S3 rather than powering down. If the user resumes without power having been removed they get the benefit of the fast S3 resume. If not, the system resumes from disk and no data is lost.This is, clearly, the way suspend should work. We're not planning on adding it by default in Fedora, though, for a couple of reasons. The main reason right now is that the in-kernel suspend to disk is still slow.

Sat, 15 Nov 2008 18:01:04 UTC

Adventures in PCI hotplug

Posted By Matthew Garrett

I played with an Eee for a bit last time I was in Boston, culminating in a patch to make the eeepc-laptop driver use standard interfaces rather than just having random files in /sys that people need to write custom scripts to use. The world became a better place.However. Asus implemented the rfkill control on the Eee in a slightly odd way. Disabling the wifi actually causes the entire card to drop off the bus, similar to how Bluetooth is normally handled. The difference is that the Bluetooth dongles are almost exclusively USB, while the Eee's wifi is PCI. Linux supports hotplugging of PCI devices, but nothing seemed to work out of the box on the Eee.

Mon, 10 Nov 2008 12:38:19 UTC


Posted By Matthew Garrett

As a brief introduction to this - I first read through the Android code when interviewing with Google for an opening with the Android kernel team. I didn't get the job, and while I don't think anything that follows here is as a result of residual bitterness you might want to take some of it with a pinch of salt.Anyway. Android is a Linux kernel with a heavily customised user layer that bears little resemblance to any traditional Linux system. I write in C because using pointer arithmetic lets people know that you're virile so this Java-like thing is of little interest to me and I'm going to ignore it and just look at the kernel, because after all that's what I'm paid to be good at.The short summary of the rest of this post is that I'm not planning on giving up my iphone yet.The Android kernel source lives ...

Sun, 02 Nov 2008 12:16:11 UTC


Posted By Matthew Garrett

First, let me make one thing clear. This isn't constructive criticism. This is just criticism. It's directed at software that's so wrong-headed that there's no way to make it significantly better, and everyone involved would be much better spending their time doing something else instead of trying to fix any of what I'm about to describe. It's not worth it. Sit in a park or something instead. Meet new and interesting people. Take up a hobby that doesn't involve writing shell scripts for Linux. You'll be happier. I'll be happier. Everyone wins.Anyway. I wrote about Automatix some time ago. It died and the world became a better place.

Thu, 23 Oct 2008 14:16:46 UTC

Keyboard handling

Posted By Matthew Garrett

The Linux desktop currently receives (certain) key events in two ways. Firstly, the currently active session will receive keycodes via X. Secondly, a subset of input events will be picked up by hal and sent via dbus. This information is available to all sessions. Which method you use to obtain input will depend on what you want to do:If you want to receive an event like lid close even when you are not the active session, use dbusIf you only want to receive an event when you are the active session (this is the common case), just use X events

Tue, 07 Oct 2008 01:44:22 UTC

Posted By Matthew Garrett

Things:I'll be speaking at the UKUUG Linux conference in Manchester this November.The ACM have chosen my article on power management from Queue last year as a shining example of such things, and republished it in Communications where you may now peruse it at your leisure. Fanmail may be sent to the usual addresses.I'll be in Boston from the 7th to 11th of December, and New York from the 11th to 15th. I will be endeavouring not to break any bones in the process. Might actually ensure I have travel insurance this time.I'll be presenting at LCA next January. Current plans involve spending a week in Melbourne afterwards and a few days in San Francisco on the way back.Things I want to do:Visit Iceland.

Fri, 03 Oct 2008 02:00:00 UTC

Posted By Matthew Garrett


Thu, 25 Sep 2008 02:48:51 UTC

Posted By Matthew Garrett

Russell writes about the iphone. I think he's missing a few things.The open nature of the PC wasn't inherently what brought it greater success. The open nature of the PC meant that it could spawn an ecosystem of third party hardware vendors, sure. It also meant that it could be cheaply cloned by other manufacturers, ensuring competition that drove down the price of hardware. The net result? x86 is ubiquitous, sufficiently so that even Apple use a basically standard[1] x86 platform these days. Low prices and the wide availability of software that people wanted to run bought the PC the marketplace, with Microsoft being the real winners.

Mon, 08 Sep 2008 00:08:00 UTC

Posted By Matthew Garrett

Not being from Oakland, Meth has a relatively small impact on my life. Until I get a cold, at which point I get to curse the lack of effective drugs. What's surprising is how phenylephrine does have a noticable effect. What's even more surprising is that it has this effect about thirty seconds after I've swallowed the capsules, indicating fairly strongly that it hasn't actually hit my bloodstream in any sensible way at that point (though I've had astonishing difficulty in finding figures on how long the plastic capsules take to dissolve in the stomach). So, even though I know it's got no measurable effect beyond that of a placebo, the placebo effect still works.

Sat, 06 Sep 2008 15:58:45 UTC


Posted By Matthew Garrett

and, by the looks of it, may be for some time:Yes, the track is underwater. Sigh.

Fri, 05 Sep 2008 14:46:13 UTC

Power management and graphics

Posted By Matthew Garrett

It's the X Development Summit in Edinburgh this week, so I've been hanging out with the graphics crowd. There hasn't been a huge amount of work done in the field of power management in graphics so far - Intel have framebuffer compression and there's the lvds reclocking patch I wrote (I've cleaned this up somewhat since then, but it probably wants some refactoring to avoid increasing CPU usage based on its use of damage for update notifications). That still leaves us with some fun things to look at, though.The most obvious issue is the gpu clock. Intel's chipset implements clock gating, where unused sections of chip automatically unclock themselves.

Wed, 27 Aug 2008 01:24:47 UTC

Posted By Matthew Garrett

Jesus fuck, Dell, why do you have a WMI event interface that seems to do nothing but pass back things that look awfully like keyboard scancodes? I mean, E045? Come on, now.Driver forthcoming for those who really want the little battery button on their Precision M6300s to work.

Thu, 14 Aug 2008 18:38:30 UTC

Posted By Matthew Garrett

What amuses me about complaints about censorship is that they often seem to be associated with, uhm, censorship. Compare and contrast:Bored now.

Thu, 14 Aug 2008 11:47:16 UTC

Things I have learned in the past 24 hours

Posted By Matthew Garrett

Websites that claim you'll never be able to get them taken down are quite easy to get taken downLegal threats are an excellent way of obtaining informationThe IP address used to subscribe me (and several others) to a vast number of mailing lists was Which seems to belong to Ryan Farmer. "Fucking hero", my arse.Edited to add:07-08-2008 03:25:56 -!- [email protected] has joined #ubuntu-kernel$ host has address in case anyone thought I was being unfair here.

Wed, 13 Aug 2008 20:16:49 UTC

Posted By Matthew Garrett

To the lovely person who subscribed me to around 200 mailing lists this evening:I will find you.

Wed, 06 Aug 2008 18:13:03 UTC

Posted By Matthew Garrett

Testing 2.6.27-rc2 with the current released (not development) BIOS on the Foxconn G33M reveals the following:There are no ACPI errors on boot, other than the (irrelevant) OEMB table (there are in previous kernels, stuff's clearly been fixed in .26 or so. Can't really be bothered digging through to find out what)The system fails to reboot if it has been suspended and resumed. The fix is three lines long, one of which is a comment and one of which is blank.The system is otherwise perfectly stable.Summary: Almost all problems caused by bugs in Linux, one problem caused by BIOS vendors interpreting the ACPI specification differently to the Linux implementation and trivially worked around.

Fri, 01 Aug 2008 18:47:15 UTC

Posted By Matthew Garrett

Coincidentally, I had the opportunity to poke at a machine that actually does deliberately treat Linux differently in its ACPI tables today. Jeremy was poking at an Acer Aspire One before installing Fedora on it, and Dave noticed that it printing a bootup message indicating that the firmware was testing for _OSI("Linux"). A bit of poking later, and we have the following: If (_OSI ("Linux")) { Store (0x03E8, OSYS) Store (0x0A, \_SB.PCI0.LPC.S4TM) Store (0x43, \_SB.PCI0.EXP2.PXS2.LSMP) Store (One, \_SB.PCI0.EXP2.LL0S) Store (One, \_SB.PCI0.EXP2.LLL1) } Else ...

Thu, 31 Jul 2008 20:01:23 UTC

Posted By Matthew Garrett

Various people have asked me why there'd ever be a justification for ACPI tables to base various types of behaviour on the operating system they're running on, and why Linux claims to be Windows. There's pretty straightforward explanations that don't involve conspiracies, but they're not necessarily obvious. Let's start from the beginning.ACPI provides two mechanisms for determining the OS, _OS and _OSI. _OS is an ACPI object containing a string. This string is supposed to represent the operating system. Windows 98 contained "Microsoft Windows", NT4 "Microsoft Windows NT" and ME "Microsoft WindowsME: Millennium Edition". All later versions of Windows contain "Microsoft Windows NT".