[HD2 Android Q&A, Help & Troubleshooting and Genera] ming of mongo:
This may be my first post, although I've been lurking since the wallaby days. I've made quite a bit of use of the hard work of a lot of good people without contributing anything, and I thank you all. This is my way of returning the favor, in a small way.

I have quite a lot of Linux experience, and a certain amount of embedded systems experience, and I hope to straighten out a few things that may be holding you all back. There is a lot of guessing in the forums about how and why different combinations of WM roms, radio, and Linux kernel have their effect on how your Linux/Android setup functions. A lot of these guesses are quite thoughtful and well reasoned, yet wrong. Keep guessing anyway. That's the starting point to figuring things out.

I'm giving you an overview of how these types of things run. I'm not on the htc-Linux project, so I might flub up on a point or two (everyone guesses a bit) but I think you will fine this brain dump useful. Many of you know some or all of this, but many others don't.

In the beginning, there was the phone. And it was good.

Then, came the radio, and it was cool. Then came the computer, and it was way, way cool. Finally, someone but all of them together, and the pda/phone was born. And it was so amazingly cool that geeks like me had to change their shorts. But the focus of our attention here, is the computer part.

A computer, from a hardware point of view, has these parts: Non-volatile memory, which keeps its data when the power is off, Volatile memory, which doesn't, and a CPU that crunches all this data. Why don't they just use non-volatile memory for everything? Because volatile memory is fast. Really fast. Orders of magnitude faster than non-volatile memory (although people are working on changing that).

The reason your HD2 can run Android so fast when it runs off the non-volatile SD card, is that the programs, including the OS kernel, from the slow non-volatile memory are copied to the fast stuff, and run from there. So really, It doesn't run off the card. It loads from the card (making boot-up slow) and runs off the volatile memory (making operation fast).

Currently, the Linux kernel is not using the non-volatile memory in the phone itself to store the operating system like WM does. People are working on this, but it is a lower priority job, because the ability to load off the SD card, without flashing your rom every time you make a change is the most powerful development tool they have. It does have pitfalls, however, which we will get to later.

From a software point of view, (and I'm really simplifying) there is the kernel, which runs the show, the drivers (many of which live in modules, but lets ignore modules for now), the programs, and the data space.

The kernel controls file permissions, handles the larger aspects of memory use, switches between processes, and handles input and output and all the boring crap that makes things happen behind the scenes. The kernel, for the most part, is very similar across the range of phones with the same CPU chip type, but since much of the other hardware is so different (otherwise they would all be the same phone), drivers are written for the different hardware. By the way, the Linux kernel does not use WM drivers in any way. It can seem so for reasons that we'll get to soon, so I'm not saying its all in your head.

The programs are obviously the apps you use, and also certain system programs that the kernel uses for it's own nefarious purposes. Android is really just another program that the kernel runs, just like Sense on WM, except much cooler.

The data space is memory set aside for the data that the kernel and the other programs process. Variables in the programs are stored in the data space on the volatile memory. There can be many separate data spaces, but at this point talking about that is not helpful.

Now things get interesting. Volatile memory loses everything in it when the power goes off. On many systems, this means all the memory is zeroed out. Any memory that is not specifically written to, is zero by default. The kernel for the HD2, is a modified version of a kernel written for another machine. As are some of the drivers, and other miscellaneous stuff. On the other phones, the kernel and some of the data space are loaded immediately at start-up, into freshly zeroed out memory. On the HD2, the kernel is loaded from the card into memory that's been shaken and stirred quite a bit already. If the programmers are just a little bit sloppy in forgetting to initialize all their variables, then variables that they are counting on to be zero, might instead be full of all kinds of leftover crud in the data space of the HD2.

I suspect that many of the problems people have with one WM rom and not another, are due to the different roms leaving different crap behind them when they are overwritten by the Linux system. If a feature works with a certain WM rom it may be that the developers are testing it with that rom, or one very similar.

Another reason that your WM roms, radios and even registry settings might have effects on the Linux system is simply because the HD2 has a lot going on besides the CPU. Other tasks are handled by other, very separate systems using other chips. An example is the radio controller, which is where your radio flash file goes. It is a separate processor (although it can be on the same physical chip). WM and Linux can tell it what to do, and a little bit of how to do it, but all the actual cellphone stuff is handled by the radio controller on its own.

The operating system can interact with these guys, and change their settings, but otherwise doesn't have any control over how they operate internally. Changing operating systems without powering down, as the Linux/Android system currently does, won't have any effect at all on these systems, which will continue to work the way WM told them to. In fact, the kernel developers might be quite happy to let things retain their WM settings, until they get around to fixing up drivers for this stuff. Different WM roms set things up differently. This is why it may appear that the Linux kernel is using WM drivers, when it's really just making use of their after-effects. This is also why running CLRCAD.exe in WM gives you sound in Android.

Well, that's all I've got. It won't make that robot voice go away any quicker, but at least you have a general idea about why its there.