-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is spare address? #204
Comments
As far as I understand, each page has a main content and a spare area, which is a small area that is used to store some metadata regarding the block. ChatGPT says the following about it: https://chatgpt.com/share/6767ee29-cb0c-8011-be7a-819375138b6e. Does this answer your question? 😀 |
Thanks! What about main address. When i change fread to fwrite (and add cpu_physical_memory_read(addr_out, , &s->addr_buff, sizeof(uint8_t)) (variables isn't correct as i typed without looking actual code)) it's drops into recovery console due to corrupt FS. |
Unfortunately, supporting NAND writes is not as simple as changing |
What is VFL and FTL? |
VFL (Virtual Flash Layer) and FTL (Flash Translation Layer) are abstraction layers in the NAND management stack and are responsible for several tasks, including Bad Block Management and Wear Leveling. See for example this presentation, slide 31. |
So we need to implement VFL and/or FTL for NAND writes? |
Well, some VFL/FTL stuff probably needs to happen. I remember that this was quite a challenge, even for to get reads up and running. I should probably write a blog post about this stuff... |
So as i understand, VFL/TFL doing stuff like UART RTS/CTS which controls when to stop. |
We have nand flash located in qemu emulator so we can use it as a reference |
I CAN'T BELIEVE I DID IT! NAND WRITE WORKS A HALF. Now i am implementing spare store (metadata) |
As i understand, spare address located at end of page? |
I think we can copy some code from qemu-ios_generate_nand and write metadata at write function |
That's awesome! And yes, I believe spare addresses are usually at the end of the page. But to beware, I don't remember much about these specifics. It was also a lot of trial and error when I worked on that part 😁 |
Question. Does metadata change on write and does metadata creates at all pages? |
I don't really know unfortunately, sorry. |
I have reviewed your generate nand code. Why some pages have TFL metadata and some have VFL metadata (or any other metadata) why not on all? (in short, why pages like 0 or/and 1 have metadata different from page ex 104?) |
@daniilfigasystems because they are abstraction layers. At the lowest level is VFL IIRC, so some pages only have VFL data. Then there are some designated pages for FTL management as well. |
Which pages have VFL and which FTL? (ex from 1 to 10) |
Now that is a detail I unfortunately don't have from the top of my head. I reverse most of the logic based on the Samsung NAND drivers that were in the leaked iBoot source code so that would provide further hints about where VFL and FTL pages are expected to be. You can probably find this source code on the internet 😁 |
Unfortunately almost all sites/repo containing iBoot was taken down due to DCMA. |
I can't understand what is spare address and what is used for?
The text was updated successfully, but these errors were encountered: