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

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #30 on: March 08, 2024, 10:05:44 pm »
No OS hangs here.
Sure. I uploaded the executable than hung ArcaOS to the ArcaOS site, not here. I can upload it here if someone is interested, but I've moved on, and apparently it is nothing new.

I've moved on and now need to know why (non-crashing) OS/2 doesn't like the latest executable.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4811
  • Karma: +101/-1
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #31 on: March 08, 2024, 10:50:19 pm »
Try help 188,
Code: [Select]
[H:\tmp]pdptest
SYS0188: The operating system cannot run H:\TMP\PDPTEST.EXE.

[H:\tmp]help 188

SYS0188: The operating system cannot run ***.

EXPLANATION: The application program does not have a correct
END <label> directive.

ACTION: Contact the supplier of the application.

Not sure what an END directive is.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #32 on: March 08, 2024, 11:19:12 pm »
Try help 188,
Thanks! Never occurred to me that there would be help for this error message.

Quote
EXPLANATION: The application program does not have a correct
END <label> directive.

Not sure what an END directive is.

I believe I know what that is. It is an assembler directive to specify the entry point.

I have just updated my assembler code to make that better:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/os2strt.asm

And the end statement:

end __top

is there, and on pdld I added -e ___top to ensure that was the entry point.

I don't think that OS/2 can know things at this level. I suspect the error message should really be "entry point invalid".

Which is this:

Initial CS:EIP:                 object 7 offset 00000000

And I didn't see an object 7, so let me see if I can confirm that this is the problem.

Thanks. Paul.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #33 on: March 08, 2024, 11:43:50 pm »
Initial CS:EIP:                 object 7 offset 00000000

And I didn't see an object 7, so let me see if I can confirm that this is the problem.

I modified pdld to always put object 1 (as a kludge), and now my program seems to actually be run! It crashes though:

[Z:\]pdptest
SYS1808:
The process has stopped.  The software diagnostic
code (exception code) is  0005.

[Z:\]

Not sure how to debug that at the assembler level.

But the problem is unlikely to be in the code anyway. One of those relocations may be wrong instead, and that is zapping the code.

I changed my application to just loop:


public __top
__top:


; We don't use the registers or stack at entry

public __intstart
__intstart proc
        nop
        nop
        nop
        nop
ploop:  jmp ploop
        mov eax, 0
        ret
        push eax


And you can see those NOPs in the executable:

D:\devel\pdos\pdpclib>hexdump pdptest.exe 0 400
000000  4D5A6000 01000000 04004000 FFFF0400  MZ`.......@.....
000010  00040000 00000000 40000000 00000000  ........@.......
000020  00000000 00000000 00000000 00000000  ................
000030  00000000 00000000 00000000 80000000  ................
000040  0E1FB409 BA1400CD 21B001B4 4CCD21EB  ........!...L.!.
000050  FE000000 54686973 2070726F 6772616D  ....This program
000060  206E6565 6473204F 532F3220 322E3020   needs OS/2 2.0
000070  6F722065 71756976 616C656E 740D0A24  or equivalent..$
000080  4C580000 00000000 02000100 00000000  LX..............
000090  00020000 07000000 01000000 00000000  ................
0000A0  04000000 F07F0000 00100000 00000000  ................
0000B0  44090000 00000000 A8000000 00000000  D...............
0000C0  35670000 04000000 95670000 00000000  5g.......g......
0000D0  00000000 00000000 CD670000 DB670000  .........g...g..
0000E0  00000000 00000000 DD670000 FD670000  .........g...g..
0000F0  18710000 01000000 21710000 00000000  .q......!q......
000100  30010000 00000000 00000000 00000000  0...............
000110  00000000 00000000 00000000 00000000  ................
000120  00000000 00000000 00000000 00000000  ................
000130  90909090 EBFEB800 000000C3 50E89E55  ............P..U


But it doesn't loop, so it is unlikely to be reaching this (intact) code.

I'm attaching the latest executable.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #34 on: March 09, 2024, 12:10:06 am »
I am getting some diagnostics in populog.os2 (thanks to Dave on the Usenet group for the pointer some days ago).

I suspected that the EIP wasn't being set correctly, so I tried setting it to negative 0x10000 in pdld:

D:\devel\pdos\pdld\src>cvs diff
cvs diff: Diffing .
Index: lx.c
===================================================================
RCS file: \cvsroot/pdos/pdld/src/lx.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 lx.c
392,393c392,393
<                 lx_hdr.EipObjectIndex = object_page_table_entries + 1;
<                 lx_hdr.Eip = ld_state->entry_point - section->rva;
---
>                 lx_hdr.EipObjectIndex = 1;
>                 lx_hdr.Eip = -0x10000; /* ld_state->entry_point - section->rva; */
cvs diff: Diffing bytearray
cvs diff: Diffing hashtab

D:\devel\pdos\pdld\src>


in order to get it to resolve to 0 instead of 0x10000 or 0x20000

but it's still not hitting my loop ...

03-09-2024  07:04:00  SYS3175  PID 005d  TID 0001  Slot 009b
Z:\PDPTEST.EXE
c0000005
00000000
P1=00000001  P2=00000000  P3=XXXXXXXX  P4=XXXXXXXX 
EAX=00000000  EBX=00000000  ECX=00000000  EDX=00000000
ESI=00000000  EDI=00000000 
DS=0053  DSACC=d0f3  DSLIM=5fffffff 
ES=0053  ESACC=d0f3  ESLIM=5fffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:00000000  CSACC=d0df  CSLIM=5fffffff
SS:ESP=0053:00047fdc  SSACC=d0f3  SSLIM=5fffffff
EBP=00000000  FLG=00010202


kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #35 on: March 09, 2024, 11:03:43 am »
I received this fix:

https://sourceforge.net/p/pdos/gitcode/ci/2f1b13eae9c4da1bbb556a4bf64c644ccf01f3b6/

and it now works!

Turns out the virtual addresses weren't important, and nor was the deficient MZ stub.

But I'll provide a proper stub anyway.

Thanks everyone for your assistance!

I'll do a new build soon.

And prove microemacs too.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #36 on: March 09, 2024, 02:49:27 pm »
microemacs is working under OS/2 - see attached.

However, the executable isn't running properly under PDOS/386, but that's a problem with exeload.c in PDOS/386 not initializing BSS properly.

That will be dealt with in the coming hours hopefully.

There is a new pdos.zip at pdos.org which has a makefile.sos that produces executables that work on both OS/2 and PDOS/386 - but it is random whether you hit a BSS issue.


EDIT: the editor uemacs.exe needs to be run in a fullscreen window, even though it is marked as pmcompatible (we don't yet have a link option to change that).
« Last Edit: March 09, 2024, 02:51:01 pm by kerravon »

Flashback

  • Newbie
  • *
  • Posts: 11
  • Karma: +3/-1
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #37 on: March 09, 2024, 03:31:29 pm »
The resident name table entry (i.e. module name) is still incorrect. Please refer to:

http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description#Resident_or_Non-resident_Name_Table_Entry

Also, the file extension (i.e. '.exe') should be removed.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4811
  • Karma: +101/-1
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #38 on: March 09, 2024, 04:07:35 pm »
For now perhaps best to use exehdr to mark it to force full screen mode, especially if it still breaks the keyboard if run in a window.
Code: [Select]
exehdr /PMTYPE:NOTWINDOWCOMPAT uemacs.exeSeems to run fine here, though I don't know emacs enough to really test. Good work.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #39 on: March 09, 2024, 04:38:51 pm »
Hi
EDIT: the editor uemacs.exe needs to be run in a fullscreen window, even though it is marked as pmcompatible (we don't yet have a link option to change that).

Here (ArcaOS 5.1.0) it also runs in OS/2 cmd windowed mode. No problems with the keyboard there.

But when I run it in full screen, I made an Alt+Enter to kill the session, since I don't know how to exist uemacs, and after I killed the session I lost they keyboard input in the OS.

Regards
« Last Edit: March 09, 2024, 04:44:57 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #40 on: March 09, 2024, 05:39:40 pm »
Here (ArcaOS 5.1.0) it also runs in OS/2 cmd windowed mode. No problems with the keyboard there.

That's the irony of it all. It works fine. But watch what happens when you exit. Try doing "dir".

To exit, do ctrl-x, ctrl-c

If you are in the middle of a command and you've stuffed something up, ctrl-g to cancel

ctrl-x, ctrl-s saves

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #41 on: March 09, 2024, 05:41:52 pm »
For now perhaps best to use exehdr to mark it to force full screen mode, especially if it still breaks the keyboard if run in a window.
Code: [Select]
exehdr /PMTYPE:NOTWINDOWCOMPAT uemacs.exe
Thanks for the command. Note that I'm building on Windows 2000, so I don't have exehdr available to do that automatically, and pdld is likely to be changed before I start distributing LX executables for real.

Quote
Seems to run fine here, though I don't know emacs enough to really test. Good work.
Thanks!

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #42 on: March 09, 2024, 11:01:42 pm »
The resident name table entry (i.e. module name) is still incorrect. Please refer to:

http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description#Resident_or_Non-resident_Name_Table_Entry

Also, the file extension (i.e. '.exe') should be removed.

The attached executable should fix that problem. Please let me know if you see anything else that is technically invalid.

Note that I still can't run this executable under PDOS/386, and I'm still debugging why. First problem was BSS wasn't initialized. But then there was a second problem. I suspect the fixups are slightly incorrect, so it will be a hairy problem to solve (adding printfs to uemacs changes the behavior).

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #43 on: March 09, 2024, 11:26:40 pm »
The attached executable should fix that problem. Please let me know if you see anything else that is technically invalid.
Hello

After exiting uemacs.exe (run in windowed mode) it keeps breaking the keyboard on the rest of the OS.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

kerravon

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: DosDevIOCtl disabling keyboard in VIO mode
« Reply #44 on: March 09, 2024, 11:42:25 pm »
The attached executable should fix that problem. Please let me know if you see anything else that is technically invalid.
Hello

After exiting uemacs.exe (run in windowed mode) it keeps breaking the keyboard on the rest of the OS.

Regards

Oh, sure - I already know that one - that's what the thread was originally about, and hasn't really been resolved other than to always run in fullscreen mode.

So my question can be refined as - this is a fullscreen application. Is there anything technically invalid (headers, fixups, whatever) about this fullscreen application other than the fact that it is currently marked as windowcompat and exehdr needs to be run to mark it as fullscreen?