Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic loader, instructions do not get actually loaded. #79

Open
Orfheo opened this issue May 2, 2018 · 0 comments
Open

Dynamic loader, instructions do not get actually loaded. #79

Orfheo opened this issue May 2, 2018 · 0 comments

Comments

@Orfheo
Copy link
Contributor

Orfheo commented May 2, 2018

I'm currently testing J. Winter dyn75 (75/TCPIP instruction for MVS3.8j) under hercules-3.13.

On both the github master and the reference hercules-3.13.tar.gz distribution, new dynamically loadable instructions get compiled and linked correctly and loaded into the optable, as "lsmod" show, with the "ldmod" command.

Unfortunately, although correctly loaded, they never get actually executed, as a simple test with the reference TESTINS.C/BARF instruction show.

I did some debugging and I found that the function "set_opcode_pointers()", in cpu.c, is called ONLY at emulator initialization time, from cpu.c:1989 and never called again.

So the set_opcode_pointers() in opcode.c is not called to initialize the "regs->s370_opcode_table" runtime real table AFTER the "ldmod" command load a new instruction and the instruction is NEVER actually seen at execution time.

A simple change in ipl.c:

`@@ -408,6 +408,9 @@ int i; /* Array subscript */
ARCH_DEP(store_int_timer_nolock) (regs);
#endif

  • /* Initialize opcode table pointers */
  • set_opcode_pointers (regs);
  • if(regs->host && regs->guestregs)
    {
    ARCH_DEP(cpu_reset)(regs->guestregs);`

allow to reload the reg->opcode_table just BEFORE an IPL (which seems the right, safe time to perform this action) and with this simple patch dynamically loadable instructions get executed correctly.

I now have the J. Winter dyn75/tcpip instructions correcly loaded (with "ldmod dyn75") and executed from MVS3.8J (personal SYSGEN), as a test with the TK4- J.Winter FTPD show.

Also the TESTINS.C begin to work correctly after applying this patch to ipl.c.

Regards, Orfheo (AKA Peppe/G. Vitillaro on hercules main group).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant