Running a batch file as part of CP/M 2.2 boot

244 views
Skip to first unread message

Barry Hills

unread,
Oct 28, 2022, 9:02:51 PM10/28/22
to IMSAI 8080esp
I am looking for a way to run a batch file as part of cp/m boot.  

Apparently the simplest way to do this is to have a PROFILE.SUB batch script but I think it is only a cp/m 3 feature but I cannot find a cp/m 3 HEX file for the esp32.  Any pointers?

For cp/m 2.2 apparently a utility called AUTO.COM will patch cp/m to do the same as cp/m 3 but again I am unable to locate AUTO.com.  Any pointers?

Anybody know if my understanding is correct or not?  Any other methods to achieve my ultimate goal here?

thanks in advance

udo....@freenet.de

unread,
Oct 28, 2022, 10:11:07 PM10/28/22
to IMSAI 8080esp
hills...@gmail.com schrieb am Samstag, 29. Oktober 2022 um 03:02:51 UTC+2:
I am looking for a way to run a batch file as part of cp/m boot.  

Apparently the simplest way to do this is to have a PROFILE.SUB batch script but I think it is only a cp/m 3 feature but I cannot find a cp/m 3 HEX file for the esp32.  Any pointers?

CP/M 3 disk images are available here:

It already includes a PROFILE.SUB that you can change to your needs.

For cp/m 2.2 apparently a utility called AUTO.COM will patch cp/m to do the same as cp/m 3 but again I am unable to locate AUTO.com.  Any pointers?

I don't know about this AUTO.COM, but the CP/M 2 CCP can easily be patched to execute a program. Here you'll find
informations about how to do that:

udo....@freenet.de

unread,
Oct 30, 2022, 5:09:51 AM10/30/22
to IMSAI 8080esp
That reminds me, the BIOS doesn't differ between cold and warm start and always jumps to the first CCP entry.
So if you patch a command into the CCP buffer it will get executed at every cold and warm boot, which likely
is not what is wanted. Need to cram this into the BIOS somehow...

And for this AUTO.COM, in the discussion above there is a link for the program to the CP/M CDROM. The link
is dead but is available at archive.org here:

udo....@freenet.de

unread,
Oct 30, 2022, 7:55:59 AM10/30/22
to IMSAI 8080esp
I have modified the BIOS so that it jumps to the different CCP entries on cold and warm boot.
If you just need the BIOS, the source is here:

Then to test this I added patch commands into sysgen54.sub that patch the stat command into the CCP
command buffer. The disk image with the new BIOS and sysgen submit is available here:

I also tried to patch 'submit profile' as command into the CCP, if the file is absent submit just complains
as expected. If the file is present the system won't boot correct anymore, outputs newlines to the terminal
in an endless loop. No idea yet why.

udo....@freenet.de

unread,
Oct 31, 2022, 6:21:30 AM10/31/22
to IMSAI 8080esp
Figured out the problem, it is caused by the patched submit.com, using an original DRI submit.com works.
The DRI submit.com is very buggy, so I copied it as submito.com to the disk and the CCP is patched to
execute 'submito profile' on cold boot. With that now CP/M 2 executes profile.sub at cold start, same
as CP/M 3 does.

Updated CP/M 2 disk image is available here:

udo....@freenet.de

unread,
Oct 31, 2022, 8:32:32 AM10/31/22
to IMSAI 8080esp
Of course I was wondering why the original DRI submit worked, while the self compiled patched version
didn't. Problem is due to the stack size reserved in submit, increasing it fixed the problem. The CP/M 2
disk linked above is updated again and includes only one submit.com.

udo....@freenet.de

unread,
Nov 2, 2022, 8:36:42 AM11/2/22
to IMSAI 8080esp
I have separated patching of autostart from sysgen into it's own auto.sub.
To sysgen a CP/M without autostart just do as before:

submit sysgen54
sysgen cpm54.sys

submit sysgen60
sysgen cpm60.sys
...
...
If you want a CP/M with autostart do:

submit sysgen54
submit auto cpm54.sys
sysgen cpm54.sys

submit sysgen60
submit auto cpm60.sys
sysgen cpm60.sys
...
...

I also renamed the porta/b.sub scripts to serial.sub and modem.sub, keep forgetting which did what ;-)

Reply all
Reply to author
Forward
0 new messages