Author Topic: DosDevIOCtl disabling keyboard in VIO mode  (Read 11167 times)

Tom

  • Full Member
  • ***
  • Posts: 196
  • Karma: +5/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #15 on: March 07, 2024, 12:55:22 am »
Not that I understand much of your conversation, but I tried the executable on my ArcaOS 5.1.0 VM.
I have this message when I try to run it (Full screen and Windowed version).
Quote
[C:\HOME\MARTIN\Downloads\TEMP]pdptest
SYS0193: C:\HOME\MARTIN\DOWNLOADS\TEMP\PDPTEST.EXE cannot be run in a OS/2
session.

It looks to me that is not a OS/2 binary and it does not hang my system. 

That plus the MZ at the start of the header suggests that maybe pdptest.exe is a DOS program. What happens when you run it in a DOS window?


Dave Yeo

  • Hero Member
  • *****
  • Posts: 4811
  • Karma: +100/-1
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #16 on: March 07, 2024, 01:01:33 am »
In a DOS window,
Code: [Select]
H:\TMP>pdptest
SYS3011: The .EXE file that starts the program you specified contains
an error.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4811
  • Karma: +100/-1
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #17 on: March 07, 2024, 01:03:16 am »
Tried lxlite, a program originally for compressing lx files, extended quite a bit. It reports error reading executable.
yum install lxlite
lxlite /?

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #18 on: March 07, 2024, 03:24:04 am »
But I am skeptical at this moment if it will ever come off the ground.
Don't get me wrong. I'm skeptical too. These are all things beyond my control so I have no actual expectations. I can only tell you what I do that is within my control.

I basically have a similar opinion to this guy:

https://www.quora.com/Why-did-you-leave-software-engineering/answer/Jeff-Sturm-2

"The inmates are truly running the asylum, as the saying goes"

He chose to simply leave.

I'm not leaving. I'm some sort of "prepper".

I've been basically restricting myself to what is nominally universal (even on the mainframe) - C90 - for about 35 years.

But if I keep that approach religiously, I would have to use edlin as my editor.

I knew about ANSI X3.64, but I also knew the mainframe didn't support it (ie send EBCDIC ANSI escapes from MVS proper rather than running Unix basically as a subsystem).

It took decades to get that working to my satisfaction too, and even then only by creating a new version of PDOS (z/PDOS).

Ironically I only got Windows working to my satisfaction a couple of weeks ago or something. Something I thought couldn't be solved without cooperation from Microsoft was able to be solved in my C library. Ditto Linux. MSDOS I had working (albeit with repercussions) with a third party tool (ANSIPLUS) before I realized I could use a similar technique that I used on Windows.

OS/2 was only a couple of days ago, on top of the longer-standing issue of not being able to use VIO.

A fundamental problem was that when the user presses ESC, I expect two ESC (Wikipedia says that is a defined sequence) to get to the application rather than requiring the app to use a non-C90 timeout.

All these things were unknown to me when I started writing PDOS in 1994. And I had been asking the question longer than that. I was surprised that there wasn't a version (or at least, lookalike) of MSDOS I could use on the mainframe when I was a sysprog in 1987). Even now I haven't quite created that, but at least I now believe I have two designs (for CKD and FBA).

Quote
Having worked on OS/2 for 25 years and more then 10 years on eComStation project I have somewhat experience in this. The issue is that it seems the funding that would be needed never arrived. It seemed nobody was interested in this approach.  Could it be done, I guess so.
What interests people isn't always obvious. Who would have believed that people would be willing to pay money for an absurd/useless calculation to be made (Bitcoin)? Babbage's machine was built a couple of decades ago. And the US government paid IBM to write MVS to track ICBMs I think. The US government has broken up monopolies before (Bell). Rather than breaking up Microsoft (likely difficult and pointless) they could choose to fund IBM and OS/2. Or some other government or consortium could do that. Or create an unencumbered Windows-compatible OS from scratch.

Or perhaps a new culture of making all software C90-compliant and building it for every 32-bit OS in existence.

Anyway, I have a strong interest in doing what I can with what is under my control regardless of what happens with what I can't control.

But I'm open to suggestions on what I should do with what I now have. I can potentially provide limited funding. I recently spent about US$20k mainly on old software (e.g. Microsoft C 6.0) to fill in some gaps in my knowledge with regards to PDOS (e.g. can the PDOS source base be built with 6.0? 5.1 wasn't good enough (bought that too and found out). 7.0 (bought that too) doesn't run on an 8086 (only found out after I bought it)).

I have previously hired (and largely trained) some programmers, e.g. from Vietnam and where I now live (Philippines). But I have found it almost impossible to find anyone willing to take my money. I can't afford full western contract rates currently. That may potentially change though (an investment waiting to make returns).

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 339
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #19 on: March 07, 2024, 05:56:27 pm »
pdld has been updated to fix a couple of errors, but result is still the same (OS/2 says it can't run it).
I have suggested that the MZ header is too small for OS/2 to cope with, but he thought it was one of the other reasons.

How did you link this thing? Its layout doesn't look anything like an OS/2 LX executable.
Using 'exehdr' (from the OS/2 Toolkit) I find this:

Code: [Select]
no. virtual  virtual  map      map      flags
     address   size    index    size
0001 00400000 00005fcd 00000001 00000006 EXECUTABLE, READABLE, 32-bit
0002 00406000 000006d8 00000007 00000001 READABLE, WRITEABLE, 32-bit
0003 00407000 000067b0 00000008 00000007 READABLE, WRITEABLE, 32-bit

The virtual addresses (2nd column) for a small program like this should be:
0001 00010000
0002 00020000
0003 00030000

The "00400000" looks more like a 16-bit segmented address (i.e. 0040:0000).

Then too, we have:

Code: [Select]
Initial CS:EIP:                 object 1 offset 00000000
Initial SS:ESP:                 object 4 offset 00008000

Your stack is in a non-existent segment. Your entrypoint _could_ be at offset 0x00 but seldom is in most programs. I'm surprised that the program you wrote about originally ever ran if it had this kind of layout.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #20 on: March 07, 2024, 06:43:31 pm »
How did you link this thing? Its layout doesn't look anything like an OS/2 LX executable.
Using pdld.

Quote
The virtual addresses (2nd column) for a small program like this should be:
0001 00010000
0002 00020000
0003 00030000

The "00400000" looks more like a 16-bit segmented address (i.e. 0040:0000).
It's probably a "leftover" from Windows PE. No reason to change it. But I'll pass your comments on to see if he would like to change it to be more OS2-ish.

Quote
Initial CS:EIP:                 object 1 offset 00000000
Initial SS:ESP:                 object 4 offset 00008000

Your stack is in a non-existent segment. Your entrypoint _could_ be at offset 0x00 but seldom is in most programs.
Both of those are exactly what I specified.

Quote
I'm surprised that the program you wrote about originally ever ran if it had this kind of layout.
The original program (almost same source code) was built with Watcom tools. What you see above is a new suite of tools.

Anyway, his most recent modification caused ArcaOS to crash. I reported the issue to Arca Noae and I'll give them overnight to comment without disturbing anything.

But I have already been sent a fix (from Slovakia - noting that today I did my own debugging to a point where I asked him to explain a result) that should hopefully fix the issue I reported in this thread, and I'll commit (and then test) that in 8 hours or whatever depending on if Arca Noae gives me a reason to pause longer. I'm keen to get on with the development, but I'm also keen to bulletproof ArcaOS. I don't like bugs in anything.

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 339
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #21 on: March 07, 2024, 07:19:01 pm »
Quote
I'm surprised that the program you wrote about originally ever ran if it had this kind of layout.
The original program (almost same source code) was built with Watcom tools. What you see above is a new suite of tools.

If you expect these programs to run on OS/2 - even if only to prove that (some) OS/2 programs run on your OS - then fix your tools to create bona-fide OS/2 executables. It's not optional.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #22 on: March 07, 2024, 11:46:33 pm »
Quote
I'm surprised that the program you wrote about originally ever ran if it had this kind of layout.
The original program (almost same source code) was built with Watcom tools. What you see above is a new suite of tools.

If you expect these programs to run on OS/2 - even if only to prove that (some) OS/2 programs run on your OS - then fix your tools to create bona-fide OS/2 executables. It's not optional.

Using what definition of "bona-fide"? It wasn't my design choice, but having different addresses doesn't change the status of being "some OS/2 executables" as far as I can see. Anyway, I received this reply overnight:


LX in PDLD has the same base address and section alignment as PE/COFF which should be fine for 32-bit (I do not plan to support 16-bit) but if needed, it can be changed using "--image-base" (just like for PE/COFF).

If it turns out that OS/2 cannot handle the PE/COFF defaults, I can add separate LX defaults.


I personally don't see a problem with that attitude. I'm trying to get working executables to prove a concept, not win Miss America.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #23 on: March 08, 2024, 08:39:50 am »
But I have already been sent a fix (from Slovakia - noting that today I did my own debugging to a point where I asked him to explain a result) that should hopefully fix the issue I reported in this thread, and I'll commit (and then test) that in 8 hours or whatever depending on if Arca Noae gives me a reason to pause longer. I'm keen to get on with the development, but I'm also keen to bulletproof ArcaOS. I don't like bugs in anything.

After fixing unrelated (to pdld) bugs, the pdld fix worked, and PDOS/386 (available at http://pdos.org) is able to produce OS/2 executables (cd \devel\pdos\pdpclib then pdmake -f makefile.sos then pdptest abc def) that appear to work. However, the executable is still crashing ArcaOS, likely because of the default virtual addresses, and I currently can't try the suggested workaround because of a different bug in pdld which I have reported and is likely to be fixed in the coming hours (likely under 16 hours, likely much less).

After that is working I will construct an OS/2 makefile for microemacs 3.6 and try that.

And then I have no idea what I will do. A bit like people don't do anything in particular when they reach the top of Mt Everest (after all that effort). There are still gaps in 16-bit and 8-bit that I would like to fill in, but those are just example activities. There is nothing pressing.

Flashback

  • Newbie
  • *
  • Posts: 11
  • Karma: +3/-1
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #24 on: March 08, 2024, 10:27:28 am »
Quote
... is able to produce OS/2 executables (cd \devel\pdos\pdpclib then pdmake -f makefile.sos then pdptest abc def) that appear to work. However, the executable is still crashing ArcaOS ...
That somehow contradicts itself. If it was working, it would not crash AcraOS. BTW, The fact that any version of OS/2 can be crashed by invalid EXE headers is known for many years (Someone remembers this 'Smallest Hello World Program' contest?) and it is very unlikely that this is going change.

BTW, there are more 'fishy' things than Rich already pointed out. The DOS stub is complete bogus (Load image size, memory requirement, initial SS:SP, CS:IP). Better remove it completely instead of using invalid values.

In the LX header:
  • 'Auto DS object' is not set.
  • The 'Module flags' don't define an API type (PM, Windowcompat, NotWindowCompat)
  • Assuming that the entry table is empty, the 'Entry table offset' should point to the same address as 'Fixup page table offset'
  • The 'Resident names table offset' is invalid. Thus the kernel cannot determine the internal module name of the image
  • The 'Import module entry count' is set to two even though the 'Import module table' only contains one entry (DOSCALLS)
  • The 'Import procedure names table offset' points beyond the end of the file
Also strange:
  • OS/2 executables normally use a base address of 0x10000. That's the lowest possible virtual address.
  • 'Object 3' is usually the stack. It's pages are not present in the executable. Instead they are flagged as 'ZERO FILLED'.
  • Given 'Object 3' ist the stack, 'Starting ESP' should point a few bytes before the end (i.e. virtual size - some_space) of this object.

Code: [Select]
Turbo Dump  Version 4.1 Copyright (c) 1988, 1994 Borland International
                Display of File F:\XX\PDPTEST.EXE

Old Executable Header

DOS File Size                                       71ADh  ( 29101. )
Load Image Size                                   FFFFFFC0h  (4294967232. )
Relocation Table entry count                        0000h  (     0. )
Relocation Table address                            0040h  (    64. )
Size of header record      (in paragraphs)          0004h  (     4. )
Minimum Memory Requirement (in paragraphs)          0000h  (     0. )
Maximum Memory Requirement (in paragraphs)          0000h  (     0. )
File load checksum                                  0000h  (     0. )
Overlay Number                                      0000h  (     0. )

Initial Stack Segment  (SS:SP)   0000:0000
Program Entry Point    (CS:IP)   0000:0000


Linear Executable (LX) File

Header base: 00000040

Byte Order                                        Little endian
Word Order                                        Little endian
Format level                                      00000000
CPU type                                          80386
Operating system                                  OS/2
Module version                                    00000000
Module flags                                      00000010
         Instance init                 : No
         Internal fixups removed       : Yes
         External fixups removed       : No
         API                           : Unknown
         Errors in module              : No
         Module type                   : EXE
         Instance termination          : No
Page count                                        0000000Eh
Starting EIP object number                        00000001h
Starting EIP                                      00000000h
Starting ESP object number                        00000004h
Starting ESP                                      00008000h
Page size                                         00001000h
Page offset shift                                 00000000h
Fixup size                                        00000960h
Page checksum                                     00000000h
Loader section size                               00000000h
Loader section checksum                           00000000h
Object table offset                               00006795h
Object count                                      00000003h
Object page map table offset                      000067DDh
Object iterate data map offset                    00000040h
Resource table offset                             00000040h
Resource count                                    00000000h
Resident names table offset                       00000040h
Entry table offset                                00000040h
Module directives offset                          00000040h
Module directives count                           00000000h
Fixup page table offset                           0000684Dh
Fixup record table offset                         00006889h
Import module table offset                        000071A4h
Import module entry count                         00000002h
Import procedure names table offset               000071ADh
Per-page checksum table offset                    00000040h
Data pages offset                                 000000F0h
Preload page count                                00000000h
Non-resident names table offset                   00000000h
Non-resident names table length                   00000000h
Non-resident names table checksum                 00000000h
Auto DS object                                    00000000h
Debug info offset                                 00000040h
Debug info length                                 00000000h
Instance preload pages                            00000000h
Instance demand pages                             00000000h
Heap size                                         00000000h


Object Table                          3 Entries (00000003) File Base:06795h

Object 1
  Virtual size  : 00005FCDh  Relocation Base Address: 00400000h
  Page map index: 00000001h  Page map entries       : 00000006h
  Object flags  : 00002005h ( READABLE EXECUTABLE BIG )
    ====
    Page: 01  Offset: 000000F0  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 02  Offset: 000010F0  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 03  Offset: 000020F0  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 04  Offset: 000030F0  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 05  Offset: 000040F0  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 06  Offset: 000050F0  Size: 0FCD  Flags 0000 (PHYSICAL)

Object 2
  Virtual size  : 000006D8h  Relocation Base Address: 00406000h
  Page map index: 00000007h  Page map entries       : 00000001h
  Object flags  : 00002003h ( READABLE WRITEABLE BIG )
    ====
    Page: 07  Offset: 000060BD  Size: 06D8  Flags 0000 (PHYSICAL)

Object 3
  Virtual size  : 000067B0h  Relocation Base Address: 00407000h
  Page map index: 00000008h  Page map entries       : 00000007h
  Object flags  : 00002003h ( READABLE WRITEABLE BIG )
    ====
    Page: 08  Offset: 00006795  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 09  Offset: 00007795  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 0A  Offset: 00008795  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 0B  Offset: 00009795  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 0C  Offset: 0000A795  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 0D  Offset: 0000B795  Size: 1000  Flags 0000 (PHYSICAL)
    Page: 0E  Offset: 0000C795  Size: 07B0  Flags 0000 (PHYSICAL)


    No Resident names table present

    No Non-resident names table present


Entry Table                           1 Entries (00000001) File Base:040h

Unknown entry bundle type!!!


ERROR: Unable to create procedure names table

Fixup Table                           1 Entries (00000001) File Base:06889h

Object 1
01284  01:000A0       offset32
01295  01:000B3       offset32
0129C  01:000B5       offset32
012AF  01:00274       offset32
012B4  01:000B7       offset32
012C0  01:000CF       offset32
012DB  01:000E3       offset32
012FB  01:000ED       offset32
01316  01:00101       offset32
01338  01:0010B       offset32
01358  01:0011F       offset32
01365  01:00132       offset32
0138D  01:0013D       offset32
013CD  01:0014D       offset32
01404  01:0014D       offset32
01437  01:0014F       offset32
0143E  01:00154       offset32
01447  01:00160       offset32
01464  01:0014F       offset32
0146B  01:00154       offset32
01474  01:0017F       offset32
0148B  03:00000       offset32
014A3  03:00000       offset32
014CE  01:00194       offset32
014E8  01:0019E       offset32
0150E  01:001C0       offset32
01538  01:001E0       offset32
0157E  01:001FF       offset32
01587  01:00202       offset32
01591  01:00220       offset32
0159D  01:00254       offset32
015AC  02:00000       offset32
015B8  02:00004       offset32
015C4  02:00008       offset32
0164A  03:01DA4       offset32
01652  03:01DB4       offset32
01657  02:0000C       offset32
0165F  03:01D94       offset32
0166E  03:01C24       offset32
0167D  03:01D94       offset32
0168A  02:0000C       offset32
01694  03:01C24       offset32
0169D  03:01C24       offset32
016A6  02:0000C       offset32
016BB  03:01D84       offset32
016C0  03:01D94       offset32
016CA  02:0000C       offset32
016D7  03:01C24       offset32
016E4  03:01D94       offset32
016F2  03:01D94       offset32
01717  03:01C24       offset32
01730  03:01D94       offset32
01741  03:01DB4       offset32
01746  03:01C24       offset32
01759  03:01D94       offset32
01766  03:01C24       offset32
0177C  03:01D84       offset32
01783  03:01800       offset32
0179A  03:01C24       offset32
017A8  03:01C24       offset32
017B8  03:01D94       offset32
017DD  03:01C24       offset32
017EB  03:01C24       offset32
01819  03:01C24       offset32
0183B  02:0003C       offset32
01881  03:01DC4       offset32
018C8  03:01DC4       offset32
0191E  03:01DC4       offset32
0193E  03:01800       offset32
0195B  03:01D84       offset32
01963  03:01D94       offset32
019A9  01:0096D       offset32
019AF  03:01DB4       offset32
019C1  03:01DC4       offset32
019CB  03:01DC4       offset32
019E7  03:01C24       offset32
019F5  03:01C24       offset32
01A08  01:00971       offset32
01A0E  03:01DB4       offset32
01A22  01:00975       offset32
01A28  03:01DB4       offset32
01A3A  03:01DC4       offset32
01A48  01:00979       offset32
01A4E  03:01DB4       offset32
01A62  01:0097D       offset32
01A68  03:01DB4       offset32
01A7A  03:01DC4       offset32
01A8B  01:00981       offset32
01A91  03:01DB4       offset32
01AA5  01:00985       offset32
01AAB  03:01DB4       offset32
01ABD  03:01DC4       offset32
01ACE  01:00988       offset32
01AD4  03:01DB4       offset32
01AE6  03:01DC4       offset32
01AF7  01:0098B       offset32
01AFD  03:01DB4       offset32
01B0F  03:01DC4       offset32
01B20  01:0098E       offset32
01B26  03:01DB4       offset32
01B38  03:01DC4       offset32
01B49  01:00991       offset32
01B4F  03:01DB4       offset32
01B61  03:01DC4       offset32
01B72  01:00994       offset32
01B78  03:01DB4       offset32
01B8A  03:01DC4       offset32
01B9B  01:00997       offset32
01BA1  03:01DB4       offset32
01BB3  03:01DC4       offset32
01BC4  01:00999       offset32
01BCA  03:01DB4       offset32
01BDC  03:01DC4       offset32
01BED  01:0099B       offset32
01BF3  03:01DB4       offset32
01C05  03:01DC4       offset32
01C14  03:01D94       offset32
01C2F  03:01DC4       offset32
01CD2  03:01DA4       offset32
01CF5  03:01C24       offset32
01CFB  03:01DA4       offset32
01D00  DOSCALLS.273   self-relative32
01D1A  03:01D94       offset32
01DA1  DOSCALLS.257   self-relative32
01DE7  02:0000C       offset32
01E00  03:01800       offset32
01E16  01:00D6A       offset32
01E47  DOSCALLS.281   self-relative32
01E9E  02:00010       offset32
01EA9  03:01BF4       offset32
01EB4  02:00010       offset32
01EBC  03:01BF5       offset32
01EC1  03:01BF4       offset32
01EC6  02:00010       offset32
01ED0  02:00010       offset32
01F29  DOSCALLS.284   self-relative32
01F6C  02:00010       offset32
01F77  03:01BF4       offset32
01F8E  02:00010       offset32
01F99  03:01BF4       offset32
01FA3  02:00010       offset32
01FAE  03:01BF4       offset32
01FB8  02:00010       offset32
01FC3  03:01BF4       offset32
01FFA  02:00010       offset32
--
02004  03:01BF4       offset32
02400  DOSCALLS.282   self-relative32
0296E  01:01898       offset32
02B18  01:0189F       offset32
02CD8  01:01CDC       offset32
02CDC  01:0264A       offset32
02CE0  01:02698       offset32
02CE4  01:02698       offset32
02CE8  01:02656       offset32
02CEC  01:02698       offset32
02CF0  01:02698       offset32
02CF4  01:02698       offset32
02CF8  01:02698       offset32
02CFC  01:02698       offset32
02D00  01:02698       offset32
02D04  01:02662       offset32
02D08  01:0268A       offset32
02D0C  01:02698       offset32
02D10  01:01D20       offset32
02D14  01:02698       offset32
02D18  01:02698       offset32
02D1C  01:026A2       offset32
02D47  02:006C4       offset32
02DC5  01:01C5E       offset32
02EEB  02:006CC       offset32
--
0327E  01:01898       offset32
03770  DOSCALLS.259   self-relative32
037A7  DOSCALLS.271   self-relative32
03C11  DOSCALLS.256   self-relative32
03D9C  01:02D46       offset32
03DAB  01:02D5D       offset32
03DB9  01:02D74       offset32
03EC8  03:01C14       offset32
03EE2  DOSCALLS.284   self-relative32
03EED  DOSCALLS.257   self-relative32
03F18  02:0001C       offset32
03F1E  02:00020       offset32
03F25  02:00014       offset32
03F2C  02:00018       offset32
03F39  01:02DC7       offset32
03F3E  DOSCALLS.273   self-relative32
03F5D  03:01C14       offset32
03F7F  DOSCALLS.284   self-relative32
03FAC  DOSCALLS.284   self-relative32
03FF1  02:0000C       offset32
--
04008  03:01C24       offset32
04012  03:01D94       offset32
04033  02:0000C       offset32
0404A  03:01800       offset32
0405B  03:01D94       offset32
040BE  02:0002B       offset32
040C5  02:00024       offset32
040CF  02:00024       offset32
040E7  01:00979       offset32
040EC  01:00D6A       offset32
04234  02:006C4       offset32
0437F  02:006C4       offset32
043B1  02:006C4       offset32
0448A  01:03168       offset32
04542  01:03168       offset32
0456B  01:03168       offset32
04771  02:006C4       offset32
047BA  02:006C4       offset32
04863  02:006CC       offset32
04C09  02:006C4       offset32
04C29  02:006C4       offset32
04D11  02:006C4       offset32
04D5B  02:006C4       offset32
04FD6  01:03F78       offset32
--
0511A  01:03F6B       offset32
05151  01:03F78       offset32
0529C  01:03F6D       offset32
05401  01:03F78       offset32
05478  01:03F6B       offset32
05549  01:03F78       offset32
055C4  01:03F6F       offset32
05605  01:03F80       offset32
05612  01:03F78       offset32
05642  01:03F78       offset32
0566D  01:03F88       offset32
0567A  01:03F78       offset32
056C9  01:03F78       offset32
056E5  01:03F80       offset32
056F1  01:03F78       offset32
05791  01:03F78       offset32
05BBC  02:00034       offset32
05BC2  02:00034       offset32
05C00  02:00034       offset32
05C35  02:00034       offset32
05C4D  02:00034       offset32
05CAF  01:04C75       offset32
05CB9  01:04C8C       offset32
05D5D  DOSCALLS.299   self-relative32
05E3E  DOSCALLS.304   self-relative32
--
Object 2
00003  02:00038       offset32
0000D  02:00038       offset32
0002D  02:00038       offset32
00077  02:006C4       offset32
000C0  01:05060       offset32
0013C  01:05060       offset32
00158  01:05060       offset32
0019E  01:05058       offset32
001AE  01:05060       offset32
00202  01:05058       offset32
00254  02:006C4       offset32
002B4  02:006CC       offset32
00343  02:006C4       offset32
004EA  03:01DE0       offset32
0050A  03:01DE0       offset32
00522  DOSCALLS.227   self-relative32
0055F  DOSCALLS.283   self-relative32
005DA  02:00050       offset32
005E2  03:01F38       offset32
005F5  02:0003C       offset32
0061C  02:0003C       offset32
00630  03:01800       offset32
00657  DOSCALLS.382   self-relative32
0066F  02:0003C       offset32
00685  03:01E68       offset32
006C0  03:01E6C       offset32
006D0  02:00054       offset32
006DC  03:01F38       offset32
006F1  02:00050       offset32
006F6  02:00050       offset32
006FE  03:01F38       offset32
0070C  02:0003C       offset32
00717  02:0003C       offset32
00737  03:01E68       offset32
0074C  03:01F38       offset32
00760  03:01E68       offset32
00769  02:00058       offset32
00795  03:01E68       offset32
007C7  03:01E68       offset32
007FF  01:055CC       offset32
00812  DOSCALLS.312   self-relative32
0081E  01:055CD       offset32
00831  03:01E68       offset32
0085B  DOSCALLS.382   self-relative32
008D3  03:01F78       offset32
00A15  03:03788       offset32
00B4C  03:04F98       offset32
00C57  02:0003C       offset32
00C69  02:0003C       offset32
00C77  03:01F38       offset32
00C7D  02:00050       offset32
00CB7  03:01800       offset32
00CC0  02:0003C       offset32
00D3E  02:00044       offset32
00D4C  02:00040       offset32
00D56  02:00044       offset32
00D5F  02:00040       offset32
00D73  02:00044       offset32
00D79  01:05D26       offset32
00D91  01:05D2A       offset32
00DB3  01:05D30       offset32
00DC8  02:0005C       offset32
00DDC  02:00060       offset32
00DF1  02:00060       offset32
00E08  02:00060       offset32
00E0C  01:05DFC       offset32
00E35  02:006C4       offset32
00E4D  02:006C4       offset32
00E65  02:006C4       offset32
00E7D  02:006C4       offset32
00E95  02:006C4       offset32
00EAD  02:006C4       offset32
00EC5  02:006C4       offset32
00EDD  02:006C4       offset32
00EF9  02:006C4       offset32
00F15  02:006C4       offset32
00F31  02:006C4       offset32
00F4C  02:006C8       offset32
00F60  02:006CC       offset32
00FC9  DOSCALLS.234   self-relative32
01000  03:01C34       offset32
00004  03:01CA0       offset32
00008  03:01D0C       offset32
00058  01:00274       offset32
00060  01:05DFC       offset32
00064  01:05DFC       offset32
00068  01:05DFC       offset32
0006C  01:05DFC       offset32
00070  01:05DFC       offset32
00074  01:05DFC       offset32
00078  01:05DFC       offset32
006C4  02:00082       offset32
006C8  02:002A2       offset32
006CC  02:004C2       offset32
--
Object 3
--
ERROR: Attempt to free import module namew when not allocated




What also appears strange is the large number of 'offset32' fixups. Maybe I'm wrong, but IMHO these could/should be resolved by the linker so that they won't end up in the executable image at all.
« Last Edit: March 08, 2024, 11:47:26 am by Flashback »

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #25 on: March 08, 2024, 11:55:05 am »
Quote
... is able to produce OS/2 executables (cd \devel\pdos\pdpclib then pdmake -f makefile.sos then pdptest abc def) that appear to work. However, the executable is still crashing ArcaOS ...
That somehow contradicts itself. If it was working, it would not crash AcraOS.
It's working as in -  you can run it under PDOS/386. PDOS/386 is able to run (certain) OS/2 executables created by the Watcom toolchain (and those executables run under ArcaOS too). And PDOS/386 is *also* able to run LX executables created by pdld. It is only *those* that are currently crashing ArcaOS.

Quote
BTW, The fact that any version of OS/2 can be crashed by invalid EXE headers is known for many years (Someone remembers this 'Smallest Hello World Program' contest?) and it is very unlikely that this is going change.
Thanks for that info.

Quote
BTW, there are more 'fishy' things than Rich already pointed out. The DOS stub is complete bogus (Load image size, memory requirement, initial SS:SP, CS:IP). Better remove it completely instead of using invalid values.
I'll take a look at that, thanks, but note that there is no real stub in the above makefile.sos.

And thanks for the detailed analysis of the flaws in the LX portion. I'll pass that on and see what happens!

Quote
What also appears strange is the large number of 'offset32' fixups. Maybe I'm wrong, but IMHO these could/should be resolved by the linker so that they won't end up in the executable image at all.
Note that PDOS/386 requires fixups, even though OS/2 doesn't. And fixups are allowed in the executable format, so that alone doesn't make it invalid - just unusual.

Lars

  • Hero Member
  • *****
  • Posts: 1277
  • Karma: +65/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #26 on: March 08, 2024, 01:49:06 pm »
As to fixups: I would think that if you specify the /BASE: keyword to the IBM OS/2 linker that then, fixups can be avoided.
I would also think that the IBM OS/2 linker has the default behaviour that when it creates an EXE, it will always assume a base of 0x10000 for the first memory object (and a fixed scheme of additional bases for the following memory objects) and will then be able to avoid fixups.

If you create a DLL, you would typically not define a base when linking because that is not desirable in general and in that case, you cannot avoid the fixups (but that is what fixups are for: to allow code/data to be relocated in memory).

When I say "IBM OS/2 linker" I assume that the Watcom linker and also the Borland linker would behave the same.
« Last Edit: March 08, 2024, 01:51:07 pm by Lars »

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #27 on: March 08, 2024, 03:49:37 pm »
As to fixups: I would think that if you specify the /BASE: keyword to the IBM OS/2 linker that then, fixups can be avoided.
PDOS/386 cannot load an executable at an arbitrary user-specified virtual address. It doesn't use virtual memory. It is inspired by MSDOS. Fixups are mandatory. As they are for MSDOS in large code memory model. Quibbling aside.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #28 on: March 08, 2024, 09:42:52 pm »
BTW, there are more 'fishy' things than Rich already pointed out. The DOS stub is complete bogus (Load image size, memory requirement, initial SS:SP, CS:IP). Better remove it completely instead of using invalid values.

In the LX header:

I have received a new version of pdld and produced a new pdptest.exe that should have addressed all issues except:

"The Auto DS object is only for 16-bit compatibility and is not used by 32-bit modules according to the LX specification, so I do not think it has to be set."


And ArcaOS no longer crashes.

However, even with the addresses set normally:

D:\devel\pdos\pdpclib>cvs diff
cvs diff: Diffing .
Index: makefile.sos
===================================================================
RCS file: \cvsroot/pdos/pdpclib/makefile.sos,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 makefile.sos
10,11c10,11
< #  wasm -zcm -q -DOS220 ..\src\needpdos.asm
< #  wlink File needpdos.obj Name needpdos.exe Form dos Option quiet,dosseg
---
>   wasm -zcm -q -DOS220 ..\src\needpdos.asm
>   wlink File needpdos.obj Name needpdos.exe Form dos Option quiet,dosseg
23c23
<   pdld -s --oformat lx -o pdptest.exe os2strt.obj pdptest.obj pdpos2.lib os2.lib
---
>   pdld --stub=needpdos.exe --image-base 0x10000 --section-alignment 0x10000 -Map map.txt -s --o
format lx -o pdptest.exe os2strt.obj pdptest.obj pdpos2.lib os2.lib

D:\devel\pdos\pdpclib>

0001 00010000 00005fad 00000001 00000006 EXECUTABLE, READABLE, 32-bit
0002 00020000 000006d8 00000007 00000001 READABLE, WRITEABLE, 32-bit
0003 00030000 000067b0 00000007 00000000 READABLE, WRITEABLE, 32-bit
0004 00040000 00008000 00000008 00000000 READABLE, WRITEABLE, 32-bit


I get:

[Z:\]pdptest
SYS0188: The operating system cannot run Z:\PDPTEST.EXE.

[Z:\]


Are you (or anyone else) able to see what still remains?

I'll produce and upload a new pdos.zip in the coming hours with the latest pdld.exe, but I don't think it is useful to anyone until it actually works (on ArcaOS - it still works on PDOS/386).

Thanks. Paul.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4756
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #29 on: March 08, 2024, 09:59:03 pm »
Hello

In DOS Window Session (ArcaOS 5.1.0) gives me:
Quote
C:\DESKTOP>pdptest
This program needs OS/2 2.0 or equivalent

Under OS/2 command line:
Quote
[C:\DESKTOP]pdptest
SYS0188: The operating system cannot run C:\DESKTOP\PDPTEST.EXE.

No OS hangs here.
Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.