Page 1 of 1

CP/M Boot Menu?

Posted: 29 Aug 2015 22:48
by wyerd
Is it possible to have a simple menu to appear once CP/M has booted? I'd like to be able to select Newword, SuperCalc, and some games off it. In MSDOS I'd use a batch file, but there's nothing similar in CP/M AFAIK. Any ideas?

Thanks.

Re: CP/M Boot Menu?

Posted: 30 Aug 2015 08:42
by Bill B
I haven't tried this, but I think it is possible. However the process is more complex than writing a batch file.

You need to create your own menu program, which does the following steps:
  1. Displays your menu of options to select.
  2. Processes user input to select an item.
  3. Creates a file "A:$$$.SUB" with the following contents:
    • Byte 1: Length of command to execute (N).
    • Bytes 2 - N+1: The command.
    • Byte N+2: Null byte (0x00).
    This is how the CP/M SUBMIT command works [Source: "CP/M The Software Bus", A Clarke, MJ Eaton, D Powys-Lybbe, ISBN 0-905104-18-8, chapter 5]
  4. Returns to CP/M (warm boot).
Once the menu program is working, use the STARTUP command so that it is run automatically on boot-up.

Notes:
  • I don't think that you can use FDXB to write the menu program, it does not return cleanly to CP/M. BBC BASIC should be OK.
  • The $$$.SUB file can contain multiple commands, but other than noting that the commands are executed in reverse order, my source does not give details. More research needed.

Re: CP/M Boot Menu?

Posted: 30 Aug 2015 15:47
by Martin A
FDXB is fine for game selection if you have them in RUN or BAS format, as it's quite happy to USER RUN or USER LOAD other programs.

I've seen one crude menu system that might have been DOS rather than CPM, but the principle is the same.

TYPE MENU.TXT was used to display a simple menu screen, and then all the relevant programs had been renamed to a single letter which was then typed at the command prompt.

I've just faked something similar on the CFX prototype, CPM side. There's an imbedded CLS code at the start of the text file to clear the screen, but if you pad out the "menu" to 23 lines that's not needed.
Crudest menu system out
Crudest menu system out
menu1.jpg (18.02 KiB) Viewed 8870 times

Re: CP/M Boot Menu?

Posted: 30 Aug 2015 17:15
by wyerd
Thanks for the replies and ideas which I'll investigate further.

I stumbled upon this http://www.z80.eu/microshell.html while Googling. I might just do the job as long as it doesn't take up too much memory.

Re: CP/M Boot Menu?

Posted: 07 Sep 2015 17:29
by JonB
You could get the menu program to inject the launch command direct into the CCP's command buffer then jump to the routine that interprets it.. Now that would be cool, but you would need to work out where everything is by disassembling the CCP and comparing with a copy of the source (such as the one I just attached).