Firmware/Vendor Confusion + General Questions about ROMs and Android

Search This thread

lachesis197

New member
Jan 7, 2021
3
4
Hello all,
A few months back I unlocked my Mi 9 SE and rooted it using TWRP+Magisk, so fine so good. I then wanted to go on and install a custom ROM, but every time I tried, I just got my phone stuck in a bootloop and had to reflash MIUI using the scripts provided by Xiaomi (MiFlash/ .flash_all). After that, I decided I would not try meddling with ROMs again until had a better understanding of the (basic) underlying workings of this stuff.
After doing some research on my own I got answers to some of my confusion, but a lot remain, which is why I'm now trying my luck here. Maybe there is a "beginner's guide" of sorts somewhere on this forum, but so far I haven't been lucky in finding any. So, if any more experienced "flasher" or maybe even developer could clarify some things for me, and perhaps others, that would be great! :D

Firmware/Vendor
Firstly, the thing that has confused me since the beginning is the concept of firmware/vendor. I understand that the firmware of Xiaomi phones can be found easily on the internet and that it contains some amount of proprietary software such as drivers. However, while in some flashing instructions it is clearly indicated to "flash fw" after wiping, in others this is not mentioned at all. Is this because some ROMS already contain those drivers and others don't?
Then comes the question of "vendor". Again, some guides mention this, some don't, and on the site http://xiaomifirmwareupdater.com/, where one can find the fw, there is also a section for "vendor" files. So my question here is: what is the difference between vendor and firmware, and is either of them necessary before installing ROMS?

General Questions
From all of this, the way I picture the contents of an android phone are, from low to high level:
Bootloader (like the BIOS on a computer) ==> Firmware (Basic proprietary drivers) ==> Kernel ==> Rest of the OS (Implicit question: how correct is this picture?)
The kernel, from what I gather, is included in the flashable images of most ROMS, and the devs in turn use either the stock kernel from Xiaomi of some custom one like Kowalski's.
Question: What is the distinction between the firmware and the kernel? Since both are, in the beginning, made by Xiaomi, why are they separate things if they serve a similar purpose (drivers and Hardware/Software communication)?
Also, "bonus question" (just out of curiosity): I've heard that the only way to actually hard-brick your phone (other than hardware damage) is to somehow mess up the bootloader (kind of like corrupting the BIOS on a computer). How could this happen?

ROM Build
Finally, a few questions if any ROM dev stumbles upon this post, since apart from the practical aspects I'm also curious about the way a ROM is actually ported to a specific device, say our beloved little grus. Again, I'll just say what I understood so far and you guys can then correct me. From what I read in the building instructions for LineageOS on other devices, the way to proceed is to get the source code of the ROM itself by cloning the repo and then adding device-specific code (Kernel, device tree and Vendor Blobs) before proceeding to actually build the Image. My questions are, apart from if this is correct:
- How intercompatible are these components? Is a device tree specific to a certain kernel? To a certain ROM? Could one use, say, the kowalski DT with the stock kernel from Xiaomi?
- Again, what is the difference between "vendor blobs" and the "vendor" files mentioned above?

I know this is a very long post and I'm asking a lot of unrelated questions, but I hope that if someone takes the time to read through it and answer at least some parts of it, this could be useful in the future not only for me but also any other beginner trying to get into custom ROMS on Xiaomi phones. Cheers!
 
Last edited:

zgfg

Senior Member
Oct 10, 2016
8,981
6,719
Redmi K20 / Xiaomi Mi 9T
Xiaomi Mi 11 Ultra
Wouldn't agree with your firmware definition (although you probably consulted like Wikipedia - their definition is more like for embedded systems like remote controllers or so)

Download Xiaomi Fastboot firmware from:

Its tgz file, hence to unpack, you have to un-gzip and un-tar (you can use 7-zip on Windoze or MiXPlorer to do everything on your phone), open Images folder and look how many img files it contains.
Besides like System, Vendor, etc, it even contains image for Recovery (Recovery is not part of Android, you separately boot to Android, Recovery or Fastboot - the last is part of Bootloader).
Manufacturer can even push new Bootloader via the firmware OTA (I recall how Huawei pushed new bootloader.img in 2018 via its OTA updates, to invalidate the previous merhods for unlocking Bootloader, making it 'almost' impossible to unlock the new Bootloader)

Consider firmware as the opposite of hardware, it's all firm software on your phone: Bootloader, Recovery, Android - all except your user apps, settings and Data you will install to Data or Internal memory.
Firmware also does not overwrite some specifical info related to your particular phone like IMEI(s), Widewine L1 cert (hence if you dropped to L3 by installing custom ROMs, you cannot recover L1 by reflashing the full firmware)

And Kernel is just the Android kernel (as inherited from Linux kernel), similarly like Windows OS has its own kernel
 

lachesis197

New member
Jan 7, 2021
3
4
Thanks for your reply, I think that there is a misunderstanding: What I'm talking about when I say Firmware is this thing: (taken from the site you referenced). This is a small (~70mb) zip archive that contains no images, only binaries. I'm NOT talking about the whole Xiaomi ROM, which is indeed a large tgz and contains all the images you mention.

1610118877934.png


To clarify, what confuses me in flashing guides is (example from evolution x rom) the line where it says "Flash FW & BB", or sometimes just "flash fw"

1610119258181.png
 
  • Like
Reactions: hagekic548

zgfg

Senior Member
Oct 10, 2016
8,981
6,719
Redmi K20 / Xiaomi Mi 9T
Xiaomi Mi 11 Ultra
Thanks for your reply, I think that there is a misunderstanding: What I'm talking about when I say Firmware is this thing: (taken from the site you referenced). This is a small (~70mb) zip archive that contains no images, only binaries. I'm NOT talking about the whole Xiaomi ROM, which is indeed a large tgz and contains all the images you mention.

View attachment 5181291

To clarify, what confuses me in flashing guides is (example from evolution x rom) the line where it says "Flash FW & BB", or sometimes just "flash fw"

View attachment 5181295
Don't really now what does it mean in the context of installation guide for the given custom ROM

Under Mi 9T/Redmi K 20 ROMs subforum, there are tons of threads, each one for a particular custom ROM.
For most of them there are also Telegram channels

IMO, you can better clarify by asking there, where the ROM users are subscribed and actively participating
 

Manglesh____

New member
May 10, 2021
4
0
Hello, I Have a Samsung galaxy s9 Exynos. I have rooted it with magick. Now i want to use evolution Rom but when I am trying to flash with TWRP it is showing--
Vendor Image on the device is NOT compatible
Expected Version: 29_ETFS
You can download it from mega.NZ/FM/F9VHHALY.
what to do. can Someone help?
 

zgfg

Senior Member
Oct 10, 2016
8,981
6,719
Redmi K20 / Xiaomi Mi 9T
Xiaomi Mi 11 Ultra
Hello, I Have a Samsung galaxy s9 Exynos. I have rooted it with magick. Now i want to use evolution Rom but when I am trying to flash with TWRP it is showing--
Vendor Image on the device is NOT compatible
Expected Version: 29_ETFS
You can download it from mega.NZ/FM/F9VHHALY.
what to do. can Someone help?
You missed the Forum - this is for Xiaomi Mi 9 SE - do you really want a Xiaomi user to guide you about flashing your Samsung and to brick your phone🤓
 

hagekic548

Senior Member
Jul 23, 2020
59
6
@lachesis197 I'm in the same spot you where 1,5 years ago.

It seems in the Android customization community most info to be found is of the sorts "to get this, do this". But very little of why something works the way it does. Very little explanations of what it all means.
 

dkibet

Member
Jul 3, 2018
10
3
@lachesis197 I'm in the same spot you where 1,5 years ago.

It seems in the Android customization community most info to be found is of the sorts "to get this, do this". But very little of why something works the way it does. Very little explanations of what it all means.
Here I am about a year later after you! It seems so hard to find 'curated' info. All this info is all over the place.
 
  • Like
Reactions: hagekic548

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hello all,
    A few months back I unlocked my Mi 9 SE and rooted it using TWRP+Magisk, so fine so good. I then wanted to go on and install a custom ROM, but every time I tried, I just got my phone stuck in a bootloop and had to reflash MIUI using the scripts provided by Xiaomi (MiFlash/ .flash_all). After that, I decided I would not try meddling with ROMs again until had a better understanding of the (basic) underlying workings of this stuff.
    After doing some research on my own I got answers to some of my confusion, but a lot remain, which is why I'm now trying my luck here. Maybe there is a "beginner's guide" of sorts somewhere on this forum, but so far I haven't been lucky in finding any. So, if any more experienced "flasher" or maybe even developer could clarify some things for me, and perhaps others, that would be great! :D

    Firmware/Vendor
    Firstly, the thing that has confused me since the beginning is the concept of firmware/vendor. I understand that the firmware of Xiaomi phones can be found easily on the internet and that it contains some amount of proprietary software such as drivers. However, while in some flashing instructions it is clearly indicated to "flash fw" after wiping, in others this is not mentioned at all. Is this because some ROMS already contain those drivers and others don't?
    Then comes the question of "vendor". Again, some guides mention this, some don't, and on the site http://xiaomifirmwareupdater.com/, where one can find the fw, there is also a section for "vendor" files. So my question here is: what is the difference between vendor and firmware, and is either of them necessary before installing ROMS?

    General Questions
    From all of this, the way I picture the contents of an android phone are, from low to high level:
    Bootloader (like the BIOS on a computer) ==> Firmware (Basic proprietary drivers) ==> Kernel ==> Rest of the OS (Implicit question: how correct is this picture?)
    The kernel, from what I gather, is included in the flashable images of most ROMS, and the devs in turn use either the stock kernel from Xiaomi of some custom one like Kowalski's.
    Question: What is the distinction between the firmware and the kernel? Since both are, in the beginning, made by Xiaomi, why are they separate things if they serve a similar purpose (drivers and Hardware/Software communication)?
    Also, "bonus question" (just out of curiosity): I've heard that the only way to actually hard-brick your phone (other than hardware damage) is to somehow mess up the bootloader (kind of like corrupting the BIOS on a computer). How could this happen?

    ROM Build
    Finally, a few questions if any ROM dev stumbles upon this post, since apart from the practical aspects I'm also curious about the way a ROM is actually ported to a specific device, say our beloved little grus. Again, I'll just say what I understood so far and you guys can then correct me. From what I read in the building instructions for LineageOS on other devices, the way to proceed is to get the source code of the ROM itself by cloning the repo and then adding device-specific code (Kernel, device tree and Vendor Blobs) before proceeding to actually build the Image. My questions are, apart from if this is correct:
    - How intercompatible are these components? Is a device tree specific to a certain kernel? To a certain ROM? Could one use, say, the kowalski DT with the stock kernel from Xiaomi?
    - Again, what is the difference between "vendor blobs" and the "vendor" files mentioned above?

    I know this is a very long post and I'm asking a lot of unrelated questions, but I hope that if someone takes the time to read through it and answer at least some parts of it, this could be useful in the future not only for me but also any other beginner trying to get into custom ROMS on Xiaomi phones. Cheers!
    1
    Thanks for your reply, I think that there is a misunderstanding: What I'm talking about when I say Firmware is this thing: (taken from the site you referenced). This is a small (~70mb) zip archive that contains no images, only binaries. I'm NOT talking about the whole Xiaomi ROM, which is indeed a large tgz and contains all the images you mention.

    1610118877934.png


    To clarify, what confuses me in flashing guides is (example from evolution x rom) the line where it says "Flash FW & BB", or sometimes just "flash fw"

    1610119258181.png
    1
    @lachesis197 I'm in the same spot you where 1,5 years ago.

    It seems in the Android customization community most info to be found is of the sorts "to get this, do this". But very little of why something works the way it does. Very little explanations of what it all means.
    Here I am about a year later after you! It seems so hard to find 'curated' info. All this info is all over the place.