Groveronline

Uhhh………what?

Flower

Amazon Remembers, kinda scary

Amazon has an iphone app. Their app lets you take pictures of things, and then they match it to products they sell.

Holy S$^@!

Undoubtedly they’re using Mechanical Turk to have bored humans do the matching. That system has been in place for years, and I even gave it a try to get a bunch of candidate names for a new band a while back. So how’d it do?

  1. Picture of Star Wars Trilogy DVD set: successfully matched.
  2. Picture of old combo VHS/DVD player’s manual: matched to current model.
  3. Picture of Netflix envelope of 3:10 to Yuma DVD: no match
  4. Picture of Abby, our cat: no match

Kinda surprised about #3.

All I can say is I hope they have some sort of skintone-screening technology in front of the human Turkers, because I’m sure there are gonna be a lot of bored college students takin’ picture of their schlongs…

Wow.

I watched this three times. Brilliant.

Beware of pocket lint

I have just fished a 4mm plug of pocket lint out from the headphone jack in my iPhone. This lint was preventing full insertion of the headphones. I imagine that pushing down even harder to get them so sit properly just made the lint extraction that much more difficult. I used a needle to dislodge it, and then made the mistake of sucking on the hole like a straw, thus ending up with lint-in-the-mouth.

Note that I am still anti-case for the iPhone — a case wouldn’t have helped anyways since the headphone jack would still have been exposed to pocket lint.

New Blog

Jen was kind enough to get a Wordpress blog set up for me, so I don’t need to use LiveJournal anymore! Thanks Jen!

I’ve just imported my LJ posts into Wordpress. It was kind of a pain.

First I tried a python script called ljdump. This downloaded the entries, but not in a format that Wordpress’s Livejournal importer would accept — maybe formats have changed? Dunno.

Next I tried jbackup, a perl script that was supposed to do the same thing. This looked a little more substantial, had some help, that kinda thing — but again, Wordpress would not import the entries!

Finally I resorted to ljArchive, a Windows program that was able to export to an XML file that allowed Wordpress to import both entries and comments! Yay. I feel a little dirty since I had to resort to a Windows app, but hey it worked and now I can get on with my life.

Joe The Plumber

Maybe Joe the Plumber would be interested in speaking at next year’s Linux Plumbers Conf?

LPC day 1

Keynote by gregkh: too hard on Canonical. I think Ubuntu has been great for Linux. The first step to hacking the kernel is to be a Linux user, and Ubuntu has helped make Debian & Linux accessible to a much wider audience.

The second step is for those new users to go beyond apt-get and start playing with upstream code from the git/hg repos. I don’t care a whit if Canonical contributes at all if they encourage a wave of new contributors. Ubuntu still makes hacking the kernel too hard. How about a working /sbin/installkernel so make install works?

Other than that, Audio MC was good (I learned stuff and wish I had time to contribute!) Track 3 talks were good, and git tutorial was long but worthwhile.

Anyone know how to tell git grep to use color, like git diff does?

Now, just time to catch up on work email (btw no probs with wireless at LPC) and start day 2 in 8 hrs.

Bad Trees playing tonight

bad trees poster

Check our music out!

PLUS: we’re debuting out new song Big Fat!

This is going to be our last gig for a while, so come on out. I recommend getting there 9:30ish.

Cats and headphones

We have a new kitten named Abby whom we love very much but who has turned out to be quite precocious. And she likes to chew things.

I thought this was fine (cute, really) but I noticed today that my headphones were only coming in on one side. Hmm, weird. Hey, what’s this gash in the cord with teeth marks all around it??

Abby!!!!! <Abby makes cute trilling sound>

These headphones are Sony MDR7506s — really nice btw, with a nice long cord. They cost $99, so I really wanted to fix them, not buy a new set just because the cord went bad. I found the service manual online and got the parts number for the cord. I also found the number for the Sony Professional service number. The original part 158079221 would have been $44.95, but it’s no longer available. It forwarded to a new part number 158079213, which costs $82.12. This is a “cord (with plug)”. Isn’t that crazy?

LPC last day for early rate!

Today is the last day to register for the Linux Plumbers Conf and get the lower rate. I highly recommend you do! I’m very excited about the program we’re going to have. I’d like to thank all the microconf runners and the rest of the program committee for their efforts in soliciting and reviewing talk submissions, and putting the program together. Not only do I think we’re going to have an interesting 2.5 days, I think meeting our goal of actually making progress in a number of these areas is almost a sure bet.

What’s that? It was touch-and-go for a bit there? Yes, but now we can laugh about it!

I’d like to extend special thanks to our web guy Brandon Philips, who has borne the brunt of an overly manual submission and review process resulting in extra work for him. Also a big thanks to James Bottomley for his help in many areas of conf organization, and also the Linux Foundation, who has made it possible to ensure all our speakers are able to attend the conference!

MinGW cross-compilation adventure.

I just finished porting a Windows driver (actually 3) to use the MinGW build environment.

Due to the Windows Device Driver Kit (DDK) being under a somewhat opaque license, we could not get legal clearance to release binaries of our GPLed code compiled with the DDK. This was bad because I, being the open-source kinda guy I am, had based my work on a pretty substantial GPLed codebase. *Surely* the DDK license couldn’t be so restrictive to prevent all binaries bsed on GPL source! Well maybe it is and maybe it isn’t. When it’s not clear, legal says no.

Not good. It looked like we were going to have to somehow pull out the work I had done and rewrite the rest of the code from scratch to be GPL-free so we could release binaries legally following the DDK’s EULA.

It was in the process of estimating the work involved that I happened to talk to Jamey Sharp at a local Linux beering. We were each talking about our work and it turned out that he was in the same boat as me, a Linux dev who through some strange quirk was working on Windows drivers. But he wasn’t using the DDK, he was using MinGW, which is a port of GCC to compile Windows binaries.

Sometime later he was kind enough to come over and show me his setup and makefile, and sure enough it worked. So, we *could* use the GPLed code if we just distributed DDK-free binaries.

Once on that path, it still did take me a while to get the driver building. One nice thing about trying to get a different build env going is that you have something that works (although you can’t distribute it :)

I got it compiling by modifying the driver to have function definitions etc. that MinGW lacked. But it wouldn’t link. Sigh. I was using functions that were not in MinGW’s import libraries, and could not get around this by fudging it in my driver; I had to fix MinGW. This is a big fear of mine every time I use a piece of open-source software — if your code has a Foo dependency and Foo is broken, you pretty much have to be willing to start hacking Foo if you want it fixed. (Sure you can file a bug, but obviously nobody cares about your bug except you or it would be fixed, right?)

Once I dived into MinGW (actually w32api) it was straightforward to fix. Many of my changes to get the driver compiling actually belonged in the MinGW header. There were also functions omitted from the import libraries. (Import libs tell the linker how to link to the actual shared libraries that will be present at runtime.) These were defined in .DEF files, and all it needed to know was for each function, how many bytes were its arguments? Easy, once I knew what to do. (Nothing hard, just if one doesn’t do this thing regularly, you forget how it all fits together.)

So for anyone who wants to write Windows kernel code without the DDK, it can be done. Some tips:

  • Debian/Ubuntu includes mingw cross-compiler
  • Don’t use KMDF/WDF, MinGW doesn’t support it
  • Sprinkle all callback functions with DDKAPI, so they use stdcall calling method (the compiler will complain, makes it easy.) including DriverEntry().
  • Add -DDBG to enable KdPrint()s
  • Inline asm will need to be rewritten
  • Recent GCC doesn’t have __FUNCTION__, and DDK doesn’t have __func__, so plan on wrapping with your own macros for tracing and handling this difference based on #ifdef __MINGW32__. I’m a big fan of gcc’s preprocessor, the variable-argument macros are pretty nice.
  • WinDBG needs .pdb files to set breakpoints and step through code, MinGW doesn’t generate these, so KdPrint() is your friend
  • You can’t link with libc yet sometimes you need snprintf. I pulled in Linux’s snprintf code to fill this gap, yay GPL!
  • MinGW is 32-bit only right now. For 64-bit binaries, plan on becoming a serious MinGW contributor for a while!
  • Here’s how my makefile build cmd ended up: i586-mingw32msvc-gcc $(CFLAGS) -o $@ -shared -Wl,–entry,_DriverEntry@8 -nostartfiles -nostdlib $^ -lntoskrnl -lhal -lndis
  • For reference, see the Xen GPLPV repo. More help is always welcome.

Hopefully this blog post will contain enough keywords to be helpful to someone in the future :-)