Author Topic: Binary decompilation of OS2KRNL and other DLLs  (Read 28214 times)

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #30 on: November 01, 2018, 12:02:56 am »
PPPPS: And BTW, FAT is supported by fat32.ifs, including VFAT long file names. So, 8.3 limits are no more applicable. So, OS/2 sees the long file names on FAT without problems.

And, there are HPFS drivers for Linux and Windows. The HPFS driver was removed from WinXP/win2k3, but it can be added there back. Look here: http://hobbes.nmsu.edu/download/pub/os2/util/disk/hpfs_w2k.zip, it is a HPFS driver from win2k, which can be installed in WinXP. There are limitations of 4 GB for max HPFS volume size. (You should look into the readme for instructions)

For debugging bootsectors and loaders, I'd also suggest you to not reinvent wheels, but use existing debuggers of existing virtual machines. There are built-in debuggers in Bochs and VirtualBox. For writing my own boot sectors, I used the first of the two.
« Last Edit: November 01, 2018, 12:17:08 am by Valery Sedletski »

RickCHodgin

  • Guest
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #31 on: November 01, 2018, 01:14:17 pm »
I couldn't get HPFS to be recognized in Windows.  What driver do I need to install?

I tried the latest one I could find, which was an NT 4 driver.  I tried it in Windows Server 2003, and it would only recognize the drive as existing, but saw no partitions on it, no file system.  It reported 0 bytes on disk, 0 bytes available.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #32 on: November 01, 2018, 03:33:36 pm »
The NT4 driver (pinball.sys) is the latest. I only ever used it in W2K. I know it has a 4.3 GB limit or so for partitions, don't know if it has limitations for disk size.

RickCHodgin

  • Guest
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #33 on: November 01, 2018, 04:14:28 pm »
The NT4 driver (pinball.sys) is the latest. I only ever used it in W2K. I know it has a 4.3 GB limit or so for partitions, don't know if it has limitations for disk size.

For the work I've been doing, I've been limiting my partitions to 2GB.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #34 on: November 01, 2018, 05:37:57 pm »
2Rick C. Hodgin: You're probably trying to install the archive called hpfs_nt4.zip, but you need an updated package, http://hobbes.nmsu.edu/download/pub/os2/util/disk/hpfs_w2k.zip. MS removed a required API from NT kernel after win2k, so some workaround is required on newer kernels, so they require an updated package. (Though, I did not tried to install it myself, so I forgot exact details (they should be in the readme). I only heard of such problems from this package creator. It is _dixie_, who is also QSINIT author. All credits to him.).

RickCHodgin

  • Guest
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #35 on: November 01, 2018, 05:48:36 pm »
2Rick C. Hodgin: You're probably trying to install the archive called hpfs_nt4.zip, but you need an updated package, http://hobbes.nmsu.edu/download/pub/os2/util/disk/hpfs_w2k.zip. MS removed a required API from NT kernel after win2k, so some workaround is required on newer kernels, so they require an updated package. (Though, I did not tried to install it myself, so I forgot exact details (they should be in the readme). I only heard of such problems from this package creator. It is _dixie_, who is also QSINIT author. All credits to him.).

In my family we have an expression we say to one another when we're helpful.  It's a play on the German word "danke" for thank you, but we say "donkey." :-)

Donkey, Valery.  Will check it out tonight.  Donkey. :-)

RickCHodgin

  • Guest
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #36 on: November 01, 2018, 09:07:56 pm »
For debugging bootsectors and loaders, I'd also suggest you to not reinvent wheels, but use existing debuggers of existing virtual machines. There are built-in debuggers in Bochs and VirtualBox. For writing my own boot sectors, I used the first of the two.

I've tried using Bochs' built-in debugger before, but I've never been able to get it to work properly.  So what I've done is create my own debugger interface in Bochs using the 0xb0000 memory block for monochrome graphics.  It uses a named pipe to transfer data to/from Bochs and my eternal "MoMo" (MOnochrome MOnitor) app.

See this video:  http://www.visual-freepro.org/videos/2014_02_13__exodus_debi_debugger.ogv

And here's the source code:  http://www.libsf.org:8990/projects/LIB/repos/libsf/browse/exodus/bochs/source/2.3.5/MoMo
(Clone the repo, open that .sln file, and you'll see it all there)

And here:  http://www.libsf.org:8990/projects/LIB/repos/libsf/browse/exodus/bochs/source/2.3.5/bochs-2.3.5/momo

It is a true protected-mode graphical debugger running in the code in the VM.  I have a similar debugger that works in text mode for the boot sector, and displays similarly, but much more simply.

If you're on IRC and can help me with Bochs' debugger I'd appreciate it.
« Last Edit: November 01, 2018, 09:13:11 pm by Rick C. Hodgin »

RickCHodgin

  • Guest
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #37 on: November 01, 2018, 11:30:43 pm »
http://hobbes.nmsu.edu/download/pub/os2/util/disk/hpfs_w2k.zip

It worked.  I had to get PINBALL.SYS from \windows\system32\drivers\ and copy it to my unzip folder, then run BUPDATE PINBALL.BKG and it gave me a new PINBALL.SYS, which I copied with RS.DLL back to the \windows\system32\drivers\ folder.  Then, after reboot my OS/2 partitions were visible.

Thank you again, Valery.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Binary decompilation of OS2KRNL and other DLLs
« Reply #38 on: November 03, 2018, 02:20:25 am »
Good, need to try pinball.sys on WinXP myself too :)

The bochs version I'm using is compiled by Froloff some years ago. But since then, he no
more uses OS/2 and his site is down. Though, I uploaded it to my ftp:

Quote
ftp://osfree.org/upload/froloff/bochs-froloff.zip

You just configure .bochsrc, add the disk images and configure the
boot device order, from which device to load first (boot: disk to boot
from a harddisk). Then you start bochs.cmd in a cmd/4os2 window
and it drops into the debugger.

Bochs is fine for debugging boot sectors or loaders, but it is too slow
to run a complex OS like OS/2 is. Not sure if it will start at all completely.
« Last Edit: November 03, 2018, 02:22:44 am by Valery Sedletski »