{"id":153,"date":"2024-01-05T18:39:00","date_gmt":"2024-01-05T18:39:00","guid":{"rendered":"https:\/\/thebrokenpipe.com\/blog\/?p=153"},"modified":"2026-04-26T12:30:32","modified_gmt":"2026-04-26T12:30:32","slug":"86-dos-0-11-ibm-pc-port","status":"publish","type":"post","link":"https:\/\/thebrokenpipe.com\/blog\/86-dos-0-11-ibm-pc-port\/","title":{"rendered":"86-DOS 0.11 &#8211; IBM PC Port"},"content":{"rendered":"\n<div style=\"padding: 0.5rem 1rem; margin-bottom: 1rem; color: inherit; border-left: .25em solid #8250df;\" dir=\"auto\">\n  <p style=\"display: flex; font-weight: 500; align-items: center; line-height: 1; color: #8250df; font-size: 20px;\" dir=\"auto\"><svg class=\"octicon mr-2\" style=\"margin-right: 0.5rem !important; display: inline-block; overflow: visible !important; vertical-align: text-bottom; fill: currentColor;\" viewBox=\"0 0 20 20\" version=\"1.1\" width=\"20\" height=\"20\" aria-hidden=\"true\"><path d=\"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path><\/svg>Update<\/p>\n  <p dir=\"auto\">This port is now <u>outdated<\/u>. The latest ports of 86-DOS to the IBM PC are on <a href=\"https:\/\/github.com\/TheBrokenPipe\/86-DOS_PCAdaptation\">GitHub<\/a> and binaries may be downloaded from there too.<\/p>\n<\/div>\n\n\n\n<p>This is not a writeup, the port is still WIP. I&#8217;m just dumping whatever I&#8217;ve done here for people to see, because xmas and new year holidays are now over and I don&#8217;t want to devote any more of my very limited free time to projects like this.<\/p>\n\n\n\n<p>A few days ago, <a href=\"https:\/\/github.com\/geneb\">Gene Buckle<\/a> uploaded <a href=\"https:\/\/archive.org\/details\/86-dos-version-0.1-c-serial-11-original-disk\">86-DOS 0.11<\/a> and <a href=\"https:\/\/archive.org\/details\/86-dos-version-0.34-c-serial-221-original-disk\">0.34<\/a> to the <a href=\"http:\/\/archive.org\">Internet Archive<\/a>. After about 2 hours of coding and debugging, perhaps the oldest surviving piece of x86 software booted on the (emulated) IBM PC:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_boot-1024x632.png\" alt=\"\" class=\"wp-image-262\" style=\"width:700px\" srcset=\"https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_boot-1024x632.png 1024w, https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_boot-300x185.png 300w, https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_boot-768x474.png 768w, https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_boot.png 1084w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<!--more-->\n\n\n\n<p>I didn&#8217;t do anything too fancy &#8211; just modified the BIOS from my <a href=\"\/blog\/porting-86-dos-1-14-to-the-ibm-pc\/\">86-DOS 1.14 port<\/a> to simulate 128-byte sectors. As with my 1.14 port, I patched the kernel to use PC-DOS&#8217; special editing commands, patched <code>RDCPM<\/code> to read CP\/M-86 disks and rewrote <code>SYS<\/code>.<\/p>\n\n\n\n<p>Everything works, but it is slow as a sloth. To workaround the stack overflows, I made the BIOS switch to an internal stack for every single call. Also, I did not implement buffered I\/O &#8211; sequential reads are 4 times slower and sequential writes are 8 times slower (though I do have experimental buffered disk reading code).<\/p>\n\n\n\n<p>If you&#8217;re interested in improving my code or implementing proper buffered I\/O, drop a comment here and I can send you my BIOS source code.<\/p>\n\n\n\n<p>Random note: 86-DOS 0.11&#8217;s FCB search function returns a 16-byte directory entry, rather than an unopened FCB. This makes its <code>COMMAND.COM<\/code> misbehave under later DOS versions.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_cmd_err-1024x632.png\" alt=\"\" class=\"wp-image-261\" style=\"width:700px\" srcset=\"https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_cmd_err-1024x632.png 1024w, https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_cmd_err-300x185.png 300w, https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_cmd_err-768x474.png 768w, https:\/\/thebrokenpipe.com\/blog\/wp-content\/uploads\/2024\/01\/86-dos_011_cmd_err.png 1084w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Last thing &#8211; I have a plan to reconstruct the source code of 86-DOS 0.11, because this version is historically significant, it&#8217;s the earliest version of DOS (apart from QDOS 0.10, which was never released). I have already disassembled some binaries, but they&#8217;re really just the low hanging fruits like <code>COMMAND.COM<\/code>, <code>SYS.COM<\/code> and <code>HEX2BIN.COM<\/code>. If you have experience reverse engineering 8086\/DOS code, please consider helping out, thanks!!<\/p>\n\n\n\n<p>Edit: It&#8217;s been a week, I&#8217;ve contacted a few people and nobody is willing to lend a hand. I&#8217;m just going to reup the binaries with <code>IO.ASM<\/code> and <code>SYS.ASM<\/code>. If you&#8217;d like to contribute, go ahead and use these sources!<\/p>\n\n\n\n<p><s>WIP PC port + <code>COMMAND.COM<\/code>, <code>SYS.COM<\/code> and <code>HEX2BIN.COM<\/code> src: <a href=\"https:\/\/mega.nz\/file\/4EZ2kLCB#pNJ4iRM2DqsQ9YJ9oAZWTsn4DLy0dH3LpsRdJDCel6U\">https:\/\/mega.nz\/file\/4EZ2kLCB#pNJ4iRM2DqsQ9YJ9oAZWTsn4DLy0dH3LpsRdJDCel6U<\/a><br><\/s><\/p>\n\n\n\n<p><s>Edit 2: With <code>IO.ASM<\/code> and <code>SYS.ASM<\/code>:<\/s> <a href=\"https:\/\/mega.nz\/file\/JZpUBRKL#0ANcb2NKVELClamu0kRZknhl4WrHhXn7r_df9NabPXY\"><s>https:\/\/mega.nz\/file\/JZpUBRKL#0ANcb2NKVELClamu0kRZknhl4WrHhXn7r_df9NabPXY<\/s><\/a><br><\/p>\n\n\n\n<p>Edit 3: <a href=\"https:\/\/github.com\/TheBrokenPipe\/86-DOS_PCAdaptation\">PC port<\/a> and <a href=\"https:\/\/github.com\/TheBrokenPipe\/86-DOS-0.11\">source code reconstruction<\/a> are now on GitHub.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update This port is now outdated. The latest ports of 86-DOS to the IBM PC are on GitHub and binaries may be downloaded from there too. This is not a writeup, the port is still WIP. I&#8217;m just dumping whatever I&#8217;ve done here for people to see, because xmas and new year holidays are now [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-dos","category-reverse-engineering"],"_links":{"self":[{"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":5,"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":263,"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions\/263"}],"wp:attachment":[{"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thebrokenpipe.com\/blog\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}