I started this a few years ago to keep track of things I did using OS/2. Everything kind of fell to the wayside and I got bored. I think most blogs are like people yelling in the middle of nowhere with no one to listen and this one is no different. I have become un-bored for awhile and decided to play with Bogger again to keep track of nothing important.
Using Bochs I have the entry values into os2ldr when booted with BootJFS. One important note is that any of the filetable structure len fields will depend on the module version. Also, the 0x8800 segment might vary with machine types in the real world. It is calculated:
uses INT 12 to find the top of low memory in continuous 1k blocks
AND with 0xFFF0
Shift left 6
DX == 0x1480 (00010100 10000000)
DH boot mode flags == mini-FSD is present, micro-FSD is present
DL drive number for the boot disk == 0x80
DS:SI is a pointer to the BOOT Media's BPB 8800:000B (0x8800B)
ES:DI pointer to a filetable structure 8800:124A (0x8924A), filetable structure has the following format:
I’m going to plagiarize from www.osfree.org and modify the text to fit my adventures with BootJFS.
At the end of POST procedure the ROM BIOS initializes devices and gives control to int 19h interrupt routine, which loads 1st sector of the 1st boot device (a floopy, HDD or another). If the device was the HDD, then the Master boot record (MBR) is loaded from the 1st sector. The ROM BIOS loads it at address 07C0:0000. The MBR has a Non-System Bootstrap (NSB) routine in it, and the Partition Table (PT). The NSB code relocates MBR to 07E0:0000, jumps to 07E0:0020 and checks for a Boot Manager partition, and checks for a bootable partition on the first or second disk if present. Next the bootsector of boot HDD partition is loaded at 07C0:0000.
One of the interesting things that happens is the following:
1. Find the top continuous low memory (conventional 640k), number of 1K blocks. On my Bochs drive 639 is returned.
2. Calculate a load segment. The result of #1 – 54h, AND result with FFF0h, and then shifted left 6 bits. This will be the load segment and with the Bochs drive equates to 8800.
3. The bootsector of boot HDD plus an additional 31 sectors are loaded at the address (segment) calculated in #2, approximately 16K.
4. A jump to the segment from #2 offset 199Ch is made.
Now things have and continue to divert from IBM documentation. The code loaded in #3 contains MicroFSD. It loads os2boot and os2ldr using MicroFSD functions, which look like C code. Finally, the structure and registers are setup for entry into os2ldr.
One of my issues is that the structure I am finding does not seem to match documentation: