abend writes:
2) Chameleon hangs when it sees my 1.5TB USB TimeMachine drive. After adding many verbose() calls and a zillion reboots, it turns out Chameleon is looping in ReadBTreeEntry() when probing for the presence of OS X - ie looking for SystemVersion.plist, which BTW doesn't exist on this volume. As long as you're not trying to _boot_ from that disk there are 2 workarounds
Unfortunately, I needed to boot from that disk

The symptom of this is boot0 loads normally, the screen clears (video mode change), and you see the progress spinner move a couple of times, then freezes.
Alas, it's beyond my skill to probe further into why GetDirEntry() doesn't converge, but I'd be happy to assist one of the programmers if they'd like to take this any further.
I found and fixed the problem. You're correct that ReadBTreeEntry() hangs and never returns.
It gets into a situation where what it's searching for appears to be before the very first btree entry, which should never happen, so infinite loop. At least I think that's the explanation.)
But the reason it gets into that infinite loop is that it's getting bad data in its call to ReadExtent().
For normal, clean directories, the btree data lives in the catalog file. When the directory gets a bit bigger, or has been used a lot, the btree data can overflow into overflow extents. This is where things go boom.
This might only occur on large drives, where the extent happens to live beyond block 2^32, although I'm not sure. (Tracking down all possibilities when it involves a drive move, compile, copy, unmount, drive move, boot, for each attempt, can get painful; 50 times last night was enough

Anyhow the problem is in hfs.c, in ReadBTreeEntry(), line 736 (for RC4). This:
ReadExtent(extent, extentSize, extentFile,
curNode * nodeSize, nodeSize, nodeBuf, 1);
Should be:
ReadExtent(extent, extentSize, extentFile,
(long long) curNode * nodeSize, nodeSize, nodeBuf, 1);
Just cast the multiplication so it's a 64-bit number, as expected by ReadExtent. (I'm not sure if it's the multiplication that was overflowing in my case, or the fact that subsequent arguments were getting misaligned passing a long where a long-long was expected.)
I suspect hfs.c, GetCatalogEntry, line 606, requires a similar fix. From:
ReadExtent(extent, extentSize, kHFSCatalogFileID,
curNode * nodeSize, nodeSize, nodeBuf, 1);
To:
ReadExtent(extent, extentSize, kHFSCatalogFileID,
(long long) curNode * nodeSize, nodeSize, nodeBuf, 1);
Fixing the first one at least took me to the boot menu; I fixed the second one before moving to the original machine and trying a full boot, so I'm not sure if the second fix is required; it very likely is, and I'd recommend it.
I wouldn't be surprised if this were a source of grief for a lot of mysterious Hackintosh hangs, especially as drives get bigger.
My girlfriend's hack had been working great for months; I installed the Dev tools, which stopped it from booting; after removing a few CHUD drivers it added, things worked again. Then I installed fink, and things refused to boot! Turned out it was just the root directory getting into overflow extent mode, which could happen to anyone at any time, unexpectedly, causing the above infinite loop in chameleon.
Whew!
Attached is a boot2 with these two patches (it also includes a similar fix to allow wake-from-sleep with 4g of memory). No guarantees, hopefully it will help some.
Enjoy!
-d