{"action":"created","comment":{"url":"https://api.github.com/repos/stsp/dosemu2/pulls/comments/92217035","pull_request_review_id":12728521,"id":92217035,"diff_hunk":"@@ -399,12 +425,30 @@ static void set_geometry(fatfs_t *f, unsigned char *b)\n   bpb->sectors_per_track = f->secs_track;\n   bpb->num_heads = f->heads;\n \n-  if (bpb->num_sectors_small != 0) { // Could be any version BPB, assume v3.0\n-    // Not compatible with 3.2, or 3.31 & later, but replicates earlier code\n-    bpb->v300.hidden_sectors = f->hidden_secs;\n-  } else {                          // Must be FAT16B so can assume v3.31+ BPB\n-    bpb->v331.hidden_sectors = f->hidden_secs;;\n-    bpb->v331.num_sectors_large = f->total_secs;\n+  if (BPB_IS_V400(bpb)) {\n+    bpb->v400.hidden_sectors = f->hidden_secs;;\n+    bpb->v400.num_sectors_large = (f->total_secs < 65536L) ? 0 : f->total_secs;\n+    bpb->v400.drive_number = f->drive_num;\n+\n+  } else if (BPB_IS_V340(bpb)) {\n+    bpb->v340.hidden_sectors = f->hidden_secs;;\n+    bpb->v340.num_sectors_large = (f->total_secs < 65536L) ? 0 : f->total_secs;\n+    bpb->v340.drive_number = f->drive_num;\n+\n+  } else if (f->sys_type == OLDDRD_D) { // DR-DOS 3.40 / 3.41 has v3.20 BPB\n+    bpb->v320.hidden_sectors = f->hidden_secs;\n+    bpb->v320.num_sectors_large = (f->total_secs < 65536L) ? 0 : f->total_secs;\n+    // drive_number not passed in boot block as string data in 0x1fd position","path":"src/base/misc/fatfs.c","position":56,"original_position":56,"commit_id":"9ecfe968b21972a7b8b658fcf51938e7f292a926","original_commit_id":"9ecfe968b21972a7b8b658fcf51938e7f292a926","user":{"login":"andrewbird","id":220835,"avatar_url":"https://avatars.githubusercontent.com/u/220835?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewbird","html_url":"https://github.com/andrewbird","followers_url":"https://api.github.com/users/andrewbird/followers","following_url":"https://api.github.com/users/andrewbird/following{/other_user}","gists_url":"https://api.github.com/users/andrewbird/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewbird/subscriptions","organizations_url":"https://api.github.com/users/andrewbird/orgs","repos_url":"https://api.github.com/users/andrewbird/repos","events_url":"https://api.github.com/users/andrewbird/events{/privacy}","received_events_url":"https://api.github.com/users/andrewbird/received_events","type":"User","site_admin":false},"body":"My feeling is that it's not passed, it's discovered in the boot code somehow. After all it's only the drive number that was correct at the time the file system was made. It would seem disassembling the real boot block, or perhaps doing format /s on D: under DR-DOS 3.41 and comparing is the only way to find out.","created_at":"2016-12-13T17:09:29Z","updated_at":"2016-12-13T17:09:29Z","html_url":"https://github.com/stsp/dosemu2/pull/273#discussion_r92217035","pull_request_url":"https://api.github.com/repos/stsp/dosemu2/pulls/273","_links":{"self":{"href":"https://api.github.com/repos/stsp/dosemu2/pulls/comments/92217035"},"html":{"href":"https://github.com/stsp/dosemu2/pull/273#discussion_r92217035"},"pull_request":{"href":"https://api.github.com/repos/stsp/dosemu2/pulls/273"}}},"pull_request":{"url":"https://api.github.com/repos/stsp/dosemu2/pulls/273","id":97426070,"html_url":"https://github.com/stsp/dosemu2/pull/273","diff_url":"https://github.com/stsp/dosemu2/pull/273.diff","patch_url":"https://github.com/stsp/dosemu2/pull/273.patch","issue_url":"https://api.github.com/repos/stsp/dosemu2/issues/273","number":273,"state":"open","locked":false,"title":"disks: Be smarter with pre v3.40 bootblocks","user":{"login":"andrewbird","id":220835,"avatar_url":"https://avatars.githubusercontent.com/u/220835?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewbird","html_url":"https://github.com/andrewbird","followers_url":"https://api.github.com/users/andrewbird/followers","following_url":"https://api.github.com/users/andrewbird/following{/other_user}","gists_url":"https://api.github.com/users/andrewbird/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewbird/subscriptions","organizations_url":"https://api.github.com/users/andrewbird/orgs","repos_url":"https://api.github.com/users/andrewbird/repos","events_url":"https://api.github.com/users/andrewbird/events{/privacy}","received_events_url":"https://api.github.com/users/andrewbird/received_events","type":"User","site_admin":false},"body":"1/ Set drive number on pre v3.40 bootblocks only where we have\r\na valid drive already, as it seems having the drive number defined\r\nat offset 0x1fd is not as widespread as it first seemed.\r\n\r\n2/ Be smarter in mkfatimage BPB modification of existing bootblocks.\r\nThis fixes FAT12/FAT16 image file boot with DR-DOS 3.40","created_at":"2016-12-10T14:03:33Z","updated_at":"2016-12-13T17:09:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edff36ef467693200a880e0f40ef8746fc90b18e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/stsp/dosemu2/pulls/273/commits","review_comments_url":"https://api.github.com/repos/stsp/dosemu2/pulls/273/comments","review_comment_url":"https://api.github.com/repos/stsp/dosemu2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stsp/dosemu2/issues/273/comments","statuses_url":"https://api.github.com/repos/stsp/dosemu2/statuses/9ecfe968b21972a7b8b658fcf51938e7f292a926","head":{"label":"andrewbird:disks07","ref":"disks07","sha":"9ecfe968b21972a7b8b658fcf51938e7f292a926","user":{"login":"andrewbird","id":220835,"avatar_url":"https://avatars.githubusercontent.com/u/220835?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewbird","html_url":"https://github.com/andrewbird","followers_url":"https://api.github.com/users/andrewbird/followers","following_url":"https://api.github.com/users/andrewbird/following{/other_user}","gists_url":"https://api.github.com/users/andrewbird/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewbird/subscriptions","organizations_url":"https://api.github.com/users/andrewbird/orgs","repos_url":"https://api.github.com/users/andrewbird/repos","events_url":"https://api.github.com/users/andrewbird/events{/privacy}","received_events_url":"https://api.github.com/users/andrewbird/received_events","type":"User","site_admin":false},"repo":{"id":35490929,"name":"dosemu2","full_name":"andrewbird/dosemu2","owner":{"login":"andrewbird","id":220835,"avatar_url":"https://avatars.githubusercontent.com/u/220835?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewbird","html_url":"https://github.com/andrewbird","followers_url":"https://api.github.com/users/andrewbird/followers","following_url":"https://api.github.com/users/andrewbird/following{/other_user}","gists_url":"https://api.github.com/users/andrewbird/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewbird/subscriptions","organizations_url":"https://api.github.com/users/andrewbird/orgs","repos_url":"https://api.github.com/users/andrewbird/repos","events_url":"https://api.github.com/users/andrewbird/events{/privacy}","received_events_url":"https://api.github.com/users/andrewbird/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewbird/dosemu2","description":"Run DOS programs under linux:","fork":true,"url":"https://api.github.com/repos/andrewbird/dosemu2","forks_url":"https://api.github.com/repos/andrewbird/dosemu2/forks","keys_url":"https://api.github.com/repos/andrewbird/dosemu2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewbird/dosemu2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewbird/dosemu2/teams","hooks_url":"https://api.github.com/repos/andrewbird/dosemu2/hooks","issue_events_url":"https://api.github.com/repos/andrewbird/dosemu2/issues/events{/number}","events_url":"https://api.github.com/repos/andrewbird/dosemu2/events","assignees_url":"https://api.github.com/repos/andrewbird/dosemu2/assignees{/user}","branches_url":"https://api.github.com/repos/andrewbird/dosemu2/branches{/branch}","tags_url":"https://api.github.com/repos/andrewbird/dosemu2/tags","blobs_url":"https://api.github.com/repos/andrewbird/dosemu2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewbird/dosemu2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewbird/dosemu2/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewbird/dosemu2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewbird/dosemu2/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewbird/dosemu2/languages","stargazers_url":"https://api.github.com/repos/andrewbird/dosemu2/stargazers","contributors_url":"https://api.github.com/repos/andrewbird/dosemu2/contributors","subscribers_url":"https://api.github.com/repos/andrewbird/dosemu2/subscribers","subscription_url":"https://api.github.com/repos/andrewbird/dosemu2/subscription","commits_url":"https://api.github.com/repos/andrewbird/dosemu2/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewbird/dosemu2/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewbird/dosemu2/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewbird/dosemu2/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewbird/dosemu2/contents/{+path}","compare_url":"https://api.github.com/repos/andrewbird/dosemu2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewbird/dosemu2/merges","archive_url":"https://api.github.com/repos/andrewbird/dosemu2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewbird/dosemu2/downloads","issues_url":"https://api.github.com/repos/andrewbird/dosemu2/issues{/number}","pulls_url":"https://api.github.com/repos/andrewbird/dosemu2/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewbird/dosemu2/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewbird/dosemu2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewbird/dosemu2/labels{/name}","releases_url":"https://api.github.com/repos/andrewbird/dosemu2/releases{/id}","deployments_url":"https://api.github.com/repos/andrewbird/dosemu2/deployments","created_at":"2015-05-12T13:52:28Z","updated_at":"2016-03-28T09:26:04Z","pushed_at":"2016-12-13T13:45:09Z","git_url":"git://github.com/andrewbird/dosemu2.git","ssh_url":"git@github.com:andrewbird/dosemu2.git","clone_url":"https://github.com/andrewbird/dosemu2.git","svn_url":"https://github.com/andrewbird/dosemu2","homepage":"http://stsp.github.io/dosemu2/","size":11569,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"stsp:devel","ref":"devel","sha":"09706109e9e926a4a4d29eb70ce7abae1bb07f0d","user":{"login":"stsp","id":3295627,"avatar_url":"https://avatars.githubusercontent.com/u/3295627?v=3","gravatar_id":"","url":"https://api.github.com/users/stsp","html_url":"https://github.com/stsp","followers_url":"https://api.github.com/users/stsp/followers","following_url":"https://api.github.com/users/stsp/following{/other_user}","gists_url":"https://api.github.com/users/stsp/gists{/gist_id}","starred_url":"https://api.github.com/users/stsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stsp/subscriptions","organizations_url":"https://api.github.com/users/stsp/orgs","repos_url":"https://api.github.com/users/stsp/repos","events_url":"https://api.github.com/users/stsp/events{/privacy}","received_events_url":"https://api.github.com/users/stsp/received_events","type":"User","site_admin":false},"repo":{"id":24825619,"name":"dosemu2","full_name":"stsp/dosemu2","owner":{"login":"stsp","id":3295627,"avatar_url":"https://avatars.githubusercontent.com/u/3295627?v=3","gravatar_id":"","url":"https://api.github.com/users/stsp","html_url":"https://github.com/stsp","followers_url":"https://api.github.com/users/stsp/followers","following_url":"https://api.github.com/users/stsp/following{/other_user}","gists_url":"https://api.github.com/users/stsp/gists{/gist_id}","starred_url":"https://api.github.com/users/stsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stsp/subscriptions","organizations_url":"https://api.github.com/users/stsp/orgs","repos_url":"https://api.github.com/users/stsp/repos","events_url":"https://api.github.com/users/stsp/events{/privacy}","received_events_url":"https://api.github.com/users/stsp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stsp/dosemu2","description":"Run DOS programs under linux:","fork":false,"url":"https://api.github.com/repos/stsp/dosemu2","forks_url":"https://api.github.com/repos/stsp/dosemu2/forks","keys_url":"https://api.github.com/repos/stsp/dosemu2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stsp/dosemu2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stsp/dosemu2/teams","hooks_url":"https://api.github.com/repos/stsp/dosemu2/hooks","issue_events_url":"https://api.github.com/repos/stsp/dosemu2/issues/events{/number}","events_url":"https://api.github.com/repos/stsp/dosemu2/events","assignees_url":"https://api.github.com/repos/stsp/dosemu2/assignees{/user}","branches_url":"https://api.github.com/repos/stsp/dosemu2/branches{/branch}","tags_url":"https://api.github.com/repos/stsp/dosemu2/tags","blobs_url":"https://api.github.com/repos/stsp/dosemu2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stsp/dosemu2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stsp/dosemu2/git/refs{/sha}","trees_url":"https://api.github.com/repos/stsp/dosemu2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stsp/dosemu2/statuses/{sha}","languages_url":"https://api.github.com/repos/stsp/dosemu2/languages","stargazers_url":"https://api.github.com/repos/stsp/dosemu2/stargazers","contributors_url":"https://api.github.com/repos/stsp/dosemu2/contributors","subscribers_url":"https://api.github.com/repos/stsp/dosemu2/subscribers","subscription_url":"https://api.github.com/repos/stsp/dosemu2/subscription","commits_url":"https://api.github.com/repos/stsp/dosemu2/commits{/sha}","git_commits_url":"https://api.github.com/repos/stsp/dosemu2/git/commits{/sha}","comments_url":"https://api.github.com/repos/stsp/dosemu2/comments{/number}","issue_comment_url":"https://api.github.com/repos/stsp/dosemu2/issues/comments{/number}","contents_url":"https://api.github.com/repos/stsp/dosemu2/contents/{+path}","compare_url":"https://api.github.com/repos/stsp/dosemu2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stsp/dosemu2/merges","archive_url":"https://api.github.com/repos/stsp/dosemu2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stsp/dosemu2/downloads","issues_url":"https://api.github.com/repos/stsp/dosemu2/issues{/number}","pulls_url":"https://api.github.com/repos/stsp/dosemu2/pulls{/number}","milestones_url":"https://api.github.com/repos/stsp/dosemu2/milestones{/number}","notifications_url":"https://api.github.com/repos/stsp/dosemu2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stsp/dosemu2/labels{/name}","releases_url":"https://api.github.com/repos/stsp/dosemu2/releases{/id}","deployments_url":"https://api.github.com/repos/stsp/dosemu2/deployments","created_at":"2014-10-05T20:33:23Z","updated_at":"2016-11-18T13:09:11Z","pushed_at":"2016-12-13T16:25:33Z","git_url":"git://github.com/stsp/dosemu2.git","ssh_url":"git@github.com:stsp/dosemu2.git","clone_url":"https://github.com/stsp/dosemu2.git","svn_url":"https://github.com/stsp/dosemu2","homepage":"http://stsp.github.io/dosemu2/","size":13791,"stargazers_count":35,"watchers_count":35,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":38,"forks":10,"open_issues":38,"watchers":35,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/stsp/dosemu2/pulls/273"},"html":{"href":"https://github.com/stsp/dosemu2/pull/273"},"issue":{"href":"https://api.github.com/repos/stsp/dosemu2/issues/273"},"comments":{"href":"https://api.github.com/repos/stsp/dosemu2/issues/273/comments"},"review_comments":{"href":"https://api.github.com/repos/stsp/dosemu2/pulls/273/comments"},"review_comment":{"href":"https://api.github.com/repos/stsp/dosemu2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stsp/dosemu2/pulls/273/commits"},"statuses":{"href":"https://api.github.com/repos/stsp/dosemu2/statuses/9ecfe968b21972a7b8b658fcf51938e7f292a926"}}}}
{"actor":{"display_login":"andrewbird"}}