Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] What happens when you flash?

OP RackMonkey

18th June 2014, 12:10 AM   |  #1  
OP Junior Member
Flag Henderson
Thanks Meter: 0
 
5 posts
Join Date:Joined: Jun 2014
More
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?
18th June 2014, 12:33 AM   |  #2  
Antagonist42's Avatar
Senior Member
Flag Bolton
Thanks Meter: 225
 
583 posts
Join Date:Joined: Feb 2012
More
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
18th June 2014, 02:45 AM   |  #3  
FBis251's Avatar
Recognized Contributor
Thanks Meter: 3,704
 
3,344 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by RackMonkey

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: [ View ]
18th June 2014, 05:00 AM   |  #4  
OP Junior Member
Flag Henderson
Thanks Meter: 0
 
5 posts
Join Date:Joined: Jun 2014
More
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.
18th June 2014, 07:15 AM   |  #5  
Junior Member
Thanks Meter: 21
 
29 posts
Join Date:Joined: May 2014
More
Quote:
Originally Posted by FBis251

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.
19th June 2014, 12:50 AM   |  #6  
FBis251's Avatar
Recognized Contributor
Thanks Meter: 3,704
 
3,344 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by llinkll

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: [ View ]
19th June 2014, 01:34 AM   |  #7  
Junior Member
Thanks Meter: 21
 
29 posts
Join Date:Joined: May 2014
More
Quote:
Originally Posted by FBis251

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: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes