{"id":798,"date":"2020-12-06T18:07:54","date_gmt":"2020-12-06T18:07:54","guid":{"rendered":"https:\/\/www.ecsdump.net\/?page_id=798"},"modified":"2020-12-09T06:35:25","modified_gmt":"2020-12-09T11:35:25","slug":"jfs-boot-block-bochs-adventure","status":"publish","type":"page","link":"https:\/\/www.ecsdump.net\/?page_id=798","title":{"rendered":"JFS Boot Block :: Bochs Adventure"},"content":{"rendered":"<div class=\"field field-name-body field-type-text-with-summary field-label-hidden\">\n<div class=\"field-items\">\n<div class=\"field-item even\">\n<p>So, getting a MBR and os2boot on a hard drive image was a real pain. None of the current CDs would boot to a point where I could get the job done. I resorted to doing it the hard way. I mounted an old 630 meg IDE hard drive (just having this around should label me a packrat) and booted the system with an eCS 2.0 RC4 CDROM. Using the eCS tools I made a compatible partition which was bootable and wrote the MBR. Next, I did a long JFS format on the partition which completed but with errors toward the end of the format process.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"field field-name-field-geshi field-type-geshifield field-label-above\">\n<div class=\"field-label\">Geshi:<\/div>\n<div class=\"field-items\">\n<div class=\"field-item even\">\n<div class=\"geshifilter\">\n<pre class=\"asm geshifilter-asm\">eax: 0x0000aa55 43605\necx: 0x00000000 0\nedx: 0x00000080 128\nebx: 0x00000000 0\nesp: 0x0000ffdc 65500\nebp: 0x00000000 0\nesi: 0xffff0000 -65536\nedi: 0x0008fdba 589242\neip: 0x00007c00\neflags 0x00000082\nIOPL=0 id vip vif ac vm rf nt of df if tf SF zf af pf cf\n\u00a0\ncs:s=0x0000, dl=0x0000ffff, dh=0x00009b00, valid=1\nds:s=0x0000, dl=0x0000ffff, dh=0x00009300, valid=1\nss:s=0x0000, dl=0x0000ffff, dh=0x00009300, valid=7\nes:s=0x0000, dl=0x0000ffff, dh=0x00009300, valid=1\nfs:s=0x0000, dl=0x0000ffff, dh=0x00009300, valid=1\ngs:s=0x0000, dl=0x0000ffff, dh=0x00009300, valid=1\nldtr:s=0x0000, dl=0x00000000, dh=0x00000000, valid=0\ntr:s=0x0000, dl=0x00000000, dh=0x00000000, valid=0\ngdtr:base=0x000faeb2, limit=0x30\nidtr:base=0x00000000, limit=0x3ff<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Phase 1 \u2014 The MBR<\/p>\n<p>In brief, control is passed from BIOS to the loaded MBR code at 07C0:0000. The code relocates itself to 07E0:0000, checks for a Boot Manager partition, and checks for a bootable partition. Once a bootable partition is found, the partition boot record or more correctly the BIOS parameter block (<a href=\"https:\/\/en.wikipedia.org\/wiki\/BIOS_parameter_block\" data-internallinksmanager029f6b8e52c=\"4\" title=\"BPB\" target=\"_blank\" rel=\"noopener\">BPB<\/a>) is loaded at 07C0:0000 and control is passed to it at 07C0:0000.<\/p>\n<p>Remember, as I understand the MBR is created by the LVM utility (ex: LVM \/NEWMBR). At this point the system is using INT13 calls to interface with the drive. The errors that can be encountered during this phase are:<\/p>\n<ul>\n<li>SYS01462<\/li>\n<li>SYS01463<\/li>\n<li>SYS01464<\/li>\n<\/ul>\n<p>More detailed information can be found here:<\/p>\n<p><a href=\"https:\/\/www.ecsdump.net\/?page_id=257\">LVM MBR Disassembled<\/a><\/p>\n<p>Phase 2 \u2014 The Partition Boot Block<\/p>\n<p>This code uses INT 12 to, in general, find the top of low memory. Next, the result (approx 639) has 54h subtracted, AND result with FFF0h, and then shifted left 6 bits. This will be the load segment for the next code file (ie calculated load segment). The Bochs drive returns 639 from the INT12 call, so the load segment is 8800h.<\/p>\n<p>All disk access during this phase uses INT13 calls to interface with the drive. After loading the next module a far return to (calculated load segment):199C is performed. This code is placed in the partition when the sysinstx.com file is run against it. So, the sysinstx.com executable writes the partition sector\/micro-FSD and os2boot.<\/p>\n<p>The errors that can be encountered during this phase are:<\/p>\n<ul>\n<li>an error when performing the next module load (INT13 Ext) which results in an emission of <a href=\"https:\/\/www.ecsdump.net\/?page_id=884\" data-internallinksmanager029f6b8e52c=\"5\" title=\"DAP\" target=\"_blank\" rel=\"noopener\">DAP<\/a> information, \u2013 SYS2027 \u2013 message, and the system hangs. Getting this error is an indication of a failed INT13 load from the procedure readdrive which is also used in Phase 3.<\/li>\n<li>\u2018Invalid code for JFS\u2019 (followed by address code) which is emitted after the next module is loaded and a check for the signature 1961h at (calculated load segment):0200 fails. For normal operation I assume this error would be an indication that os2boot could not be loaded and possibly running sysinstx.com against the partition could correct it.<\/li>\n<\/ul>\n<p>The module loaded in Phase 2 contains code to continue the boot process and the micro-FSD. Using the Bochs drive image, 20h sectors are loaded at 8800:0000 and the entry point is 8800:199C.<\/p>\n<p>More detailed information can be found here:<\/p>\n<p><a href=\"https:\/\/www.ecsdump.net\/?page_id=259\">Bootable JFS Bootsector Code (BPB)<\/a><\/p>\n<p>Phase 3 \u2014 The Partition Boot Block Plus Extra (micro-FSD)<\/p>\n<p>After a bit of playing, I found that the load in Phase 2 does indeed reload the Partition Boot Block and an additional 31 sectors at 0x88000. Looking at the code and stepping through execution with Bochs, I have confirmed this to be correct.<\/p>\n<p>I am starting to see the structure of the Phase 3 load and it does not seem as documented. I believe this module loads os2boot and it only contains the mini-file system. It next loads os2ldr, sets up the required structures and then jumps into os2ldr.<\/p>\n<div>\n<h5><a href=\"https:\/\/www.ecsdump.net\/?page_id=262\">Bootable JFS micro-FSD<\/a><\/h5>\n<\/div>\n<p>I\u2019m going to post my notes to the blog, link at top of the page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, getting a MBR and os2boot on a hard drive image was a real pain. None of the current CDs would boot to a point where I could get the job done. I resorted to doing it the hard way. I mounted an old 630 meg IDE hard drive (just having this around should label&hellip;<\/p>\n<p><a class=\"more-link\" href=\"https:\/\/www.ecsdump.net\/?page_id=798\" title=\"Continue reading &lsquo;JFS Boot Block :: Bochs Adventure&rsquo;\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-templates\/full-width.php","meta":{"footnotes":""},"categories":[14,10],"tags":[20,81],"wf_page_folders":[104],"class_list":["post-798","page","type-page","status-publish","hentry","category-driver-os2","category-os2","tag-boot","tag-jfs"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/pages\/798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"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=798"}],"version-history":[{"count":0,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=\/wp\/v2\/pages\/798\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=798"},{"taxonomy":"wf_page_folders","embeddable":true,"href":"https:\/\/www.ecsdump.net\/index.php?rest_route=%2Fwp%2Fv2%2Fwf_page_folders&post=798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}