Browse Source

Add REBOOT App by MartinR

pull/437/head
Wayne Warthen 1 year ago
parent
commit
524b631a22
  1. 1
      Doc/ChangeLog.txt
  2. BIN
      Doc/RomWBW Applications.pdf
  3. BIN
      Doc/RomWBW Disk Catalog.pdf
  4. BIN
      Doc/RomWBW Errata.pdf
  5. BIN
      Doc/RomWBW System Guide.pdf
  6. BIN
      Doc/RomWBW User Guide.pdf
  7. 2
      ReadMe.md
  8. 3
      ReadMe.txt
  9. 1
      Source/Apps/Build.cmd
  10. 1
      Source/Apps/Clean.cmd
  11. 2
      Source/Apps/Makefile
  12. 10
      Source/Apps/reboot/Build.cmd
  13. 6
      Source/Apps/reboot/Clean.cmd
  14. 7
      Source/Apps/reboot/Makefile
  15. 299
      Source/Apps/reboot/reboot.asm
  16. 49
      Source/Doc/Applications.md
  17. 1
      Source/Images/fd_bp.txt
  18. 1
      Source/Images/fd_cpm22.txt
  19. 1
      Source/Images/fd_cpm3.txt
  20. 1
      Source/Images/fd_nzcom.txt
  21. 1
      Source/Images/fd_qpm.txt
  22. 1
      Source/Images/fd_zpm3.txt
  23. 1
      Source/Images/fd_zsdos.txt
  24. 1
      Source/Images/hd_bp.txt
  25. 1
      Source/Images/hd_cpm22.txt
  26. 1
      Source/Images/hd_cpm3.txt
  27. 1
      Source/Images/hd_nzcom.txt
  28. 1
      Source/Images/hd_qpm.txt
  29. 1
      Source/Images/hd_zpm3.txt
  30. 1
      Source/Images/hd_zsdos.txt
  31. 2
      Source/RomDsk/Build.cmd
  32. 2
      Source/RomDsk/Makefile

1
Doc/ChangeLog.txt

@ -42,6 +42,7 @@ Version 3.5
- MAP: Added new HBIOS function EXT_SLICE (orginally SYSGET_DIOMED)
- MAP: ROMLDR now uses EXT_SLICE to get Slice Sector for boot
- MAP: CBIOS now uses EXT_SLICE during drive selection
- M?R: Added REBOOT application
Version 3.4
-----------

BIN
Doc/RomWBW Applications.pdf

Binary file not shown.

BIN
Doc/RomWBW Disk Catalog.pdf

Binary file not shown.

BIN
Doc/RomWBW Errata.pdf

Binary file not shown.

BIN
Doc/RomWBW System Guide.pdf

Binary file not shown.

BIN
Doc/RomWBW User Guide.pdf

Binary file not shown.

2
ReadMe.md

@ -3,7 +3,7 @@
**RomWBW ReadMe** \
Version 3.5 \
Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \
05 Oct 2024
13 Oct 2024
# Overview

3
ReadMe.txt

@ -1,6 +1,6 @@
RomWBW ReadMe
Wayne Warthen (wwarthen@gmail.com)
05 Oct 2024
13 Oct 2024
@ -114,6 +114,7 @@ functionality.
Complete instructions for installation and operation of RomWBW are found
in the RomWBW User Guide.
Documentation
Documentation for RomWBW includes:

1
Source/Apps/Build.cmd

@ -28,6 +28,7 @@ pushd ZMD && call Build || exit /b & popd
pushd Dev && call Build || exit /b & popd
pushd VGM && call Build || exit /b & popd
pushd cpuspd && call Build || exit /b & popd
pushd reboot && call Build || exit /b & popd
pushd Survey && call Build || exit /b & popd
pushd HTalk && call Build || exit /b & popd
pushd BBCBASIC && call Build || exit /b & popd

1
Source/Apps/Clean.cmd

@ -17,6 +17,7 @@ pushd ZMD && call Clean || exit /b 1 & popd
pushd Dev && call Clean || exit /b 1 & popd
pushd VGM && call Clean || exit /b 1 & popd
pushd cpuspd && call Clean || exit /b 1 & popd
pushd reboot && call Clean || exit /b 1 & popd
pushd Survey && call Clean || exit /b 1 & popd
pushd HTalk && call Clean || exit /b 1 & popd
pushd BBCBASIC && call Clean || exit /b 1 & popd

2
Source/Apps/Makefile

@ -1,6 +1,6 @@
OBJECTS = sysgen.com syscopy.com assign.com format.com talk.com \
mode.com rtc.com timer.com rtchb.com
SUBDIRS = HTalk XM FDU FAT Tune Test ZMP ZMD Dev VGM cpuspd Survey BBCBASIC copysl
SUBDIRS = HTalk XM FDU FAT Tune Test ZMP ZMD Dev VGM cpuspd reboot Survey BBCBASIC copysl
DEST = ../../Binary/Apps
TOOLS =../../Tools

10
Source/Apps/reboot/Build.cmd

@ -0,0 +1,10 @@
@echo off
setlocal
set TOOLS=../../../Tools
set PATH=%TOOLS%\tasm32;%PATH%
set TASMTABS=%TOOLS%\tasm32
tasm -t180 -g3 -fFF reboot.asm reboot.com reboot.lst || exit /b
copy /Y reboot.com ..\..\..\Binary\Apps\ || exit /b

6
Source/Apps/reboot/Clean.cmd

@ -0,0 +1,6 @@
@echo off
setlocal
if exist *.com del *.com
if exist *.lst del *.lst
if exist *.bin del *.bin

7
Source/Apps/reboot/Makefile

@ -0,0 +1,7 @@
OBJECTS = reboot.com
DEST = ../../../Binary/Apps
TOOLS =../../../Tools
USETASM=1
include $(TOOLS)/Makefile.inc

299
Source/Apps/reboot/reboot.asm

@ -0,0 +1,299 @@
;==============================================================================
; REBOOT - Allows the user to Cold or Warm Boot the RomWBW System
; Version 1.0 12-October-2024
;==============================================================================
;
; Author: MartinR (October 2024)
; Based **very heavily** on code by Wayne Warthen (wwarthen@gmail.com)
;______________________________________________________________________________
;
; Usage:
; REBOOT [/C] [/W] [/?]
; ex: REBOOT Display version and usage
; REBOOT /? Display version and usage
; REBOOT /C Cold boot RomWBW system
; REBOOT /W Warm boot RomWBW system
;
; Operation:
; Cold or warm boots a RomWBW system depending on the user option selected.
;
; This code will only execute on a Z80 CPU (or derivitive)
;
; This source code assembles with TASM V3.2 under Windows-11 using the
; following command line:
; tasm -80 -g3 -l REBOOT.ASM REBOOT.COM
; ie: Z80 CPU; output format 'binary' named .COM (rather than .OBJ)
; and includes a symbol table as part of the listing file.
;______________________________________________________________________________
;
; Change Log:
; 2024-09-11 [WBW] Release of RomWBW CPU Speed Selector v1.0 used as the basis
; 2024-10-12 [MR ] Initial release of version 1.0
;______________________________________________________________________________
;
; Include Files
;
#include "../../ver.inc" ; Used for building RomWBW
#include "../../HBIOS/hbios.inc"
;#include "ver.inc" ; Used for testing purposes....
;#include "hbios.inc" ; ....during code development
;
;===============================================================================
;
; General operational equates (should not requre adjustment)
;
stksiz .equ $40 ; Working stack size
;
restart .equ $0000 ; CP/M restart vector
bdos .equ $0005 ; BDOS invocation vector
;
bf_sysreset .equ $F0 ; restart system
bf_sysres_int .equ $00 ; reset hbios internal
bf_sysres_warm .equ $01 ; warm start (restart boot loader)
bf_sysres_cold .equ $02 ; cold start
;
ident .equ $FFFE ; loc of RomWBW HBIOS ident ptr
;
;===============================================================================
;
.org $0100 ; standard CP/M TPA executable
;
; setup stack (save old value)
ld (stksav),sp ; save stack
ld sp,stack ; set new stack
;
call crlf
ld de,str_banner ; banner
call prtstr
;
; initialization
call init ; initialize
jr nz,exit ; abort if init fails
;
call main ; do the real work
;
exit:
; clean up and return to command processor
call crlf ; formatting
ld sp,(stksav) ; restore stack
jp restart ; return to CP/M via restart
;
;
;===============================================================================
; Main Program
;===============================================================================
;
; Initialization
;
init:
; check for UNA (UBIOS)
ld a,($FFFD) ; fixed location of UNA API vector
cp $C3 ; jp instruction?
jr nz,initwbw ; if not, not UNA
ld hl,($FFFE) ; get jp address
ld a,(hl) ; get byte at target address
cp $FD ; first byte of UNA push ix instruction
jr nz,initwbw ; if not, not UNA
inc hl ; point to next byte
ld a,(hl) ; get next byte
cp $E5 ; second byte of UNA push ix instruction
jr nz,initwbw ; if not, not UNA
jp err_una ; UNA not supported
;
initwbw:
; get location of config data and verify integrity
ld hl,(ident) ; HL := adr or RomWBW HBIOS ident
ld a,(hl) ; get first byte of RomWBW marker
cp 'W' ; match?
jp nz,err_inv ; abort with invalid config block
inc hl ; next byte (marker byte 2)
ld a,(hl) ; load it
cp ~'W' ; match?
jp nz,err_inv ; abort with invalid config block
inc hl ; next byte (major/minor version)
ld a,(hl) ; load it
cp rmj << 4 | rmn ; match?
jp nz,err_ver ; abort with invalid os version
;
initz:
; initialization complete
xor a ; signal success
ret ; return
;
;
;
main:
; skip to start of first command line parameter
ld ix,$0081 ; point to start of parm area (past length byte)
call nonblank ; skip to next non-blank char
cp '/' ; option prefix?
jr nz,usage ; display help info & exit if nothing to do
;
; process any options
inc ix ; fetch next character and process
ld a,(ix)
call upcase ; ensure it's an upper case character
cp 'C' ; if it's a 'C' then
jr z,cboot ; do a cold boot.
cp 'W' ; if it's a 'W' then
jr z,wboot ; do a warm boot.
cp '?' ; if it's a '?' then
jr z,usage ; display usage info and exit.
jr err_parm ; or not a recognised option, so report and exit.
;
; Handle Usage Information
;
usage:
call crlf2 ; display the options for this utility
ld de,str_usage
call prtstr
or $FF
ret ; exit back out to CP/M CCP
;
; Handle Warm Boot
;
wboot:
ld de,str_warmboot ; message
call prtstr ; display it
ld b,bf_sysreset ; system restart
ld c,bf_sysres_warm ; warm start
call $fff0 ; call hbios
;
; Handle Cold Boot
;
cboot:
ld de,str_coldboot ; message
call prtstr ; display it
ld b,bf_sysreset ; system restart
ld c,bf_sysres_cold ; cold start
call $fff0 ; call hbios
;
;===============================================================================
; Error Handlers
;===============================================================================
;
err_una:
ld de,str_err_una
jr err_ret
err_inv:
ld de,str_err_inv
jr err_ret
err_ver:
ld de,str_err_ver
jr err_ret
err_parm:
ld de,str_err_parm
jr err_ret
;
err_ret:
call crlf2
call prtstr
or $FF ; signal error
ret
;
;===============================================================================
; Utility Routines
;===============================================================================
;
; Print character in A without destroying any registers
;
prtchr:
push af
push bc ; save registers
push de
push hl
ld e,a ; character to print in E
ld c,$02 ; BDOS function to output a character
call bdos ; do it
pop hl ; restore registers
pop de
pop bc
pop af
ret
;
; Start a new line
;
crlf2:
call crlf ; two of them
crlf:
push af ; preserve AF
ld a,13 ; <CR>
call prtchr ; print it
ld a,10 ; <LF>
call prtchr ; print it
pop af ; restore AF
ret
;
; Print a zero terminated string at (de) without destroying any registers
;
prtstr:
push af
push de
;
prtstr1:
ld a,(de) ; get next char
or a
jr z,prtstr2
call prtchr
inc de
jr prtstr1
;
prtstr2:
pop de ; restore registers
pop af
ret
;
; Get the next non-blank character from (ix)
;
nonblank:
ld a,(ix) ; load next character
or a ; string ends with a null
ret z ; if null, return pointing to null
cp ' ' ; check for blank
ret nz ; return if not blank
inc ix ; if blank, increment character pointer
jr nonblank ; and loop
;
; Convert character in A to uppercase
;
upcase:
cp 'a' ; if below 'a'
ret c ; ... do nothing and return
cp 'z' + 1 ; if above 'z'
ret nc ; ... do nothing and return
res 5,a ; clear bit 5 to make lower case -> upper case
ret ; and return
;
;===============================================================================
; Constants
;===============================================================================
;
str_banner .db "RomWBW Reboot Utility, Version 1.0, 12-Oct-2024\r\n"
.db " Wayne Warthen (wwarthen@gmail.com) & MartinR",0
;
str_warmboot .db "\r\n\r\nWarm booting...\r\n",0
str_coldboot .db "\r\n\r\nCold booting...\r\n",0
;
str_err_una .db " ERROR: UNA not supported by application",0
str_err_inv .db " ERROR: Invalid BIOS (signature missing)",0
str_err_ver .db " ERROR: Unexpected HBIOS version",0
str_err_parm .db " ERROR: Parameter error (REBOOT /? for usage)",0
;
str_usage .db " Usage: REBOOT /? - Display this help info.\r\n"
.db " REBOOT /W - Warm boot system\r\n"
.db " REBOOT /C - Cold boot system\r\n"
.db " Options are case insensitive.\r\n",0
;
;===============================================================================
; Working data
;===============================================================================
;
stksav .dw 0 ; stack pointer saved at start
.fill stksiz,0 ; stack
stack .equ $ ; stack top
;
;===============================================================================
;
.end

49
Source/Doc/Applications.md

@ -403,7 +403,7 @@ CP/M, while others rely on particular hardware or
aspects of RomWBW itself.
Those that are written specific to RomWBW include: ASSIGN,
CPUSPD, FDU, FORMAT, FLASH, FDISK80, MODE, RTC, SYSCOPY,
CPUSPD, FDU, FORMAT, FLASH, FDISK80, MODE, REBOOT, RTC, SYSCOPY,
TALK, TIMER, XM, and COPYSL.
The CP/M utilities supplied with RomWBW warrant more detailed descriptions,
@ -905,6 +905,7 @@ incuded within RomWBW may be found with in the Binary/Apps directory.
| FORMAT | Yes | Yes |
| HTALK | Yes | Yes |
| MODE | Yes | Yes |
| REBOOT | Yes | Yes |
| RTC | Yes | Yes |
| SURVEY | Yes | Yes |
| SYSCOPY | Yes | Yes |
@ -918,7 +919,7 @@ incuded within RomWBW may be found with in the Binary/Apps directory.
All of the CP/M applications may be found in the RomWBW Binary/Apps directory
and a user may copy those they need to their own customised disk/slice.
Independantly of whether the CP/M system was started from ROM or a boot disk,
Independently of whether the CP/M system was started from ROM or a boot disk,
such as a floppy disk or a slice on a CF or uSD memory card, applications
may be located on and executed from either the ROM-disk itself or from other media.
There are multiple disk images available for CP/M (eg floppy, legacy hard-disk and new
@ -1753,6 +1754,50 @@ provided in the RomWBW distribution.
`\clearpage`{=latex}
## REBOOT
| REBOOT | |
| --------------------|---|
| ROM-based |Yes|
| Disk-based |Yes|
The `REBOOT` application is used to restart a running system from an
operating system prompt. It can invoke either a warm or cold restart
via command line switches.
#### Syntax
| `REBOOT /W`
| `REBOOT /C`
| `REBOOT /?`
- /C initiates a cold restart
- /W initiates a warm restart
- /? displays command line usage
#### Usage
Entering `REBOOT` with no parameters will display the usage and
version information. Use /C or /W to immediately initiate a
cold or warm restart.
#### Notes
A warm restart just returns to the Boot Loader menu.
A cold restart will reinitialize the system as though power had
been recycled.
#### Etymology
The `REBOOT` application was custom written for RomWBW by MartinR. All
of the hardware interface code is specific to RomWBW and the application
will not operate correctly on non-RomWBW systems.
The source code is provided in the RomWBW distribution.
`\clearpage`{=latex}
## RTC
| RTC | |

1
Source/Images/fd_bp.txt

@ -12,6 +12,7 @@
#../../Binary/Apps/*.com 15:
../../Binary/Apps/assign.com 15:
../../Binary/Apps/cpuspd.com 15:
../../Binary/Apps/reboot.com 15:
../../Binary/Apps/fat.com 15:
../../Binary/Apps/fdu.com 15:
../../Binary/Apps/fdu.doc 15:

1
Source/Images/fd_cpm22.txt

@ -8,6 +8,7 @@ d_cpm22/ReadMe.txt 0:
#../../Binary/Apps/*.com 0:
../../Binary/Apps/assign.com 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/fat.com 0:
../../Binary/Apps/fdu.com 0:
../../Binary/Apps/fdu.doc 0:

1
Source/Images/fd_cpm3.txt

@ -24,6 +24,7 @@
#../../Binary/Apps/*.com 0:
../../Binary/Apps/assign.com 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/fat.com 0:
../../Binary/Apps/fdu.com 0:
../../Binary/Apps/fdu.doc 0:

1
Source/Images/fd_nzcom.txt

@ -14,6 +14,7 @@ d_cpm22/u0/XSUB.COM 15:
#../../Binary/Apps/*.com 15:
../../Binary/Apps/assign.com 15:
../../Binary/Apps/cpuspd.com 15:
../../Binary/Apps/reboot.com 15:
../../Binary/Apps/fat.com 15:
../../Binary/Apps/fdu.com 15:
../../Binary/Apps/rtc.com 15:

1
Source/Images/fd_qpm.txt

@ -12,6 +12,7 @@ d_cpm22/u0/*.* 0:
#../../Binary/Apps/*.com 0:
../../Binary/Apps/assign.com 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/fat.com 0:
../../Binary/Apps/fdu.com 0:
../../Binary/Apps/fdu.doc 0:

1
Source/Images/fd_zpm3.txt

@ -23,6 +23,7 @@
#../../Binary/Apps/*.com 15:
../../Binary/Apps/assign.com 15:
../../Binary/Apps/cpuspd.com 15:
../../Binary/Apps/reboot.com 15:
../../Binary/Apps/fat.com 15:
../../Binary/Apps/fdu.com 15:
#../../Binary/Apps/fdu.doc 15:

1
Source/Images/fd_zsdos.txt

@ -21,6 +21,7 @@ d_cpm22/u0/XSUB.COM 0:
#../../Binary/Apps/*.com 0:
../../Binary/Apps/assign.com 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/fat.com 0:
../../Binary/Apps/fdu.com 0:
../../Binary/Apps/fdu.doc 0:

1
Source/Images/hd_bp.txt

@ -14,6 +14,7 @@
../../Binary/Apps/bbcbasic.com 0:
../../Binary/Apps/bbcbasic.txt 0:
../../Binary/Apps/cpuspd.com 15:
../../Binary/Apps/reboot.com 15:
../../Binary/Apps/copysl.com 0:
../../Binary/Apps/copysl.doc 0:
../../Binary/Apps/fat.com 15:

1
Source/Images/hd_cpm22.txt

@ -10,6 +10,7 @@ d_cpm22/ReadMe.txt 0:
../../Binary/Apps/bbcbasic.com 0:
../../Binary/Apps/bbcbasic.txt 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/copysl.com 0:
../../Binary/Apps/copysl.doc 0:
../../Binary/Apps/fat.com 0:

1
Source/Images/hd_cpm3.txt

@ -26,6 +26,7 @@
../../Binary/Apps/bbcbasic.com 0:
../../Binary/Apps/bbcbasic.txt 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/copysl.com 0:
../../Binary/Apps/copysl.doc 0:
../../Binary/Apps/fat.com 0:

1
Source/Images/hd_nzcom.txt

@ -33,6 +33,7 @@ d_zsdos/u0/*.DAT 15:
../../Binary/Apps/bbcbasic.com 15:
../../Binary/Apps/bbcbasic.txt 10:
../../Binary/Apps/cpuspd.com 15:
../../Binary/Apps/reboot.com 15:
../../Binary/Apps/copysl.com 0:
../../Binary/Apps/copysl.doc 0:
../../Binary/Apps/fat.com 15:

1
Source/Images/hd_qpm.txt

@ -14,6 +14,7 @@ d_cpm22/u0/*.* 0:
../../Binary/Apps/bbcbasic.com 0:
../../Binary/Apps/bbcbasic.txt 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/copysl.com 0:
../../Binary/Apps/copysl.doc 0:
../../Binary/Apps/fat.com 0:

1
Source/Images/hd_zpm3.txt

@ -25,6 +25,7 @@
../../Binary/Apps/bbcbasic.com 0:
../../Binary/Apps/bbcbasic.txt 0:
../../Binary/Apps/cpuspd.com 15:
../../Binary/Apps/reboot.com 15:
../../Binary/Apps/copysl.com 0:
../../Binary/Apps/copysl.doc 0:
../../Binary/Apps/fat.com 15:

1
Source/Images/hd_zsdos.txt

@ -23,6 +23,7 @@ d_cpm22/u0/XSUB.COM 0:
../../Binary/Apps/bbcbasic.com 0:
../../Binary/Apps/bbcbasic.txt 0:
../../Binary/Apps/cpuspd.com 0:
../../Binary/Apps/reboot.com 0:
../../Binary/Apps/copysl.com 0:
../../Binary/Apps/copysl.doc 0:
../../Binary/Apps/fat.com 0:

2
Source/RomDsk/Build.cmd

@ -10,7 +10,7 @@ set TASMTABS=%TOOLS%\tasm32
set CPMDIR80=%TOOLS%/cpm/
set RomApps1=assign mode rtc syscopy xm
set RomApps2=fdu format survey sysgen talk timer cpuspd
set RomApps2=fdu format survey sysgen talk timer cpuspd reboot
::
:: Make all variants of the ROM Disk contents image. Three sizes are

2
Source/RomDsk/Makefile

@ -7,7 +7,7 @@ include $(TOOLS)/Makefile.inc
.SHELLFLAGS = -ce
ROMAPPS1 := assign mode rtc syscopy xm
ROMAPPS2 := fdu format survey sysgen talk timer cpuspd
ROMAPPS2 := fdu format survey sysgen talk timer cpuspd reboot
rom128_%.dat: DISKDEF=wbw_rom128
rom256_%.dat: DISKDEF=wbw_rom256

Loading…
Cancel
Save