Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,812,470 Members 40,931 Now Online
XDA Developers Android and Mobile Development Forum

[Q] What happens when you flash?

Tip us?
 
RackMonkey
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 5
Join Date: Jun 2014
Location: Henderson
Default [Q] What happens when you flash?

I'm a noob. I have 1 phone that can't go down. I have searched XDA, Google, Bing, and YouTube but can't find an answer.

What happens to all the files, folders, and data on a phone when you flash it?

I know there are files on the phone that ID it to the provider. I think it's in the EFS folder, but in all the guides I've read and YouTubes I've watch, not one of them mentions copying anything first nor does it say anything about putting a file back.

Some of the guides I've read make it sound like you wipe everything down to basic hardware before flashing a ROM and kernel back onto the phone.

Does anybody know of a really, really basic guide to what happens?

Most of the time I learn by trial and error. I take it apart and see how it works. I have 4 laptops in varies stages of repair to prove it. But like I said, I only have one phone and I can't spend another $300 just to have another phone to tear down.

On another note...is there a way to set up a sig on this forum?
 
Antagonist42
Old
#2  
Antagonist42's Avatar
Senior Member
Thanks Meter 193
Posts: 464
Join Date: Feb 2012
Location: Bolton
Firstly, know your hardware as most phones now are using NAND chips for (as it would be) your HDD (Hard Disc Drive) writing files/data/folders/etc is not done the same as a standard HDD.

The NAND chip when being written to copies out (in a size dictated by the chip manufacturer) the Original data, erases the data once copied then writes in your data, verifies it's written correctly, erases the Copied data, moves onto next block/page/sector/etc of data and repeats the process.
If verification fails, the original block/etc of data is written back from the copied location.

Bashing away at my HTC Desire C

---------- Post added at 11:33 PM ---------- Previous post was at 11:26 PM ----------

I don't think there is a 'basic' guide that could cover all the intricacies of how different manufacturers work around the hardware and software also allowing for the proprietary software Dev's are trying to figure out how it works just to make (sometimes) the simplest things work.

Bashing away at my HTC Desire C
Wanna get inside what ya got, gotta get out and find it..I found some!
THE END IS NIGH....S-OFF HERE WE COME...
The Latest ACER E320/C6 Rom From Xakep - Very Slick
ACER E320 1.005.00 ROM EUU
 
FBis251
Old
#3  
FBis251's Avatar
Recognized Contributor
Thanks Meter 3,664
Posts: 3,311
Join Date: Mar 2011

 
DONATE TO ME
Quote:
Originally Posted by RackMonkey View Post
What happens to all the files, folders, and data on a phone when you flash it?
If you wanna see what would happen when you flash CM11 you can read our upgrader.sh script that tells the phone the steps needed to back up or wipe certain partitions.

https://github.com/teamacid/android_...1.0/updater.sh

If you're flashing from Gingerbread (BML), your EFS partition gets backed up to the SD card, the kernel/bootimage gets overwritten, then the phone reboots.

After it reboots it will copy the modem file into the /radio partition, then the system partition gets wiped, then it will flash the bootimage again with using a new method.
After this the cache and data partitions get wiped, and your EFS backup that was restored to the sd card gets put on the newly created /efs partition.

After all this is done, the script ends and the recovery will continue instlaling the CM11 files to the /system partition

Any other data doesn't get wiped/erased, only what I mentioned.
The Following 2 Users Say Thank You to FBis251 For This Useful Post: [ Click to Expand ]
 
RackMonkey
Old
#4  
Junior Member - OP
Thanks Meter 0
Posts: 5
Join Date: Jun 2014
Location: Henderson
Thanks FB. That's the first explanation that I could really understand.

I'm asking friends if they have an old phone I can destroy. Then the fun really begins.
 
llinkll
Old
#5  
Junior Member
Thanks Meter 20
Posts: 28
Join Date: May 2014
Quote:
Originally Posted by FBis251 View Post
If you wanna see what would happen when you flash CM11 you can read our upgrader.sh script that tells the phone the steps needed to back up or wipe certain partitions.

https://github.com/teamacid/android_...1.0/updater.sh

If you're flashing from Gingerbread (BML), your EFS partition gets backed up to the SD card, the kernel/bootimage gets overwritten, then the phone reboots....

Thanks for posting that file, it was interesting to see. I would also like to know, how the 1 GB ROM of the phone is partitioned.
 
FBis251
Old
#6  
FBis251's Avatar
Recognized Contributor
Thanks Meter 3,664
Posts: 3,311
Join Date: Mar 2011

 
DONATE TO ME
Quote:
Originally Posted by llinkll View Post
Thanks for posting that file, it was interesting to see. I would also like to know, how the 1 GB ROM of the phone is partitioned.
Here's the file that defines the partition layout for CM11:
https://github.com/teamacid/niltmt_k...ng_galaxys4g.h

It starts at around line 31, as an example:
Code:
	.name	= "boot",
.offset	= (72*SZ_256K),
.size	= (40*SZ_256K), //101
The offset will tell you how many bytes into the flash chip the particular partition is, this one is at 72 * 256kB blocks which is at 18432kB.
The size of it is 40 256kB blocks. 40 * 256kB = 10,240kB. So the boot partition is starts around 18mB after the first block, and is a size of 10mB.

Once you scroll to the bottom we find the reservoir partition, you can read the description in the comment on that file (line 67).
It ends at (4012 + 84) * 256kB = 1,048,576 kB
The Following User Says Thank You to FBis251 For This Useful Post: [ Click to Expand ]
 
llinkll
Old
#7  
Junior Member
Thanks Meter 20
Posts: 28
Join Date: May 2014
Quote:
Originally Posted by FBis251 View Post
Here's the file that defines the partition layout for CM11:
https://github.com/teamacid/niltmt_k...ng_galaxys4g.h

It starts at around line 31, ....

Thanks a lot for the help, it's really appreciated.

The Following User Says Thank You to llinkll For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes