|
May 16, 2006
Universally Fatilicious Public Betas (WSX, FM, MeMa, Silk): Overcane of Antflower Milk #3
If you don't want to read my ranting or the horrible technical inaccuracies someone will accuse me of making, skip to the end of this post to get to the direct download links. Also note that ShapeShifter is not part of this public beta push and will probably be one of the last APEs in a fat binary form due to the extensive image code and other things that have to be rewritten a lot for x86. Welcome to the first public beta of ICBM-compatible haxies. Slava finally received his ICBM and was able to do some production machine testing. As such, we've decided to release some public betas. In this installment, we have four such betas. Windowshade, FruitMenu, Menu Master, and Silk. If anyone is wondering why I keep calling them ICBMs, it's because it is closest to what Apple calls them. They repeatedly and officially call them "Intel-based Macs". However, that takes too long to type and it has a dash. A nice abbreviation would be IBM. That obviously cannot be used. Especially since IBM makes the PowerPC chips. So the next course is to ask "Intel what?" And answer, "Intel chip". And so we have Intel chip-based Macs, which nicely abbreviates to ICBM. Just 4 short letters. Also, the proper term for "Universal Binaries" would be "Fat binaries". After all, why do you think they call it lipo? What's funny about that man page is that they just did a search and replace for "fat". If you look at the man page dated just five months prior you can see all the mentions of "fat". The other issue with the marketing term "Universal" is that it was previously used to describe application programs that worked in multiple languages. I've also seen a few users think "Universal" is something "magic" (as in something really special) when it's "just" two binaries for two (or more) processor architectures "smashed" into each other to make one larger binary. Granted, fat binaries are an absolutely wonderful thing. They prevent Mac OS X from having 13 different SKUs like what's required for Windows 2003 x86, Windows 2003 "64-bit for 64-bit extended systems" (x64), and Windows 2003 for real 64-bit processors like the Itanium. Fat binaries greatly reduce consumer confusion and are an absolutely great thing to have. Anywho, I thought I'd write about some of the difficulties we faced when porting stuff over from the PPC side of things to the x86 side of things. Well, I can only really speak for myself and mention the issues Slava's told me about. First, Application Enhancer. That was a doozy. Imagine a small Russian man stabbing an effigy of his mother with a turkey baster while screaming, "Non-trivial! Non-trivial! Non-trivial!". Now imagine his Mother coming in and saying, "Слава, поставь отца на место, пора ужинать." Well, at least that's what I imagine but I'm not all there in the head. APE uses a little more than a bit of ASM. Of course, Mac OS X itself uses ASM all over the place. If you want pure speed and tight control over how your code is run, ASM is the way to go. So porting APE required learning i386 ASM. Not the most difficult thing, especially since Slava was used to 68k ASM from the pre-PowerPC days and I'm told their readability is similar. Learning x86 ASM was just a small bump in the road compared to some other things. Because the x86 instruction set is variable length compared to the PowerPC's fixed length instruction set, some extra work and some design changes on the x86 side of APE were required. By far the biggest thing we had to have was Rosetta support. APE Modules needed to load inside applications running under Rosetta. Otherwise there would be a huge consistency and support issues as running applications under Rosetta is otherwise completely seamless. Explaining to users that they could only run APEs in native processes was completely unacceptable. Adding Rosetta support was akin to adding a large new feature. Debugging APE modules in applications running in Rosetta... Now that's scary. Application Enhancer was by far the largest and most time consuming part to port over. Especially considering the amount of error checking code we write. The preference panes for the APE Modules were relatively easy. They were mostly just a checkbox away from being loved by an ICBM. But this entirely depends on whether the APE had the pref pane do all the heavy lifting. Some APE modules will make the preference pane "explode" all the data into easy to digest bits since things need to be done as fast as possible on the APE module side of things. There were a few caveats with porting APE modules. Personally, I found the "change" in objc_msgSend to be my biggest problem APE-side. All normal happy Objective-C calls like [object isEqualTo:object] are transformed into objc_msgSend(object, @selector(isEqualTo:), object...) or some variant of objc_msgSend_*. The [receiver message] type of call is really only accessible to files that are marked as being compiled with the Objective-C "compiler". By default these are .m and .mm files. It's not always possible (or a good idea) to mark files as being Objective-C source code files. For one thing, no APE module can link directly to AppKit (part of Cocoa). It's not that it's not possible but loading AppKit causes an enormous amount of memory to be moved. This can greatly reduce application launch times for non-Cocoa applications. Also, if the host application has an early over-releasing bug (such as PowerMail and Toast did in the way back when that was over 3 years ago) the chances the freed memory being overwritten by another object is exceedingly great, which will result in a crash. Some APE modules address this by creating "sub modules" that only load if the parent is of a particular architecture. However, this can be tedious as it requires an entirely separate code base. Not the most efficient way to do something while weaving in and out of code. Menu Master, it particular, calls objc_msgSend() directly all the time since Cocoa menus are based on Carbon menus. Let's say I want to call a specific method using objc_msgSend but it's Mac OS X 10.4 and later only. I'd need to determine that the object responds to the selector. I'd do this by calling... wait for it... respondsToSelector:. A real-life example is NSMenu's delegate method. If I had an NSMenu object named "lastMenu" I'd test it by running if (objc_msgSend(lastMenu, NSSelectorFromString(CFSTR("respondsToSelector:")), NSSelectorFromString(CFSTR("delegate")))). Now, this would work fine and dandy on the PowerPC. However, respondsToSelector: returns a BOOL type. (Note: BOOL, bool, and Boolean are all different types, do not confuse them.) BOOL is an 8-bit type. objc_msgSend returns a 32-bit type. On the PPC, the upper bits of the 32-bit value would all be zeroed so the conditional check works as expected. However, on the x86 the upper bits are not zeroed. This means it can "randomly" return YES when the answer is an emphatic NO. This can lead to some very ugly crashes. This fix for this is even uglier. It involves typecasting the function pointer itself. So the new check becomes ((signed char(*)(id, SEL, SEL))objc_msgSend)(lastMenu, NSSelectorFromString(CFSTR("respondsToSelector:")), NSSelectorFromString(CFSTR("delegate"))). Fun, huh? When I first ran into this issue in February, I had no idea why I was getting these random crashes. I sent a message out to a mailing list asking for tips. Luckily, someone from Apple responded with a very, very detailed explanation of what was happening and another thing that should be watched. I could not be more appreciative of Greg's response. Then there's just little convenience things you can do on the PowerPC, like converting a FourCharCode into a C string by using OSType tag='OTTO'; char creatorstr[5]; creatorstr[4]=0; *(OSType*)creatorstr=tag;. Because the x86 is little endian, this will result in some jumbled characters. Luckily for this case, there's a much better alternative in UTCreateStringForOSType(). No ugly pointer math. Ugly pointer math is ugly and makes babies cry. Yeah, that's just a few of the issues. I had more, but I now realize this thing is getting to be really long. Onward to the Betas! After we released Smart Crash Reports and started getting a few crashes in, we were ecstatic. SCR worked and was doing it's job. We immediately fixed the few crashes we saw and released updates. Months passed. We got more reports of the same crashes. At first the thought was maybe the bugs weren't really fixed. We then checked the rest of the crash log. People were still using the really old versions of our software. Sometimes really, really old. With that, we started working on a semi-unified updater. All of these betas include this new updater. By default, it's set to check daily. This can be changed in the respective product's preference pane if you so desire. It's set to check daily because it's beta software. The final release of each piece of software will default to weekly. If you actually desire to change it to something else, please tell us why! If you're behind a proxy, please tell us if manual checking works. It uses the WebKit NSURLDownload class, so hopefully it will work with proxies. That class is just wonderful. APE 2.0b2 All of these products include Application Enhancer 2.0b2. This beta will expire on May 31st. A design decision was made so only fat APE modules will load on the ICBMs. This is due to the fact a non-fat, PPC only, APE module would only load into applications running under Rosetta and the user would have no way to set the settings of the APE module without launching the System Preferences application in Rosetta. Neither of these are a very good user experience as I mentioned yesterday. Menu Master 1.3.2b2 ![]() Menu Master 1.3.2 includes a brand new feature called "Menu Accelerator". This feature (and it's name) was shamelessly stolen from Gus Mueller with his permission. Of course, his code was not suitable at all (and honestly wasn't even looked at) because it's all Cocoa (see above explanation of APEs linking to Cocoa) so just the idea itself was stolen. Basically, you just press Command Option Control M (4 keys) in an application and a new window with all the menu items appear. You can type into this to narrow the results (see image at right). It is supposed to be completely self-explanitory and intuitive. Sadly most of the beta testers said they wouldn't use it. The only people that did really like it had already been using Gus' implementation before and were glad it finally worked in Carbon applications. I should note that Menu Accelerator uses no patching at all. Carbon Events rule! The DataBrowser does not! Version 1.3.2 beta 2 (May 16th, 2006-ish)
Version 1.3.2 beta 1 (March 5th, 2006)
Get it at http://www.unsanity.net/beta/menumaster-132b2.dmg (2.65 megs) WindowShade X 4.0.3b1 (May 16, 2006, from Slava with Love)
Get it at http://www.unsanity.net/beta/windowshade-x-403b1.dmg (3.56megs) FruitMenu version 3.4.4b1 (May 16, 2006, from Slava with Love)
Get it at http://www.unsanity.net/beta/fruitmenu-344b1.dmg (2.70megs) Silk Version 2.1.3b4
Version 2.1.3b3
Version 2.1.3b2
Version 2.1.3b1
Get it at http://www.unsanity.net/beta/silk-213b4.dmg (3.31megs) Requests for Comments and Other Forms of Love We'd really like to know what people think about the new APE Preference pane. We tried to clean it up quite a bit and make it easier to use. We'd also like to know what y'alls opinion is of the updating process. That is, what is your feeling on updaters in general? Finally, I'm curious to know which "first tab" preference pane design you like better. The one in FruitMenu and WSX or the one in Menu Master and Silk? Also, if anyone finds any utility in Menu Accelerator. You can answer all these questions and more in the comments here or by emailing us directly. Probably at beta at this company dot com. But only email that if what you need to say can't be said in public on the internets. Reposting the Links Because it's the Thing to do this Summer (along with seeing Snakes on a Plane!) WindowShade: Get it at http://www.unsanity.net/beta/windowshade-x-403b1.dmg (3.56megs)
You will see Snakes on a Plane! starring the lovely Samuel L. Jackson. Trackback Pings: TrackBack URL for this entry: Listed below are links to weblogs that reference Universally Fatilicious Public Betas (WSX, FM, MeMa, Silk): Overcane of Antflower Milk #3: 2006.05.17 ソフト情報 from FFXIとかMacとかPalmとか...Winもか Tracked on May 16, 2006 6:05 PM Related:
Comments
Rant? What rant? That was an interesting explanation - not to mention a great example of why I still haven't converted to Objective C. Guess I'll buckle down this summer. Can't wait to get home and download these and what timing. Looks like I'll soon be the proud owner of a black MacBook...if I can stand the shiny screen. I may wind up getting a Pro even though I really want the smaller computer. I've not been impressed with the shiny displays on the PCs I've seen. Posted by: dwb on May 16, 2006 9:59 AMOMG!!!! PONIES!!!! WindowShadeX is back and my serial from PPC version still works!! Thank you so much for these betas! I must say that as a first time mac user (using Intel chips) I am very impressed to see how useful these applications are. WindowShadeX and FruitMenu are definitely in my "must buy" list. I can't wait to see Shapeshifter in action but I'm pretty sure this will go at the top of that list too! Keep up the good work! Thanks so much!!! This was the only way to go! What's about shapeshifter? Posted by: t on May 16, 2006 10:37 AMAny new insanely-great software from Unsanity soon? Not updates, but new programs to do new stuff. Posted by: dave on May 16, 2006 11:08 AMChrist another couple of applications with their own internal version checkers. Really wish someone would make a nice, simple, preference pane that applications could just register with that would handle this stuff. The application could just pass its name, version number, and a URL to an xml file where up-to-date information could be found to the preference pane which would then handle all the checking and notifying and possibly even the downloading of the updated software. Posted by: Twist on May 16, 2006 2:00 PMTwist might have a cool idea for a new unsanity product :-) Posted by: Jean-Francois on May 16, 2006 2:03 PMYesss! FruitMenu is back. My Mac is back. Thank you, thank you, thank you! Thanks for the betas, guys. Well worth the wait. Great software-I'd pay for it again for Universal versions if you required it. Thanks, thanks and thanks again. Posted by: Phil Hubbard on May 16, 2006 10:21 PMWell, since these are betas and I suppose some feedback is in order, let me say that Fruimenu does not disable animated menu fadeouts even when checked. Otherwise works normally. Posted by: Stefsun on May 17, 2006 12:09 AMRosyna! You bastard. Menu Accelerator was an idea I've been working on forever -- different (more Quicksilver-esque) interface, but same idea. Anyway, I will absoloutely use it but I need to bind it to different keys! Congrats on universality! Posted by: Steve on May 17, 2006 12:31 AMYou can use any key you want. Just set it in the Menu Master preference pane. Also, accessibility isn't an option as it won't work with Adobe applications. Posted by: Rosyna on May 17, 2006 7:51 AMThe Silk and MenuMaster first tabs are comfortably more organized than the FruitMenu and WindowShade first tabs. They are equally informative and useful, but the latter tabs feel crowded. Good job with following through as promised. Leaked to Mac usenet ;) With 3 lines of beta warnings and versiontracker submission warnings Posted by: Ilgaz on May 18, 2006 11:03 AMI still think there should be news.unsanity.org NNTP (private) server or forums.unsanity.org Posted by: Ilgaz on May 18, 2006 11:04 AMChris, be very mindful of using such language on this blog. Ilgaz, There's a mac usenet now? What warnings and what group? Posted by: Rosyna on May 18, 2006 2:36 PMI want to echo both the "must have!" and "thanks!" statements about FruitMenu. Awesome. I've been working on a transition from HPUX (PA-RISC) to x86 Linux, inlcuding some OLD legacy code... 1960s anyone?... Fortran Hollrith anyone? Lots of complaining at work all ending with "WHY oh WHY did Intel choose little endian?" Okay, so I see it now... we are WUSSIES!! What to byte swap and structure-align is our biggest problem. NOT asm code, wacky message passing changes or Rosetta debugging (ugh!) I'm humbled! Very very impressive! Kudos all over the place for your peeps! -Pie Posted by: EatingPie on May 18, 2006 11:35 PMI am strongly in favour of auto-updaters, because I am very ill/disabled, so find it hard to remember things. Auto-updaters help me keep my software current. With trusted providers (like Unsanity ;) ) I'd even consider auto-updating in full, i.e. enabling the app. to download its update version and install it (after popping up a dialogue like "Unsanity wants to update WindowShade, probably in a fatal puce. Fight back now!") I am a keen and appreciative user of FontCard, FruitMenu, WindowShade and Smart Crash Reporter. ;) Posted by: Clytie Siddall on May 19, 2006 1:36 AM"Clytie Siddall", don't blame software houses. Blame people jumping up and down saying "xxx firewall alerted, it connects to net! Spyware!". People can't risk their business having such a bad word. IMHO, the best thing to do is, SUBSCRIBE unsanity updates E mail list (check unsanity.com) and they will mail you when updates arrive. I am not getting into the very sad ways of "competition" in Software World like abusing versiontracker comments etc. All is to blame except the software houses. Rosyna a huge "comp.sys.mac.**" tree exists in usenet aka news. I warned people not to post the betas to versiontracker and read the readme files carefully. for article. So glad to have Fruit Menu back. Now it's _blazing fast_! Way to take advantage of the new processor. The delays on the PPC version were somewhat tolerable and now completely nonexistent. Posted by: Jeremy Crandell on May 22, 2006 10:16 AMFM, WSX and MM all working just fine again for me! Life is good... Posted by: Christopher Moss on May 23, 2006 4:44 PMFruit Menu's feature to activate contextual menus in the Finder is unworkable. When holding down the mouse button to scroll in a Finder window, the contextual menu pops us and freezes the scrolling. The feature is unusable, unless the time until activation is so long that the feature no more convenient than using the Control key to bring up contextual menus. Posted by: Al Friedman on May 26, 2006 7:18 AMJust downloaded the beta of WindowShade and really like it. A suggestion if I may. The small transparent windows on the desktop are great! Is there any way to get the system to remember the locations? It would be really cool if when I open Mail it automatically goes back to the small transparent window in the same location on my screen every time. Otherwise really cool. Thanks... Posted by: Willy on May 26, 2006 9:23 AM"Demo Period is over" Silk already expired on May 29. :( Will there be anoher beta? :P Or can we now buy a serial which makes it work again? Posted by: t on May 29, 2006 8:19 AMI better say the reason I wrote 3 lines of beta warning to my usenet post. :) I have seen a very advanced tool's ALPHA version sent to a version tracking site and got accidentally accepted. Problem: Developer did NOT send it. A user thinking it is good thing to do did it. By great luck, no problem happened that time and let me remind you, this happens in XMAS! So, I am feeling paranoid for companies/developers I like when alpha/beta ships. Note that Apple CAN'T call them "fat binaries"; that was the official name they used for binaries containing both 68K and PPC code, so to use it here would be an overload of the definition. Thus: fat binary: 68K + PPC code Keep comments on topic. If a comment is unrelated to this post, it may be removed or moderated. |



