{"id":18147483,"url":"https://github.com/thestaticturtle/mbr-fat32-adventures","last_synced_at":"2025-04-06T21:28:01.608Z","repository":{"id":44986509,"uuid":"513198309","full_name":"TheStaticTurtle/mbr-fat32-adventures","owner":"TheStaticTurtle","description":"Scratchpad repo used to learn the inner workings of MBR \u0026 FAT 32","archived":false,"fork":false,"pushed_at":"2022-07-15T01:13:24.000Z","size":342,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T15:53:37.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheStaticTurtle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-12T15:35:45.000Z","updated_at":"2022-07-12T15:39:17.000Z","dependencies_parsed_at":"2022-07-13T03:30:32.410Z","dependency_job_id":null,"html_url":"https://github.com/TheStaticTurtle/mbr-fat32-adventures","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2Fmbr-fat32-adventures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2Fmbr-fat32-adventures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2Fmbr-fat32-adventures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2Fmbr-fat32-adventures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheStaticTurtle","download_url":"https://codeload.github.com/TheStaticTurtle/mbr-fat32-adventures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247553193,"owners_count":20957425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-01T22:06:41.300Z","updated_at":"2025-04-06T21:28:01.588Z","avatar_url":"https://github.com/TheStaticTurtle.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mbr-fat32-adventures\nScratchpad repo used to learn the inner workings of MBR \u0026 FAT32/16\n\n## Links\nRessources I used to read this pile of shit\n - https://en.wikipedia.org/wiki/Master_boot_record\n - https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system\n - https://www.cs.fsu.edu/~cop4610t/lectures/project3/Week11/Slides_week11.pdf\n - https://www.cs.fsu.edu/~cop4610t/assignments/project3/spec/fatspec.pdf\n - https://www.pjrc.com/tech/8051/ide/fat32.html\n - https://cscie92.dce.harvard.edu/spring2021/slides/FAT32%20File%20Structure.pdf\n - (Probably forgot some)\n \n## Current state of things:\n#### MBR:\n - ✅ Read MBR boot sector\n#### Bios parameter block:\n - ✅ Read DOS2.0 bios parameter block\n - ✅ Read DOS3.31 bios parameter block\n - ✅ Read Extended bios parameter block\n - ✅ Read FAT32 Extended bios parameter block\n#### FAT32 partition:\n - ✅ Read FAT32 boot sector\n - ✅ Read FAT32 information sector\n - ✅ Read FAT32 FAT table(s)\n - ✅ Read entries in FAT32 Root directory cluster with LFNs handling\n - ❌ Read all directories in FAT32 part (shouldn't be complicated)\n - ❌ Read files in FAT32 part (shouldn't be complicated)\n#### FAT16 partition:\n - ✅ Read FAT16 boot sector\n - ❌ Read FAT16 FAT table(s)\n - ❌ Read entries in FAT32 Root directory cluster with LFNs handling\n - ❌ Read all directories in FAT16 part\n - ❌ Read files in FAT16 part\n#### Extended partition:\n - ❌ Read MBR extended partition\n\n![result_example](https://user-images.githubusercontent.com/17061996/179110745-35a54265-ed90-4fb0-bd94-65456be36dbd.png)\n \n## Usage:\nNeed a file named \"file\" representing a disk image with one primary fat32 partition and multiple extended fat32 partitions\n\n![image](https://user-images.githubusercontent.com/17061996/178532228-cea01d02-24ca-40b8-9aae-7c467eaf07a1.png)\n\n## Commands\n```bash\n# Mount file to partitionned loop:\nsudo losetup -P /dev/loop18 file\n# Detach loop\nsudo losetup -d /dev/loop18\n\n# Create filesystem\nsudo mkfs.fat /dev/loop18p1 -n PART1\nsudo mkfs.fat /dev/loop18p5 -n PART5\nsudo mkfs.fat /dev/loop18p6 -n PART6\nsudo mkfs.fat /dev/loop18p7 -n PART7\nsudo mkfs.fat /dev/loop18p8 -n PART8\nsudo mkfs.fat /dev/loop18p9 -n PART9\nsudo mkfs.fat /dev/loop18p10 -n PART10\nsudo mkfs.fat /dev/loop18p11 -n PART11\nsudo mkfs.fat /dev/loop18p12 -n PART12\nsudo mkfs.fat /dev/loop18p13 -n PART13\nsudo mkfs.fat /dev/loop18p14 -n PART14\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthestaticturtle%2Fmbr-fat32-adventures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthestaticturtle%2Fmbr-fat32-adventures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthestaticturtle%2Fmbr-fat32-adventures/lists"}