Jump to content

How ROMs are put together


Guest franciswills

Recommended Posts

Guest franciswills

Firstly, I'm a linux sysadmin, so I'm fine with kernels, modules, filesystems, blah blah. I haven't spend a great deal of time googling around this so if I've missed an obvious topic, please point me to it. Also, before I get flamed, I'm not saying anyone's being useless or lax, and I'm more than happy to say I probably couldn't do it myself.

Initially I was interested in what might be holding up the creation of a 2.1 ROM since the N1 ROM is now out.

Please correct me on what I've written below, I'm just looking at it from a sysadmin's point of view:

A ROM is simply a linux filesystem including a kernel (which has the device drivers in it or maybe compiled as modules) plus a bootloader right?

In that case, since the 2.1 filesystem is available in the form of the N1 ROM, and the Hero specific device drivers are available in the 2.6.27 kernel HTC distributes, could a Hero ROM not be built by:

1) Taking the 2.6.29 kernel sources (which I assume, possibly incorrectly, are available for the N1) and,

2) patching it with the Hero device drivers (obviously some munging, minor or major, of patches might be necessary here) and then

3) adding that kernel to the 2.1 filesystem from the N1?

I'm sure it's more complex than this, or the device drivers will simply not patch into 2.6.29, or there'd be loads of ROMs floating around already.

Again - please don't think I'm saying I could do it any better, I'm just trying to understand.

Edited by franciswills
Link to comment
Share on other sites

Firstly, I'm a linux sysadmin, so I'm fine with kernels, modules, filesystems, blah blah. I haven't spend a great deal of time googling around this so if I've missed an obvious topic, please point me to it. Also, before I get flamed, I'm not saying anyone's being useless or lax, and I'm more than happy to say I probably couldn't do it myself.

Initially I was interested in what might be holding up the creation of a 2.1 ROM since the N1 ROM is now out.

Please correct me on what I've written below, I'm just looking at it from a sysadmin's point of view:

A ROM is simply a linux filesystem including a kernel (which has the device drivers in it or maybe compiled as modules) plus a bootloader right?

In that case, since the 2.1 filesystem is available in the form of the N1 ROM, and the Hero specific device drivers are available in the 2.6.27 kernel HTC distributes, could a Hero ROM not be built by:

As far as I understand it, your phone runs Linux as its OS and runs Java components on the Linux system. The system Java components are Android 1.5 (cupcake) and supplement programs. A phone company compiles the binary to the exact specifications of their phone. This means the Android 2.1 from the N1 won't work on the Hero because its a different architecture.

Since its up to the phone manufacturer to compile the Android version and include it with the phone in the form of an update ROM, another manufacturer with a similar architecture could release a ROM that might work in the Hero but may not be stable since its not made for the Hero.

My guess is that the ROM makers here compile the Linux kernel to make it more efficient and introduce more features, like the ext2-4 support on the SD cards, A2SD, etc that make their ROMs so great.

I also suspect the reason why its called a ROM is that the recovery program extracts the zip file into the EEPROM/EAROM.

Everyone is waiting for HTC to release their Android 2.1 ROM update so the ROM makers can use the Android 2.1 components in their ROM.

At least that is how I see how it works.

Link to comment
Share on other sites

@franciswillis: it is not that easy to patch the .29 kernel with the hero patches, it has been tried. at xda there is at least one thread about it, the major thread called something "community kernel", let me know if you can't find it. work on this has been laid to rest, as everybody is expecting 2.1 including kernel (and sources) to appear every day. your last assumption is correct, the patches don't apply to the .29 sources, and nobody has taken the buttload of work to do it...

about roms: what we call a rom here is only the filesystem and the boot.img file, not sure what you mean by bootloader. the boot.img contains the kernel and the ramdisk.

@fyremoon: the phone runs the linux kernel, but in a heavily modified version. on top of that sits the android system, which is (as you said) somehow java based. i'm no developer, got no idea of that.

the binarys are platform dependant, so they should be interchangeable between android devices (within limits).

so n1 apps should work, but not necessarily the kernel (which is the part that is hardware- or model-specific). with .29 kernel sources for the hero i can imagine ported n1 roms to appear quickly, as long as there are advantages over the 2.1 hero rom we will be having by then...

the kernel is recompiled for ext3 and 4 support, ext2 was already there. also some other tweaks to increase performance were made, aswell as other features enabled (iptables, tun.ko for vpn). a2sd works with the stock kernel! just for the record :)

your suggestion for the name origin is right, but actually nowadays there is no eprom or whatever, it is simply flash memory. when you do adb remount and change contents of /system you change the part that is written when you "flash" a "rom". the term no longer applies, but is kept for historical reasons (and since it is catchy and unique, why change it? :))

Edited by kendon
Link to comment
Share on other sites

Very good explaining by kendon. Essentially what you're suggesting with respect to porting ROM is a bit like taking the hard drive from one of your servers and putting it into a laptop. Whilst both run Linux fine, you wouldn't try running the servers drive on the laptop due to different drivers and modules being needed. In theory they can both run the same os, but in practice it's not as simple.

Exactly the same here, just in a territory you're not as familiar with. I know the Linux analogy is a bit rubbish, but I'm sure you get the idea. It would be possible, but not worth the hassle, so you'd do a fresh install, hence the different rom versions for different hardware.

Link to comment
Share on other sites

Guest franciswills

Thank you all for the explanations. I figured people might have tried applying the drivers to 2.6.29 - Here's another voice wanting HTC to hurry it along then :-)

The only question that leaves me with is the leaked Hero 2.1 build I've read about. I'm guessing the reason no-one's based a ROM around it (another assumption there) is the lack of kernel sources? Along the lines of the ported stuff described above, I'd figured maybe the N1 ROM + the leaked Hero 2.1 ROM's built kernel would work, but then I guess there are all the issues of kernel headers, glibc, blah blah blah versions not matching up.

At this point I need to go read some of the AOSP stuff and start working my way from boot image forwards on a ROM to figure out what exactly is the composition and boot/startup sequence.

kendon: By bootloader, I meant whatever the Android equivalent of grub/lilo is.

pulser: I think the linux analogy is fine, especially since it's exactly what we *are* dealing with, the only change being that the nice thing about linux is that you *can* take the drive out of a server and boot it in a laptop, assuming you've compiled appropriate drivers into your kernel (or as modules) :-)

Edited by franciswills
Link to comment
Share on other sites

pulser: I think the linux analogy is fine, especially since it's exactly what we *are* dealing with, the only change being that the nice thing about linux is that you *can* take the drive out of a server and boot it in a laptop, assuming you've compiled appropriate drivers into your kernel (or as modules) :-)

You've preempted my next part I didn't get on to :)

You do get versions of hero ROMs for older phones like the magic and the dream, and these contain the Linux parts of the rom for the actual hardware along with some hero parts of Java stuff. Essentially you've done what you suggested with the server and laptop, which I agree is possible, just not that practical. Same here.

Perhaps we won't see any n1 ROMs since 2.1 is supposedly due out next month?

Link to comment
Share on other sites

Thank you all for the explanations. I figured people might have tried applying the drivers to 2.6.29 - Here's another voice wanting HTC to hurry it along then :-)

The only question that leaves me with is the leaked Hero 2.1 build I've read about. I'm guessing the reason no-one's based a ROM around it (another assumption there) is the lack of kernel sources? Along the lines of the ported stuff described above, I'd figured maybe the N1 ROM + the leaked Hero 2.1 ROM's built kernel would work, but then I guess there are all the issues of kernel headers, glibc, blah blah blah versions not matching up.

At this point I need to go read some of the AOSP stuff and start working my way from boot image forwards on a ROM to figure out what exactly is the composition and boot/startup sequence.

this is probably roughly the problem, like i said i'm no dev, so this is voodoo for me :)

kendon: By bootloader, I meant whatever the Android equivalent of grub/lilo is.

i guess that would be what we call spl here. this is NOT part of the rom. so far there is only stock and the modified spl here in the stickies, which only needs to be changed when you want to another splashscreen (not bootscreen, which is again part of the rom). kinda like bios screen = splashscreen, windows/macos/ubuntu loading screen = bootscreen (animated w/ sound). flashing the spl can easily brick your phone, so it shouldn't be done if not necessary.

Link to comment
Share on other sites

Taking this technical discussion a bit further, what bits of Android is it possible for developers and ROM cookers to modify? Specifically, is it possible for developers to add to the public methods and classes that Android makes available?

My interest is in the TelephonyManager class, which provides information about the telephony services on the phone, such as SIM settings. I would like to access some information from the SIM card that the TelephonyManager class does not currently provide access to. Would it be possible for an application developer or a ROM cooker to add this, or would this require Google’s Android developers to add the required methods that could then be called in an application?

My reason for asking is that I have Line 2 enabled on my Orange UK account, which means that I can have two telephone numbers on one SIM. Android does not support Line 2 and the TelephonyManager does not give access to any Line 2 related information held on the SIM. What I am trying to work out is whether I could add these functions myself (which would mean reading and writing to the SIM) or whether I am out of luck until Google adds it to Android which could be never.

I hasten to add that I am not a developer and adding these functions are currently beyond my capabilities but I would be willing to learn if it were possible.

Link to comment
Share on other sites

Guest franciswills
Taking this technical discussion a bit further, what bits of Android is it possible for developers and ROM cookers to modify? Specifically, is it possible for developers to add to the public methods and classes that Android makes available?

My (limited) understand is that you can build an entire working ROM from full source (you'd need the Android stuff: http://source.android.com/ and the HTC kernel sources (for the 'device drivers'): http://developer.htc.com/ (assuming you're doing it for a Hero).

An example of this is here: http://android.modaco.com/content/htc-hero...1-for-gsm-hero/ which does not include any closed source bits (like Google Maps for example).

If you add additional functionality to the Android sources, you'd obviously have to bear in mind that taking advantage of those additional/modified classes/methods/properties would only work on phones with that ROM. You could always submit it as either a feature request or bug report on the Open Source project though...

Link to comment
Share on other sites

Taking this technical discussion a bit further, what bits of Android is it possible for developers and ROM cookers to modify? Specifically, is it possible for developers to add to the public methods and classes that Android makes available?

My interest is in the TelephonyManager class, which provides information about the telephony services on the phone, such as SIM settings. I would like to access some information from the SIM card that the TelephonyManager class does not currently provide access to. Would it be possible for an application developer or a ROM cooker to add this, or would this require Google’s Android developers to add the required methods that could then be called in an application?

My reason for asking is that I have Line 2 enabled on my Orange UK account, which means that I can have two telephone numbers on one SIM. Android does not support Line 2 and the TelephonyManager does not give access to any Line 2 related information held on the SIM. What I am trying to work out is whether I could add these functions myself (which would mean reading and writing to the SIM) or whether I am out of luck until Google adds it to Android which could be never.

I hasten to add that I am not a developer and adding these functions are currently beyond my capabilities but I would be willing to learn if it were possible.

Well, I've had a look at this, and it seems that three Sweden apparently has multiline support on the Hero. Has anyone got that ROM, either as update.zip, nandroid or RUU or whatever? We could check the version number and see what build it uses, then diff against a stock build and see what's different...

Just a suggestion, but we'd need to find the ROM

But... I can't see the hero on the three sweden website :) So can anyone from Sweden confirm the Hero exists on three, and if it does, which build of the ROM comes on it?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.