Saturday, 31 January 2015

A simple admonition about patches

I understand FSUES is a real thing, I really do. But really, it's rude to tell your users, "patches welcome," then let their patch languish or ignore it.

Why not say what you really mean, "go fuck yourself, I don't care about your problem, and am not interested in any fixes for it?" It's really about as polite. I'd argue it's more polite, since explicit is better than implicit.

I would say OpenBSD gets this right, more or less, even though Theo de Raadt is an autistic wanker (to quote Captain Sensible, "I may talk a lot of shit, but this time I'm right! [Theo] is a fucking wanker!"). So does Linus Torvalds. :P

Thursday, 29 January 2015

Implementing missing Linux syscalls in the FreeBSD linuxulator

So I've taken the plunge and now run FreeBSD full-time on my laptop (11-CURRENT because I have never shied away from the bleeding edge, even if I shoot myself in the foot in the entire process). So far everything seems to work fine, though I have to load i915kms after boot completes, and I get the occasional lock-order reversal warning (so far nothing serious). Pretty nice.

What has bugged me though is the state of FreeBSD's linuxulator. It's reasonably complete enough to run flash, but I desire something a bit more. Here is the laundry list of things I want to do:

* Implement missing syscalls (at least the most commonly used ones) where appropriate
* 64-bit Linux (not just 32-on-64 bit) support (will need to investigate this a bit more, this will require some dark magic)

Currently I am implementing calls required to run Gentoo in a chroot. So far emerge doesn't work due to several unimplemented calls:
linux: pid 51309 (dircolors): syscall dup3 not implemented
linux: pid 51310 (python3.3): syscall prlimit64 not implemented
linux: pid 51310 (python3.3): syscall sendmmsg not implemented
linux: pid 51314 (rsync): syscall utimensat not implemented
linux: pid 51395 (python3.3): syscall prlimit64 not implemented
linux: pid 51395 (python3.3): syscall epoll_create not implemented
I have already implemented dup3 and will be sending patches to the mailing list. Anna has already implemented goodtimesutimensat. Next on my laundry list is probably the epoll_* family, which I intend to implement by translating all the calls to kqueue equivalents. I have no idea what the others are yet, but I am investigating.

Stay tuned...

Sunday, 11 January 2015

Regarding use of list(APPEND FOO_VAR "foo_value") in cmake

Although CMake's performance-tuning suggestions seem to imply that the following two statements are equivalent:

list(APPEND FOO_VAR "foovalue")
set(FOO_VAR "${FOO_VAR} foovalue")

They are in fact, not equivalent. This should have been a no-brainer, but I figured CMake lists were faked. I was wrong. Don't fall into this trap in your own projects.

Also, I'm glad to see CMake's documentation has at least improved compared to five years ago. It used to be nonexistent, and you were told to buy their book if you wanted documentation.

Saturday, 10 January 2015

An open letter to Richard M. Stallman

Dear Richard M. Stallman,

As illustrated in a recent thread on the emacs mailing list, you are opposed to GCC dumping the AST, as you are afraid proprietary programs will be created to modify GCC's AST output, which would not be open source.

Let me put your fears to rest: nobody cares about using GCC's AST for this purpose.

If anyone wanted to do so, they would already use the non-copylefted clang and LLVM. By being stubborn about this issue, you are actually harming the copyleft cause.

You see, if someone cares about the issue enough, GCC will be forked, a fork that does exactly what you're afraid of. Remember EGCS? Remember libc5? These alone demonstrate a fork of FSF software is not only possible, but easy to promote with sufficient clout. This is not a good state of affairs for the FSF's definition of FOSS, and is not good for GCC.

To put it simply: nothing stops someone from making a GCC fork with the needed modifications to dump the AST (though I believe GCC can already do so with a plugin). It is quite irrelevant if it's copylefted — vendors have enough clout to push it as the blessed fork if they truly cared.

The reason that this hasn't materialised is not because copyleft is magically protecting GCC. It is because clang already does what people want, and there is no need to modify the AST or IR to do specific optimisations. You can just modify the compiler directly.

All this is accomplishing is reducing the effectiveness of GCC as a weapon against non-FOSS software to the point of having the injury potential to non-free software equal to a mosquito. Given enough time, GCC will be doomed to obscurity, at the hands of people with far more clout than the FSF. Clang itself was created under such conditions, and has become dominant in academia and business. This is truly unfortunate, as clang and GCC ought to coexist, for the good of them both — competition breeds innovation.

I may not necessarily agree with the ideals of copyleft (I do not feel it is more free than a copycenter license with my definition of free), but I do not want to see GCC doomed to obscurity. I ask you to consider your position carefully, lest your walled copyleft city is simply abandoned.

Respectfully yours,

Elizabeth Myers

V-Blank timings are fixed in sgherm (and some thoughts on documentation in code)

Anna managed to fix LCDC timings by complete accident, and now Link's Awakening works. One minor caveat: the intro doesn't scroll properly. I think this is due to STAT interrupt timing or not firing (Link's Awakening doesn't use them), but this is progress! This makes me happy.

Incidentally, MESS's documentation is a disaster — I can't make heads nor tails of it, and it seems neither could they. They tried to write specifications intermixed with code, and failed so hard, I see why their GB emulation was never finished.

This is why I believe in a clean separation of specifications and code. Comments are for annotating code and explaining the reason something is done; specifications, theory, and higher-level views belong in a separate document. In the process of mixing code and specifications, the algorithms get lost, and with it, the clarity of what you're trying to do.

AdBlock plus keeps disabling itself

AdBlock plus seems to constantly keep disabling itself in Firefox (no, I am not going to use Chrome, thanks). I don't mean the plugin itself, just the ads filtering (icon turns grey, ads aren't blocked, etc.). Search results reveal two things:
  1. This is ridiculously common
  2. It's dismissed as an "antivirus software"/"user error" problem
Considering I use Linux, I really doubt an "antivirus" is to blame. Moreover, the idea that an antivirus program would disable a feature in a plugin like this arbitrarily is ridiculous.

Given that I'm not setting the knob, and it doesn't magically happen at restart (it seems to happen after I visit some pages), I think there's either an exploit (known or unknown) in AdBlock Plus, or some other functionality that allows pages to turn it off.

Given AdBlock Plus is a business, I wouldn't be surprised if they had such a thing, and were selling it to ad companies. Hell, knowing people in the ads business, and hearing their stories of the sleaziness of the ads industry, I'd be surprised if this wasn't going on.

I wish I could find the uBlock plugin for Firefox people are telling me exists, but searching is turning up nothing. I think it's just idiocy put out by "Chrome master race" users who don't actually have a clue.

Wednesday, 7 January 2015

Timing issues with LCDC

Ugh. This thing is going to kill me.

I found the issue in Link's Awakening and basically most games. V-Blank interrupts don't fire at the correct time. I just have no clue how to fix it right now. :(

I did find some resources, but they're the sort of resources with walls of ASCII text and ASCII graphs and stuff. UGH. This isn't 1989, for fuck's sake, we have colour. :|

Thursday, 1 January 2015

SuperGameHerm has sound!

Thanks to the work of Ben Russell, we now have working sound! He implemented it with striking swiftness (a few hours), something which I had mulled over for over a month, but didn't have enough manaballs to do.

Incidentally, a lot of MBC stuff is now fixed. Link's Awakening isn't, but I know now that the sound keeps playing when it glitches like that. Still curious...