avatar_Prodatron

SymbOS CP\/M - run CP/M programs in a virtual machine

Started by Prodatron, 23:48, 21 March 24

Previous topic - Next topic

Prodatron and 2 Guests are viewing this topic.

Prodatron

Since about two weeks Prevtenet and me are working on CP\/M, which is a virtual CP/M machine for SymbOS.
That was already an old idea originally by Dr.Zed around 2007 and later by Martin464 in 2023, who already started something (and had the cool idea about the name). Unfortunately I wasn't spending enough time for the support, which was shit (I am sorry especially to Martin464!), and so in both cases, it didn't happen.

But now we started a third try with Prevtenet, and this time it looks much more promising!

Prevtenet did the BDOS implementation, which mainly means converting CP/M functions to SymShell and SymbOS functions, realising the terminal code emulation and even do the complete FCB emulation by using the SymbOS file manager (which is based on modern file handlers, not on old-school FCBs).

In the meantime I was working on the VM skeleton for handling the TPA bank and the interbank-calls between the VM and the CP/M TPA. I also started a CCP for starting CP/M apps with parameters.

Yesterday the first goal was reached, DUMP.COM is fully working and can dump itself as an example.

You cannot view this attachment.

You cannot view this attachment.

In full screen mode it is about 2x faster than in CP/M 2.2 and about 3x faster than in CP/M Plus (without initial loading time, which would make it even more faster).

I have no idea if this will be the same for other CP/M apps as well, and what the terminal code emulation converter will eat additional.

And so as you have a lot of layers between the CP/M program and the final output...
-> CP/M application
-> wrapper/interbank calls from the TPA-bank to the VM
-> messages between the VM and SymShell
-> messages between SymShell and SymbOS
...it is still cool, that DUMP is faster in SymbOS, running in a VM, than in CP/M 2.2 :D

It's a first test and it seems to work.
It will be fun to run - multiple - CP/M apps in a multitasking environment accessing a FAT filesystem without knowing about but working fine with it. Of course they still can access CP/M filesystem as SymbOS supports both in a transparent way.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM


Prodatron

Quote from: d_kef on 00:02, 22 March 24This is very impressive indeed!!!
Looking forward to working with it.

d_kef
Thanks a lot!! It would be nice to have you as a consultant, as you are an expert.
I guess we will stay with CP/M 2.2 compatibility, as this also makes it possible to add MSX-DOS 1 emulation, which would be cool.
Other thing is, how to do a perfect FCB file pointer (CR+EX+S2) handling. We already did everything for this but are very afraid about edge cases.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

roudoudou

My pronouns are RASM and ACE

abalore

It's a big step forward, since a lot of applications could be suddenly available and make SymbOS much more useful. Does it take advantage of the full memory in the system or keeps the CP/M memory limitations?

Gryzor


McArti0

Do spectre and meltdown vulnerabilities work? :laugh: ;D

Seriously, will TurboPascal work?
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

GUNHED

Nice project!  :) :)

The idea to write a quick CP/M 'emulator/simulator/version' for FutureOS I already had in the late 90ies. However back the day I decided that it makes more sense to do the important tools / apps from scratch.
Today I would also create a 63 K CP/M 2.2 version - like the one for Symbos. However, I would use the Z80-DOS (instead of the old BDOS in 8080 code) and also add the ZCPR capabilities. (The ZCPR replaces the CCP, again Z80 code instead slow 8080 code). The result would be a rather Unix-like environment. And that would be something.

Hope this project will flourish. Good luck and good work!  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Prodatron

Quote from: abalore on 08:33, 22 March 24Does it take advantage of the full memory in the system or keeps the CP/M memory limitations?
Well, yes and yes  :) It provides a 63K TPA, and this is the limit for a CP/M application because of the Z80/8080 origin. Maybe it will later shrink to 62K if we need to place some more code on TPA-bank side for speed optimization, but it's still more than you usually have in CP/M Plus.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Prodatron

Quote from: McArti0 on 10:02, 22 March 24Do spectre and meltdown vulnerabilities work? :laugh: ;D

Seriously, will TurboPascal work?
That's a good question. Would be cool to have some of the big CP/M 2.x programs working like WordStar, SuperCalc and yes, TurboPascal as well. Let's see...

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

abalore

Quote from: Prodatron on 14:08, 22 March 24
Quote from: abalore on 08:33, 22 March 24Does it take advantage of the full memory in the system or keeps the CP/M memory limitations?
Well, yes and yes  :) It provides a 63K TPA, and this is the limit for a CP/M application because of the Z80/8080 origin. Maybe it will later shrink to 62K if we need to place some more code on TPA-bank side for speed optimization, but it's still more than you usually have in CP/M Plus.
Fair enough! If the OS supports a virtual drive with the extra RAM it will be equally useful. It would allow to use a real word processor with plenty of space and good speed.

HAL6128

Why is it faster than in the original CP/M environment? Does this mean that the CP/M port for the CPC has been bad programmed (e.g. no use of the Z80 advantages)?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

roudoudou

Quote from: HAL6128 on 17:57, 22 March 24Why is it faster than in the original CP/M environment? Does this mean that the CP/M port for the CPC has been bad programmed (e.g. no use of the Z80 advantages)?
deutsche qualität 8)
My pronouns are RASM and ACE

d_kef

Quote from: HAL6128 on 17:57, 22 March 24Why is it faster than in the original CP/M environment? Does this mean that the CP/M port for the CPC has been bad programmed (e.g. no use of the Z80 advantages)?
The original DR BDOS and CCP, used in all official CP/M implementations, including Amstrad's one, are coded in 8080 assembly. So no Z80 advantages there.
Later Z-system alternatives were written in Z80 assembly and were 3% to 7% faster, according to their authors.
But the real delay comes from the way CP/M drives the display. CP/M was written with the standard '70s output device in mind, a serial terminal.
Amstrad's BIOS emulates a serial terminal by translating the terminal codes and rendering the memory mapped display accordingly. That's the main source of delay.
I suspect that the authors of CP\/M have redirected the BDOS and BIOS display routines to the SymbOS ones, making it considerably faster.

d_kef

Prodatron

Quote from: HAL6128 on 17:57, 22 March 24Why is it faster than in the original CP/M environment? Does this mean that the CP/M port for the CPC has been bad programmed (e.g. no use of the Z80 advantages)?
d_kef already explained it very good, I think it's probably mainly because of the textoutput.

Prevtenet is continuing working on CP\/M, some more programs are now running:

You cannot view this attachment.

You cannot view this attachment.

But a lot of others are making issue, so it will be still a hard way probably.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

McArti0

CPC CP/M uses typical firmware routines like BASIC. All uses LowROM.
&BDCD  TXT DRAW CURSOR
&BDD0  TXT UNDRAW CURSOR
&BDD3  TXT WRITE CHAR
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Prodatron

#16
Quote from: McArti0 on 10:02, 22 March 24Seriously, will TurboPascal work?
At least Digital Research Pascal seems to work now, according to Prevtenet! :o

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

genesis8

Congratulations for all the work there !

Pity for the poor lads who try write about the Amstrad scene, too much work, too little time :-)
____________
Amstrad news site at Genesis8 Amstrad Page

zhulien

fantasitc!  soon, CP/M dev tools can be self-hosted on Symbos!!!  

Is it able to have multiple CP/Ms running at once or just the one? Either way, fantastic!

Prodatron

Quote from: zhulien on 03:51, 27 March 24Is it able to have multiple CP/Ms running at once or just the one? Either way, fantastic!
Yes of course you can start as many CP/M VMs as you like, as long as you have enough memory left.

The multitasking is still active even during the execution of a CP/M program.
If a CP/M program is waiting for a char or string from the console the task will go into sleepmode until something has been received, so it won't even waste CPU time.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Sykobee (Briggsy)

Absolutely amazing work!

Getting the major CP/M software working would be great achievement.

Try getting Super Star Trek running in MBASIC on CP/M under Symbos :D 

HAL6128

...even in a multitasking environment (Z80!!!) it is faster!
Ok, this means now programming in SymbOS through a VirtualCPM in Pascal / C-/M-Basic / Maxam2 & hearing cool AY-sound nearby, sending Emails, writing true type texts in an editor, or playing Solitair... 
Amazing.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

m_dr_m

Fantastic! Multiplying both SymbOs and CP/M appeal!
As @HAL6128, can't wait to test TurboPascal and Modula under SymbOs.

GUNHED

Quote from: Prodatron on 14:08, 22 March 24
Quote from: abalore on 08:33, 22 March 24Does it take advantage of the full memory in the system or keeps the CP/M memory limitations?
Well, yes and yes  :) It provides a 63K TPA, and this is the limit for a CP/M application because of the Z80/8080 origin. Maybe it will later shrink to 62K if we need to place some more code on TPA-bank side for speed optimization, but it's still more than you usually have in CP/M Plus.
You can take a look at the famous Dobbertin 63 KB CP/M 2.2 v1.4. It allows to transfer and execute code inside the system bank. That way the 64KB barrier is broken. BTW: It also supports Time Stamps for files (using the Dobbertin Time ROM - which was cloned and enhanced by dxs, see thread in this forum). Nice feature too.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Prodatron

#24
MBasic is running now! Prevtenet just reported another progress :)

You cannot view this attachment.

We added direct BIOS call support, which is used by MBasic, and now another step has been done.
The new CCP has been added as well!

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Powered by SMFPacks Menu Editor Mod