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

Advice required: CP/M-86 Emulator #52

Open
tsupplis opened this issue Apr 21, 2022 · 10 comments
Open

Advice required: CP/M-86 Emulator #52

tsupplis opened this issue Apr 21, 2022 · 10 comments

Comments

@tsupplis
Copy link
Collaborator

Hi,

Now that your emulation is supporting most of the calls inherited from CP/M it is actually quite easy to create a CP/M-86 emulator by implementing

  • E0h instead of 21 and transposing register management
  • Adjust PSP and FCB
  • Load CMD formats

How would you approach that? I think it is too messy to overlap both, and a fork could do the job better, what do you think? Worse trying a single one? The appeal of it is far more limited than dos ...

@johnsonjh
Copy link
Collaborator

I think it would be excellent and quite useful, but I'm a CP/M fan, so I have a somewhat skewed view.

@dmsc
Copy link
Owner

dmsc commented Apr 21, 2022

What I would need is a set of (real) CP/M-86 programs to try this on. It should not be that difficult to do a few adaptations.

@johnsonjh
Copy link
Collaborator

johnsonjh commented Apr 21, 2022

VEDIT-PLUS, dBase-86, WordStar, Turbo Pascal, CBASIC-86 (with CB86-EDIT), Tetris, and VFILER would be a decent range of real programs for CP/M-86, to start with. There are many more available at various locations.

@johnsonjh
Copy link
Collaborator

There is also quite a large range of native programming languages (BASIC, C, Pascal, Modula-2, Prolog, PL/I, FORTH, FORTRAN, Assemblers) and tools for CP/M-86.

@tsupplis
Copy link
Collaborator Author

tsupplis commented Apr 21, 2022

I actually assembled a quick cross compilation environment using your emulator for cp/m-86 development using the aztec c compiler and a couple of other tools at https://github.com/tsupplis/cpm86-crossdev
None of the cp/m-86 emulators work decently. and in some cases where there is no dos equivalent, I need to use a CP/M 8080/Z80 binary with a CP/M emulator (tnylpo)
That works well altogether but having a native solid CP/M-86 emulator would be super.

Aside from @johnsonjh tools mentioned above, I put together a couple of simple tools and libraries on CP/M-86:
https://github.com/tsupplis/cpm86-hacking

I have also reassembled the CP/M-86 1.1 kernel sources project and patched it with all the existing patches but I cannot share on git because of the license. I am trying to put together an 'extractor' project that collects all the necessary bits without storing the CP/M code but I am not finished. I can give the pointers I use nonetheless.

@johnsonjh
Copy link
Collaborator

There are quite a few CP/M-80 runtimes similar to emu2 (COM, RunCPM, izcpm, CPM80, etc.) but not for CP/M-86, so I think this is actually a great idea, since emu2 does such a good job of emulating the IBM PC hardware - nothing else works nearly as well.

There are actually multiple 16-bit CP/M derivatives, some even called CP/M-16 but not running on IBM hardware - it can be a rather confusing thing.

However, for the purposes of emu2, the CP/M-86 Software Repository has a lot of tools that are specific to the IBM PC, some of which will likely be useful for testing.

@johnsonjh
Copy link
Collaborator

johnsonjh commented Apr 21, 2022

I have a (quite specific) version of MicroEMACS I can provide too, for testing.

There isn't anything exactly special about it, except that it's the exact same editor on CP/M-68K and CP/M-86 as on UNIX.

There are at least three versions of vi also.

Something interesting to note is that quite a few of these CP/M-86 programs will directly output terminal escape sequences, usually for at least the VT52/100/102 and ADM3A, and others will output directly to the video memory of the computer, or offer both options.

@tsupplis
Copy link
Collaborator Author

@johnsonjh you are correct, you have a lot of variations

  • ccp/m-86 3.1, concurrent pc-dos 4 to 5
  • cp/m-86 1.1
  • dosplus 1.2

They all have slightly different api support. The best source of information for the call stack of CP/M vs DOS is at:
http://www.seasip.info/cpm/bdos.html

It covers all the CP/M-86 variations and calling model for 8086. It is astonishingly close to a subset of the DOS APIs but with different register conventions.

I think CP/M-86 1.1 is probably the core subset to consider as the others are moving to multi task.

@tkchia
Copy link

tkchia commented Apr 21, 2022

Hello @tsupplis,

None of the cp/m-86 emulators work decently. and in some cases where there is no dos equivalent, I need to use a CP/M 8080/Z80 binary with a CP/M emulator (tnylpo) That works well altogether but having a native solid CP/M-86 emulator would be super.

I am curious... what issues exactly did you encounter with existing CP/M-86 emulators? (I see that you mentioned ame86.exe and cpm86.exe.) I admit that I am not familiar with these, and I am rather surprised when you say that there are no "decent" (?) CP/M-86 emulators.

Thank you!

@tsupplis
Copy link
Collaborator Author

tsupplis commented Apr 21, 2022

@tkchia, one of the main issues if file closure and completion. file processing regularly fails unless the process takes the time of aligning the files on 128 bytes. Outputs end up being truncated. So it really depends. it is particularly true from key tools on cp/m-86 like asm86.cmd or gencmd.cmd. For example for those two tools I had to resort to using the cp/m-80 versions. Another interesting test is executing binaries compiled with aztec c vs binaries compiled with DR C. The .cmd generated work perfectly on cp/m-86 but only DR-C binaries work with ame86.exe or cpm86.exe.

There are other symptoms of course but the file issue is the main one.

Some combinations kinda work. cpm86.exe is packaged with the historical native aztec c compiler for cp/m-86. the output seems to be ok. But it is try and fail really.

Mind you they are definitely very sophisticated pieces of software but without the source you are stuck. the advantage of emu2 is it already works a treat on dos, is open source ... so, worth a try?

Let's correct the word, decent is a bit strong, reliable is more accurate 😉

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

No branches or pull requests

4 participants