{"id":1069,"date":"2022-11-09T21:15:18","date_gmt":"2022-11-10T02:15:18","guid":{"rendered":"https:\/\/www.ecsdump.net\/?p=1069"},"modified":"2022-11-09T21:15:18","modified_gmt":"2022-11-10T02:15:18","slug":"oemboot","status":"publish","type":"post","link":"https:\/\/www.ecsdump.net\/?p=1069","title":{"rendered":"oemboot"},"content":{"rendered":"\n<p>To build on the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ecsdump.net\/?p=1044\" data-type=\"URL\" data-id=\"https:\/\/www.ecsdump.net\/?p=1044\" target=\"_blank\">vdi_info post<\/a>, I am throwing in my oemboot file. I have used this several times over the years in various forms, in general just to get a loader binary into memory. In its current form it uses LBA after doing an int 13 0x41 check error. Are there bugs? Maybe. It works for my purposes.<\/p>\n\n\n\n<p>Here is a brief description of how it works:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1. Scan directory for a loader file with a name defined by LOADFILE, 8.3 format<\/li>\n\n\n\n<li>2. Loads LOADFILE to memory defined by LOAD_SEG and LOAD_OFF, I use 0x7C000.<\/li>\n\n\n\n<li>3. Far jump to start of loader. The <em>jmp far ptr loader_start<\/em> is around line 470 and before the jump I load registers with &#8220;stuff&#8221; I want to pass to the loader.<\/li>\n<\/ul>\n\n\n\n<p>Some simple <a href=\"https:\/\/en.wikipedia.org\/wiki\/BIOS_parameter_block\" data-internallinksmanager029f6b8e52c=\"4\" title=\"BPB\" target=\"_blank\" rel=\"noopener\">BPB<\/a> Error Codes:<br>1 &#8211; No bios extensions &#8211; IBM\/MS INT 13 Extensions not supported<br>2 &#8211; Root directory read &#8211; could not read root directory<br>3 &#8211; LOADFILE not found<br>5 &#8211; FAT error &#8211; bad read or sig error<\/p>\n\n\n\n<p>That is about it. The oemboot.asm file is very commented with good info and random thoughts, so I could remember why I had done certain things. The example files are located:<\/p>\n\n\n\n<p>Code repo:   <a rel=\"noreferrer noopener\" href=\"https:\/\/gitlab.com\/mikeos2\/vdi_info\" data-type=\"URL\" data-id=\"https:\/\/gitlab.com\/mikeos2\/vdi_info\" target=\"_blank\">Gitlab<\/a>  or  <a rel=\"noreferrer noopener\" href=\"https:\/\/greenenet.ddns.net\/misc_public\/vdi_info\" data-type=\"URL\" data-id=\"https:\/\/greenenet.ddns.net\/misc_public\/vdi_info\" target=\"_blank\">My Gitlab<\/a><\/p>\n\n\n\n<p>Okay, let&#8217;s put my simple test environment together. I make a raw vdi image then run it attached to a VM so I can format it to FAT16 and make the partition active. Next, I use <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ecsdump.net\/?p=1044\" data-type=\"post\" data-id=\"1044\" target=\"_blank\">vdi_info.exe<\/a> to create <em>bootpbp.inc<\/em> which will be an include for <em>oemboot.asm<\/em>. I use <a rel=\"noreferrer noopener\" href=\"http:\/\/www.terraspace.co.uk\/uasm.html\" data-type=\"URL\" data-id=\"http:\/\/www.terraspace.co.uk\/uasm.html\" target=\"_blank\">uasm<\/a> to compile <em>oemboot.asm<\/em> with the following commands:<\/p>\n\n\n\n<p><code>uasm32 -bin [path to includes] -Fo oemboot.bin oemboot.asm<\/code><\/p>\n\n\n\n<p>I write the <em>oemboot.bin <\/em>back to the vdi using the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ecsdump.net\/?p=1044\" data-type=\"post\" data-id=\"1044\" target=\"_blank\">vdi_info.exe<\/a> -w option. Next, the loader I am using just gets copied to the FAT16 vdi and boot with <a href=\"https:\/\/github.com\/bochs-emu\/Bochs\" data-type=\"URL\" data-id=\"https:\/\/github.com\/bochs-emu\/Bochs\" target=\"_blank\" rel=\"noreferrer noopener\">bochs<\/a>. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To build on the vdi_info post, I am throwing in my oemboot file. I have used this several times over the years in various forms, in general just to get a loader binary into memory. In its current form it uses LBA after doing an int 13 0x41 check error. Are there bugs? Maybe. It&hellip;<\/p>\n<p><a class=\"more-link\" href=\"https:\/\/www.ecsdump.net\/?p=1069\" title=\"Continue reading &lsquo;oemboot&rsquo;\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,110,12],"tags":[98,71],"class_list":["post-1069","post","type-post","status-publish","format-standard","hentry","category-boot-process","category-uasm","category-watcom","tag-boot-sector","tag-watcom"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/posts\/1069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1069"}],"version-history":[{"count":0,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/posts\/1069\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}