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

[INFO]What is EpicMTD, and what you need to know.

Tip us?
 
xplus93
Old
#31  
Senior Member
Thanks Meter 31
Posts: 301
Join Date: May 2010
Quote:
Originally Posted by JettMartinez View Post
Just to add to this, if you're constantly having trouble with Odin, it's probably your cable causing issues, not Odin. Death to the stock cable!
Really? I've found the stock cable extremely reliable.

---------- Post added at 01:39 AM ---------- Previous post was at 01:28 AM ----------

I actually have a question too. I heard that this would help port roms from other phones like the ns4g. Specifically i want to know about the sense rom that is being worked on on the ns4g. I know how the majority of the community hates sense, but i like it and dont want to downgrade to an evo shift.
 
ehurt152
Old
#32  
ehurt152's Avatar
Senior Member
Thanks Meter 45
Posts: 344
Join Date: Jun 2010
Location: Kingman, AZ
AproSamurai, thanks man, great post!
From 1.5 s-on to 1.40 s-off rEvOlUtIoNaRy! To 1.58 relocked s-off
Thanks to, Unknownforce/Closeone
Thankful to all devs, themers and forum mods!!!
 
dyehya
Old
#33  
Senior Member
Thanks Meter 188
Posts: 228
Join Date: Jan 2011

 
DONATE TO ME
Quote:
Originally Posted by roddygonzo17 View Post
Thanks for a quick reply marcusant. If its not too much of a hassle would you mind making a video and possibly post links for the .tar and .pit to use unless the .pit is the same as for froyo. I just really need my phone and dont want to have to buy another one.

---------- Post added at 07:31 PM ---------- Previous post was at 07:22 PM ----------



The representative from sprint told me that the only way i would have been able to brick it like that (would not turn on, no recovery mode, and no download mode and when plugged the charger in it wouldnt charge or be recognized by the computer) is if i rooted it which voided my warranty and wouldnt be covered by insurance.
http://tinyurl.com/epicfix That will take you back to stock from MTD or corrupt partitions or whatever is wrong with your phone as long as it isn't hard bricked

Quote:
Originally Posted by roddygonzo17 View Post
You know I wasn't really thinking of that at that point, i was just worried about getting my phone back but that would have been a great idea. That way the little stickers that turn red when they get wet would have changed colors since water damage is covered.
Was I helpful in solving your problem please DONATE
Anything at all would be appreciated greatly.

Don't have money to donate? Make my DropBox bigger for free!
The Following User Says Thank You to dyehya For This Useful Post: [ Click to Expand ]
 
Dante of the Inferno
Old
#34  
Senior Member
Thanks Meter 26
Posts: 165
Join Date: Sep 2010
I understand that being on MTD gives us the same partition control that some other smartphones enjoy, but what are the actual benefits? Does it make coding for CM9, etc easier? Does it allow for simple multi-booting? Can CWM still act as a recovery system for MTD ROM's? If not, then what do we use? I don't quite understand how this new partition mapping is actually useful.
 
zanderman112
Old
#35  
zanderman112's Avatar
Recognized Themer
Thanks Meter 1839
Posts: 7,913
Join Date: Oct 2010
Location: SouthEast USA

 
DONATE TO ME
Quote:
Originally Posted by Dante of the Inferno View Post
I understand that being on MTD gives us the same partition control that some other smartphones enjoy, but what are the actual benefits? Does it make coding for CM9, etc easier? Does it allow for simple multi-booting? Can CWM still act as a recovery system for MTD ROM's? If not, then what do we use? I don't quite understand how this new partition mapping is actually useful.
ICS requires more /system space, so this is future proofing our developmental status.

Yes CWM still works as recovery, it just had to be modified for MTD.

/temporary sig

^^^^^^^^^^^^^^^^^^^^^^^^^^Click banner for my Twitter^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<---- I now have a PayPal donate link right over there <----
If you don't wan't to straight up donate via PayPal, these Amazon.com virtual giftcards are always appreciated

My Devices:
 
Sprint Galaxy S3 on Stock Deodexed MB1+Multi-View mod
OUYA 1st Gen on Stock Rooted JZ054L-Ouya
HP Touchpad on patched up webOS 3.0.5 & CyanogenMod 10.1
Samsung Epic 4G on CyanogenMod 10.1 Nightlies
 
codest3r
Old
#36  
codest3r's Avatar
Senior Member
Thanks Meter 59
Posts: 347
Join Date: Oct 2010
Location: Orlando, FL
Quote:
Originally Posted by AproSamurai View Post
I apologize I couldn't have gotten it out sooner. Been a bit busy as of late, my apologies. Things are being worked on now regarding overlay and 911 by the CM team. And then CM will be official and we'll begin to see work on ICS and beyond, if that's of any consolation.:x
I hope that with 911 and Video Overlay working the official status comes in soon!

I'm curious how the boot up process works with BML/RFS (or EXT4) vs MTD/YAFFS2. I've googled and searched around but couldn't find a good comparison. Is there a resource you know of that outlines the steps after power-on with the BML/RFS and MTD/YAFFS2 - that covers what gets mounted, when, and how?

I was hoping it would help me understand why reboot to recovery doesn't work on MTD yet and also why the 3 finger causes loops until you release it.

I found some background and interesting dialogue in another thread on XDA but it left me with more questions than answers.

Nothing critical, just my curiosity about it really. If you have any suggestions on how to better understand the boot process on MTD and get more transparency there I'd love to hear about it. Thanks!
Mobile: LG G2 :: Tablet: Nexus 7 Flo :: Kids: Fuhu Nabi 2 Tablet (x3)
If a member helped you remember to hit Thanks! :: Help get me net some Dropbox referral space!
 
AproSamurai
Old
#37  
AproSamurai's Avatar
Recognized Developer - OP
Thanks Meter 1186
Posts: 1,660
Join Date: Jul 2010
Location: Van Nuys, CA
Quote:
Originally Posted by codest3r View Post
I hope that with 911 and Video Overlay working the official status comes in soon!

I'm curious how the boot up process works with BML/RFS (or EXT4) vs MTD/YAFFS2. I've googled and searched around but couldn't find a good comparison. Is there a resource you know of that outlines the steps after power-on with the BML/RFS and MTD/YAFFS2 - that covers what gets mounted, when, and how?

I was hoping it would help me understand why reboot to recovery doesn't work on MTD yet and also why the 3 finger causes loops until you release it.

I found some background and interesting dialogue in another thread on XDA but it left me with more questions than answers.

Nothing critical, just my curiosity about it really. If you have any suggestions on how to better understand the boot process on MTD and get more transparency there I'd love to hear about it. Thanks!
I myself have been wondering that, almost a month ago when everyone was discussing moving to MTD(I'm not a member of the EpicCM team) I was curious about how the partitions would work and be mounted and I honestly(personal guess) believe it mirrors how BML handles it. I think that is an essential thing for our phone to function in the way that it does. But I'm not the most aware of how and in what way the mounting is executed upon boot which makes it differ, I honestly think we may be overthinking it and it's exactly the same on both of our parts. Just a few differences in what happens when it's mounted. But I've no shame in answering something I'm not sure about, I just can't say I'm right on it lol.
Damn you for asking me the question I've been trying to figure out myself lol.

Also I believe that is more or less how it's linked to the recovery overall and what the functions within the UI to boot into recovery are looking for. In our boot.imgs we have our init and we also have our recovery(to be simple), which is why the oddness happens with 3 finger boot, you releasing it allows it to know when it needs to switch from init to recovery, if you hold on it's at a standstill, it needs to switch from one to another and I don't believe there is a clear path without it switching from one to the other. So that jump for the meantime is just something that isn't too big of a deal, nor is it broken just handled differently.


I hope that was of some help, I can be wrong in some areas though, so if anyone knows differently feel free to correct me.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Devices Owned: Sprint Samsung Moment, Epic 4G, Galaxy S3, HTC One m8
[My GitHub] [My Twitter]
The Following User Says Thank You to AproSamurai For This Useful Post: [ Click to Expand ]
 
mkasick
Old
(Last edited by mkasick; 22nd December 2011 at 10:37 PM.)
#38  
Recognized Developer
Thanks Meter 826
Posts: 470
Join Date: Aug 2009
Quote:
Originally Posted by codest3r View Post
I'm curious how the boot up process works with BML/RFS (or EXT4) vs MTD/YAFFS2.
It's the same process until the kernel and initramfs is loaded. Specifically:
  • SoC ROM code loads and boots the Primitive Bootloader (PBL, boot.bin).
  • PBL searches the device partitions for the Secondary Bootloader (SBL, Sbl.bin), loads, and boots that.
  • SBL checks the "reboot mode" in param.blk (on stl6) and on a normal boot, loads the kernel stored in bml7 with init.rc, and on a recovery boot, loads the kernel stored in bml8. It also checks if the vol-down, camera, and power buttons are presed, and if so, sets the reboot mode for a recovery boot and loads the kernel stored in bml8.
  • The loaded kernel (stored on bml7 or bml8) also contains a initramfs, or root file system image. /init, in the initramfs checks the kernel command-line for a "bootmode" parameter set by SBL, which determines whether init.rc (normal boot) or recovery.rc/fota.rc (recovery boot) should be loaded.
  • As part of executing init.rc (or recovery.rc/fota.rc), the appropriate storage modules are loaded (fsr.ko, fsr_stl.ko, rfs.ko, rfs_glue.ko, j4fs.ko, and param.ko for a BML kernel), and various file-systems are mounted (stl6 as /mnt/.lfs, stl9 as /system, stl10 as /data, and stl11 as /cache for BML).

An MTD kernel differs by the storage drivers used in Linux. Instead of the Samsung proprietary modules, we use the open-source OneNAND MTD driver. Now, our OneNAND chip is different/newer than the one used in other SGS devices, so we actually had to backport the "samsung_audi" driver from the SGSII kernel source tree. Amusingly, the SGSII doesn't use MTD either, but some SGSII development prototype devices did, so somewhere along the line Samsung added that driver to the kernel tree to support their newer OneNAND chips. This is one of the reasons why it took a while to support MTD on our device as the driver that ships with SGS and Nexus S kernels doesn't work for us.

One of the takeaways from the earlier description of the Samsung boot chain is that both PBL and SBL must support I/O to the OneNAND chip, the OneNAND partition table, and the BML partition encoding. Additionally SBL must support STL for flashing via download mode, and for reading/writing param.blk. So, for MTD support, it's critical that retain compatibility with the partition table format, and use BML-encoded partitions for the kernel. Actually, the fact that we're running MTD is essentially invisible to the bootloader, it does the exact same booting sequence until the point that the kernel is booted and "we" have control.

Where MTD differs is in the format of the /system, /data, and /cache partitions. Instead of using RFS (or ext4) on STL, on BML, we use yaffs2 straight on top of MTD. To flash the kernel, CyanogenMod uses a user-space tool, bml_over_mtd, to BML-encode a kernel and write it to the raw MTD device. That's basically it.

Quote:
Originally Posted by codest3r View Post
I was hoping it would help me understand why reboot to recovery doesn't work on MTD yet and also why the 3 finger causes loops until you release it.
I'm not sure why "reboot to recovery" doesn't work yet. As I understand, executing "reboot recovery" from adb or the command-line does work, although I've not verified that behavior myself. There's some bug that must prevent the command from working properly when executed from the UI, that needs to be investigated yet.

As for the three-finger issue, that's an artifact of a fix that we have to use in order to boot into recovery on MTD kernels. The Fascinate, which has the same problem, uses a very similar fix.

Earlier I mentioned that a normal vs recovey boot is determined by the "reboot mode" setting in param.blk. Specifically, when you do a three-finger boot, SBL sets "reboot mode" to boot recovery before loading bml8. Now, it's the responsibility of the recovery kernel to reset the reboot mode in parma.blk back to normal, otherwise SBL will always load bml8 and boot recovery on subsequent reboots/powerups, whether the vol-down, camera, and power buttons are held or not.

Now, the problem is that param.blk is stored on a partition, stl6, that must remain BML/STL/j4fs encoded for bootloader compatibility, and so MTD kernels lack the driver support to mount that partition. Thus, we can't reset the reboot mode setting.

So, the three-finger fix consists of a kernel with a stub initramfs installed to bml8. It's actually a BML kernel, that is, it supports Samsung's storage modules and not MTD. The sole job of this kernel is to reset the reboot mode in param.blk, poke a magic value into persistent memory, and reboot. On reboot, the MTD kernel in bml7 is loaded, checks for our magic value in persistent memory, and boot into recovery. The caveat is that, if you keep the vol-down, camera, and power buttons held, SBL will continue to boot bml8 repeatedly, which continues to reset the reboot mode and reboot the device.

Hope that helps.
The Following 10 Users Say Thank You to mkasick For This Useful Post: [ Click to Expand ]
 
AproSamurai
Old
#39  
AproSamurai's Avatar
Recognized Developer - OP
Thanks Meter 1186
Posts: 1,660
Join Date: Jul 2010
Location: Van Nuys, CA
^^

Everytime you post something new is learned.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Devices Owned: Sprint Samsung Moment, Epic 4G, Galaxy S3, HTC One m8
[My GitHub] [My Twitter]
 
bender beerman
Old
(Last edited by bender beerman; 23rd December 2011 at 02:42 AM.)
#40  
bender beerman's Avatar
Senior Member
Thanks Meter 230
Posts: 675
Join Date: Dec 2010
Location: P-Town
Quote:
Originally Posted by mkasick View Post
...(too long to reasonably repost entire quote)...Hope that helps.
u, sir, are not a fountain of knowledge, but rather a geyser of intelligence. thank u for sharing
~BEER~

Tags
cyanogenmod7, epic4g, future, mtd, opensource
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes