-
Notifications
You must be signed in to change notification settings - Fork 503
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
Add support for GPT partition tables #406
base: master
Are you sure you want to change the base?
Conversation
Separated partition table reading into a new file and added GPT partition table support. Removed check for MBR partition boot being 0x00 / 0x80. Some systems use other values here if the partition is marked as bootable.
I probably won't add this since I have a policy of only supporting the official SD Association format. |
Hmm, ok. The newest SDUC format does use GPT officially also, but I guess there are other things that prevent it from working currently. |
The official format specifies a single layout for a given size card and manufactures arrange flash, buffing and algorithms according to this layout. Buffering for FAT areas is different form data areas. Management of flash record units, fragmentation, and wear leveling is based on this layout. You should not use a PC, Mac, Linux, or other method to format SD cards. Use the official SD formatter. |
Yeah, I can agree with that. Though I guess even the existing support for partitions 2-4 goes beyond the SD card official spec? If you feel like SdFat is better off without this, feel free to close this pull request. I'll just figure out a way to do it out-of-tree. I see that SdFat 2.2.0 added the |
SD cards have a single partition and almost every field from Medium Identifier to Cluster Size is specified for a given SD size. The first 32,768 sectors must only contain the Master Boot Record and Partition Table. This is for reliability so this area will never need rewrite for wear leveling. So most of the first 16 MiB is not used. The exFAT Up-case Table is totally specified. |
Especially Mac OS X Disk Utility formats SD cards as GPT partition table by default.
This pull request adds support in SdFat to access these SD cards also.