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

Feature request: Make ComLoader and ExeLoader use a future DOS INT21H EXEC function. #344

Open
maximilien-noal opened this issue Jun 22, 2023 · 3 comments
Labels
compatibility Emulator compatibility with DOS apps DOS Related to DOS low priority Fixing this is not urgent, or would take too much manpower for too little gain

Comments

@maximilien-noal
Copy link
Member

Since both will create a PSP, etc...

@maximilien-noal maximilien-noal added compatibility Emulator compatibility with DOS apps DOS Related to DOS low priority Fixing this is not urgent, or would take too much manpower for too little gain labels Jun 22, 2023
@maximilien-noal
Copy link
Member Author

https://github.com/segin/readexe for an example of code that knows how to differentiate between EXE/COM and other variants.

@matthewturk
Copy link

Is this the same as implementing INT 21h 0x4B? I'm trying to reverse a program that is initialized by a COM file (which loads up some interrupt handlers etc), then it swaps between two different EXE-format files via 0x4B. Is this something that might be feasible for a new contributor to take a look at, or maybe too hard?

@maximilien-noal
Copy link
Member Author

maximilien-noal commented Sep 21, 2024

This is indeed related to function 0x41b. This is also related to DOS process management.

In essence, the comloader and exeloader would be replaced by this process:

  • mount the virtual drive. We already do that.
  • launch the DOS kernel
  • call 0x41b to load and exec the file, giving it the path and program arguments
  • this call determines if it's a com or exe file, creates the new PSP inside the SDA, takes care of existing PSPs, and eventually runs the program.

The 'load but don't exec' mode of this function can be skipped if your program doesn't use this mode. This mode is related to TSR support.

This depends on three DOS data structures:

  • The SDA. We don't have that at the moment.
  • The PSP. We set it up manually in either the comloader or exeloader. Both should be instead a new class based on MemoryBasedDataStructure instead.

The SDA should host the PSP chain.

I think it is doable, now that every dependency between services and classes are resolved at compile time in Spice86DependencyInjection.cs

The book 'undocumented DOS' is a great resource about this.

We have a discord if you need guidance. I will be glad to help.
https://discord.gg/h99HFjZX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Emulator compatibility with DOS apps DOS Related to DOS low priority Fixing this is not urgent, or would take too much manpower for too little gain
Projects
None yet
Development

No branches or pull requests

2 participants