diff --git a/Doc/ChangeLog.txt b/Doc/ChangeLog.txt index 895dd114..94b7eec7 100644 --- a/Doc/ChangeLog.txt +++ b/Doc/ChangeLog.txt @@ -51,6 +51,7 @@ Version 2.9.2 - WBW: Boot from any slice - C?M: Added Unix build process - PLS: FreeRTOS compatibility +- WWB: Removed OSLDR application (can't handle new OSes) Version 2.9.1 ------------- diff --git a/Doc/RomWBW Applications.pdf b/Doc/RomWBW Applications.pdf index 089bf13e..360c12ee 100644 Binary files a/Doc/RomWBW Applications.pdf and b/Doc/RomWBW Applications.pdf differ diff --git a/Doc/RomWBW Architecture.pdf b/Doc/RomWBW Architecture.pdf index bf265d6f..72aa85c9 100644 Binary files a/Doc/RomWBW Architecture.pdf and b/Doc/RomWBW Architecture.pdf differ diff --git a/Doc/RomWBW Getting Started.pdf b/Doc/RomWBW Getting Started.pdf index af4b1e8e..2dfdd62e 100644 Binary files a/Doc/RomWBW Getting Started.pdf and b/Doc/RomWBW Getting Started.pdf differ diff --git a/ReadMe.md b/ReadMe.md index 896b2148..aab68ae0 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -3,7 +3,7 @@ ## Z80/Z180 System Software Version 2.9.2 Prerelease -Sunday 22 March 2020 +Wednesday 25 March 2020 Wayne Warthen @@ -111,21 +111,21 @@ directory contains the pre-built ROM and disk images. The ROM image files all end in “.rom”. Based on the table below, **carefully** pick the appropriate ROM image for your hardware. -| Platform | ROM Image File | Baud | Description | -| ------------- | --------------- | -----: | ----------------------------------------------- | -| SBC V1/V2 | SBC\_std.rom | 38400 | RetroBrew SBC v1 or v2 ECB Z80 | -| Zeta V1 | ZETA\_std.rom | 38400 | RetroBrew Zeta V1 Z80, ParPortProp (optional) | -| Zeta V2 | ZETA2\_std.rom | 38400 | RetroBrew Zeta V2 Z80, ParPortProp (optional) | -| N8 | N8\_std.rom | 38400 | RetroBrew N8 Z180, date code \>= 2312 | -| Mark IV | MK4\_std.rom | 38400 | RetroBrew Mark IV ECB Z180 | -| RC2014 Z80 | RCZ80\_std.rom | 115200 | RC2014 w/ Z80 CPU, requires 512K RAM/ROM module | -| RC2014 Z180\* | RCZ180\_ext.rom | 115200 | RC2014 w/ Z180 CPU & 512K banked RAM/ROM module | -| RC2014 Z180\* | RCZ180\_nat.rom | 115200 | RC2014 w/ Z180 CPU & 512K native RAM/ROM module | -| Easy Z80 | EZZ80\_std.rom | 115200 | Sergey Kiselev’s Easy Z80 | -| SC126 | SCZ180\_126.rom | 115200 | Stephen Cousin’s SC126 Z180 | -| SC130 | SCZ180\_130.rom | 115200 | Stephen Cousin’s SC130 Z180 | -| SC131 | SCZ180\_131.rom | 115200 | Stephen Cousin’s SC131 Z180 | -| Dyno | DYNO\_std.rom | 38400 | Steve Garcia’s Z180 Dyno Computer | +| Platform | ROM Image File | Baud | Description | +| --------- | --------------- | -----: | ----------------------------------------------- | +| SBC | SBC\_std.rom | 38400 | RetroBrew SBC v1 or v2 ECB Z80 | +| Zeta V1 | ZETA\_std.rom | 38400 | RetroBrew Zeta V1 Z80, ParPortProp (optional) | +| Zeta V2 | ZETA2\_std.rom | 38400 | RetroBrew Zeta V2 Z80, ParPortProp (optional) | +| N8 | N8\_std.rom | 38400 | RetroBrew N8 Z180, date code \>= 2312 | +| Mark IV | MK4\_std.rom | 38400 | RetroBrew Mark IV ECB Z180 | +| RC Z80 | RCZ80\_std.rom | 115200 | RC2014 w/ Z80 CPU, requires 512K RAM/ROM module | +| RC Z180\* | RCZ180\_ext.rom | 115200 | RC2014 w/ Z180 CPU & 512K banked RAM/ROM module | +| RC Z180\* | RCZ180\_nat.rom | 115200 | RC2014 w/ Z180 CPU & 512K native RAM/ROM module | +| Easy Z80 | EZZ80\_std.rom | 115200 | Sergey Kiselev’s Easy Z80 | +| SC126 | SCZ180\_126.rom | 115200 | Stephen Cousin’s SC126 Z180 | +| SC130 | SCZ180\_130.rom | 115200 | Stephen Cousin’s SC130 Z180 | +| SC131 | SCZ180\_131.rom | 115200 | Stephen Cousin’s SC131 Z180 | +| Dyno | DYNO\_std.rom | 38400 | Steve Garcia’s Z180 Dyno Computer | \*The RC2014 Z180 requires a separate RAM/ROM memory module. There are two types of these modules and you must pick the ROM for your type of @@ -165,120 +165,6 @@ disappear at the next power on (RAM is generally not persistent). Also note that attempts to save files to the ROM disk (B:) will fail because ROM is not writable. -# Upgrading - -Upgrading to a newer release of RomWBW is essentially just a matter of -updating the ROM chip in your system. If you have spare ROM chips for -your system and a ROM programmer, it is always safest to retain your -existing, working ROM chip and program a new one with the new firmware. -If the new one fails to boot, you can easily return to the known working -ROM. - -Prior to attempting to reprogram your actual ROM chip, you may wish to -“try” the upgrade. With RomWBW, you can upload a new system image -executable and load it from the command line. For each ROM image file -(.rom) in the Binary directory, you will also find a corresponding -application file (.com). For example, for SBC\_std.rom, there is also an -SBC\_std.com file. You can upload the .com file to your system using -XModem, then simply run the .com file. You will see your system go -through the normal startup process just like it was started from ROM. -However, your ROM has not been updated and the next time you boot your -system, it will revert to the system image contained in ROM. You may -find that you are unable to load the .com file because it is too large -to fit in available application RAM (TPA). Unfortunately, in this case, -you will not be able to use the .com file mechanism to start your -system. - -If you do not have easy access to a ROM programmer, it is usually -possible to reprogram your system ROM using the FLASH utility from Will -Sowerbutts. This application, called FLASH.COM, can be found on the ROM -drive of any running system. In this case, you would need to transfer -the new ROM image (.rom) over to your system using XModem (or one of the -other mechanisms described in the Transferring Files section below). The -ROM image is too large to fit on your RAM drive, so you will need to -transfer it to a larger storage drive. Once the ROM image is on your -system, you can use the FLASH application to update your ROM. The -following is a typical example of transferring ROM image using XModem -and flashing the chip in-situ. - - E>xm r rom.img - - XMODEM v12.5 - 07/13/86 - RBC, 28-Aug-2019 [WBW], ASCI - - Receiving: E0:ROM.IMG - 7312k available for uploads - File open - ready to receive - To cancel: Ctrl-X, pause, Ctrl-X - - Thanks for the upload - - E>flash write rom.img - FLASH4 by Will Sowerbutts version 1.2.3 - - Using RomWBW (v2.6+) bank switching. - Flash memory chip ID is 0xBFB7: 39F040 - Flash memory has 128 sectors of 4096 bytes, total 512KB - Write complete: Reprogrammed 2/128 sectors. - Verify (128 sectors) complete: OK! - -Obviously, there is some risk to this approach since any issues with the -programming or ROM image could result in a non-functional system. - -To confirm your ROM chip has been successfully updated, restart your -system and boot an operating system from ROM. Do not boot from a disk -device yet. Review the boot messages to see if any issues have occurred. - -Once you are satisfied that the ROM is working well, you will need to -update the system images and RomWBW custom applications on your disk -drives. The system images and custom applications are matched to the -RomWBW ROM firmware in use. If you attempt to boot a disk or run -applications that have not been updated to match the current ROM -firmware, you are likely to have odd problems. - -The simplest way to update your disk media is to just use your modern -computer to overwrite the entire media with the latest disk image of -your choice. This process is described below in the Disk Images section. -If you wish to update existing disk media in your system, you need to -perform the following steps. - -If the disk is bootable, you need to update the system tracks of the -disk.This is done using a SYSCOPY command such as `SYSCOPY -C:=B:ZSYS.SYS`. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M 2.2 -disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS. CPMLDR.SYS -is not provided on the ROM disk, so you would need to upload it from the -distribution. - -Finally, if you have copies of any of the RomWBW custom applications on -your hard disk, you need to update them with the latest copies. The -following applications are found on your ROM disk. Use COPY to copy them -over any older versions of the app on your disk: - - - ASSIGN.COM - - SYSCOPY.COM - - MODE.COM - - FDU.COM (was FDTST.COM) - - OSLDR.COM - - FORMAT.COM - - XM.COM - - FLASH.COM - - FDISK80.COM - - TALK.COM - - RTC.COM - - TIMER.COM - - INTTEST.COM - -For example: `B>COPY ASSIGN.COM C:` - -Some RomWBW custom applications are too large to fit on the ROM disk. If -you are using any of these you will need to transfer them to your system -and then update all copies. These applications are found in the -Binary\\Apps directory of the distribution and in all of the disk -images. - - - FAT.COM - - TUNE.COM - # General Usage Each of the operating systems and ROM applications included with RomWBW @@ -484,19 +370,20 @@ the OS variants included with RomWBW. The following custom applications are found on the ROM disk and are, therefore, globally available. -| Application | Description | -| ----------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| ASSIGN | Add, change, and delete drive letter assignments. Use ASSIGN /? for usage instructions. | -| SYSCOPY | Copy system image to a device to make it bootable. Use SYSCOPY with no parms for usage instructions. | -| FDU | Format and test floppy disks. Menu driven interface. | -| OSLDR | Load a new OS on the fly. For example, you can switch to Z-System when running CP/M. Use OSLDR with no parms for usage instructions. | -| FORMAT | Will someday be a command line tool to format floppy disks. Currently does nothing\! | -| MODE | Reconfigures serial ports dynamically. | -| XM | XModem file transfer program adapted to hardware. Automatically uses primary serial port on system. | -| FDISK80 | John Coffman’s Z80 hard disk partitioning tool. See documentation in Doc directory. | -| FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | -| FLASH | Will Sowerbutts’ in-situ ROM programming utility. | -| CLRDIR | Initialize the directory area of a CP/M disk (Max Scane). | +| Application | Description | +| ----------- | ---------------------------------------------------------------------------------------------------- | +| ASSIGN | Add, change, and delete drive letter assignments. Use ASSIGN /? for usage instructions. | +| SYSCOPY | Copy system image to a device to make it bootable. Use SYSCOPY with no parms for usage instructions. | +| MODE | Reconfigures serial ports dynamically. | +| FDU | Format and test floppy disks. Menu driven interface. | +| FORMAT | Will someday be a command line tool to format floppy disks. Currently does nothing\! | +| XM | XModem file transfer program adapted to hardware. Automatically uses primary serial port on system. | +| FLASH | Will Sowerbutts’ in-situ ROM programming utility. | +| FDISK80 | John Coffman’s Z80 hard disk partitioning tool. See documentation in Doc directory. | +| TALK | Direct console I/O to a specified character device. | +| RTC | Manage and test the Real Time Clock hardware. | +| TIMER | Display value of running periodic system timer. | +| INTTEST | Test interrupt vector hooking. | Some custom applications do not fit on the ROM disk. They are found on the disk image files or the individual files can be found in the @@ -507,9 +394,8 @@ Binary\\Apps directory of the distribution. | TUNE | Play .PT2, .PT3, .MYM audio files. | | FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | -There is additional documentation on some of these applications at the -[RomWBW Applications -Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:romwbw:apps). +Additional documentation on all of these applications can be found in +“RomWBW Applications.pdf” in the Doc directory of the distribution. # Using Disks @@ -818,6 +704,16 @@ usage (“CPM Manual.pdf”). If you are new to the CP/M world, I would recommend using this CP/M variant to start with simply because it is the most stable and you are less likely to encounter problems. +### Errata + + - The original versions of DDT, DDTZ, and ZSID used the RST 38 vector + which conflicts with interrupt mode 1 use of this vector. The DDT, + DDTZ, and ZSID applications in RomWBW have been modified to use RTS + 30 to avoid this issue. + + - Z-System applications will not run under CP/M 2.2. For example, the + `LDDS` date stamper with not run. + ## ZSDOS 1.1 ZSDOS is the most popular non-DRI CP/M “clone” which is generally @@ -832,6 +728,13 @@ Additionally, the official documentation for Z-System is included in the RomWBW distribution Doc directory (“ZSDOS Manual.pdf” and “ZCPR Manual.pdf”). +### Errata + + - Although most CP/M 2.2 applications will run under Z-System, some + may not work as expected. The best example is PIP which is not aware + of the ZSDOS paths and will fail in some scenarios (use `COPY` + instead). + ## NZCOM Automatic Z-System NZCOM is a much further refined version of Z-System (ZCPR 3.4). NZCOM @@ -842,11 +745,16 @@ On the RomWBW NZCOM disk images, the boot OS is ZSDOS 1.1. After you configure NZCOM, you can add a `PROFILE.SUB` file to automatically launch NZCOM at boot. -To use, NZCOM, you must run through a simple configuration process. This -is well documented in the NZCOM manual in the “NZCOM Users Manual.pdf” -file in the RomWBW Doc directory. Additionally, there are instructions -for automatically launching NZCOM when the disk is booted under the host -OS via an auto command submission process. +NZCOM is not pre-configured. You must run through a simple configuration +process before loading it. Run MKZCM to do this. + +NZCOM has substantially more functionality than CP/M or basic Z-System. +It is important to read the the “NZCOM Users Manual.pdf” file in the +RomWBW Doc directory. + +### Errata + + - There is no `DIR` command, you must use `SDZ` instead. ## Digital Research CP/M 3 @@ -858,7 +766,13 @@ support tools and help system. Note that to make a CP/M 3 boot disk, you actually place CPMLDR.SYS on the system tracks of the disk. You do not place CPM3.SYS on the system -tracks. +tracks. `CPMLDR.SYS` chain loads `CPM3.SYS`. + +### Errata + + - CLRDIR is not working right under CP/M 3. It only partially clears + the disk sectors of the directory area. The extent of this issue has + not been evaluated, but it is not a RomWBW issue. ## Simeon Cran’s ZPM3 @@ -868,12 +782,22 @@ ZCPR 3. Essentially, it has the features of and compatibility with both. Like CP/M 3, to make ZPM3 boot disk, you put CPMLDR.SYS on the system tracks of the disk. +### Errata + + - CLRDIR is not working right under ZPM3. It only partially clears the + disk sectors of the directory area. The extent of this issue has not + been evaluated, but it is not a RomWBW issue. + - ZPMLDR is included with ZPM3, but it is not working correctly. + - The ZPM operatins system is contained in the file called CPM3.SYS + which is confusing, but it is the author’s intended way of using + ZPM3. + ## FreeRTOS -Note that Phillip Stevens has also ported FreeRTOS to run under RomWBW. -FreeRTOS is not provided in the RomWBW distribution. FreeRTOS is -available under the [MIT licence](https://www.freertos.org/a00114.html) -and further general information is available at +Phillip Stevens has ported FreeRTOS to run under RomWBW. FreeRTOS is not +provided in the RomWBW distribution. FreeRTOS is available under the +[MIT licence](https://www.freertos.org/a00114.html) and further general +information is available at [FreeRTOS](https://www.freertos.org/RTOS.html). You can also contact Phillip for detailed information on the Z180 @@ -1064,6 +988,123 @@ Please refer to the [UNA BIOS Firmware Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:una:start) for more information on UNA. +# Upgrading + +Upgrading to a newer release of RomWBW is essentially just a matter of +updating the ROM chip in your system. If you have spare ROM chips for +your system and a ROM programmer, it is always safest to retain your +existing, working ROM chip and program a new one with the new firmware. +If the new one fails to boot, you can easily return to the known working +ROM. + +Prior to attempting to reprogram your actual ROM chip, you may wish to +“try” the upgrade. With RomWBW, you can upload a new system image +executable and load it from the command line. For each ROM image file +(.rom) in the Binary directory, you will also find a corresponding +application file (.com). For example, for SBC\_std.rom, there is also an +SBC\_std.com file. You can upload the .com file to your system using +XModem, then simply run the .com file. You will see your system go +through the normal startup process just like it was started from ROM. +However, your ROM has not been updated and the next time you boot your +system, it will revert to the system image contained in ROM. + +There are two restrictions to be aware of related to loading a system +image as a .com application. First, this is only supported under +Z-System and CP/M 2.2. You must boot into one of these OSes before +attempting to launch the .com file. Second, you may find that you are +unable to load the .com file because it is too large to fit in available +application RAM (TPA). Your only recourse in this situation is to build +a custom ROM with fewer features. + +If you do not have easy access to a ROM programmer, it is usually +possible to reprogram your system ROM using the FLASH utility from Will +Sowerbutts. This application, called FLASH.COM, can be found on the ROM +drive of any running system. In this case, you would need to transfer +the new ROM image (.rom) over to your system using XModem (or one of the +other mechanisms described in the Transferring Files section). The ROM +image is too large to fit on your RAM drive, so you will need to +transfer it to a larger storage drive. Once the ROM image is on your +system, you can use the FLASH application to update your ROM. The +following is a typical example of transferring ROM image using XModem +and flashing the chip in-situ. + + E>xm r rom.img + + XMODEM v12.5 - 07/13/86 + RBC, 28-Aug-2019 [WBW], ASCI + + Receiving: E0:ROM.IMG + 7312k available for uploads + File open - ready to receive + To cancel: Ctrl-X, pause, Ctrl-X + + Thanks for the upload + + E>flash write rom.img + FLASH4 by Will Sowerbutts version 1.2.3 + + Using RomWBW (v2.6+) bank switching. + Flash memory chip ID is 0xBFB7: 39F040 + Flash memory has 128 sectors of 4096 bytes, total 512KB + Write complete: Reprogrammed 2/128 sectors. + Verify (128 sectors) complete: OK! + +Obviously, there is some risk to this approach since any issues with the +programming or ROM image could result in a non-functional system. + +To confirm your ROM chip has been successfully updated, restart your +system and boot an operating system from ROM. Do not boot from a disk +device yet. Review the boot messages to see if any issues have occurred. + +Once you are satisfied that the ROM is working well, you will need to +update the system images and RomWBW custom applications on your disk +drives. The system images and custom applications are matched to the +RomWBW ROM firmware in use. If you attempt to boot a disk or run +applications that have not been updated to match the current ROM +firmware, you are likely to have odd problems. + +The simplest way to update your disk media is to just use your modern +computer to overwrite the entire media with the latest disk image of +your choice. This process is described below in the Disk Images section. +If you wish to update existing disk media in your system, you need to +perform the following steps. + +If the disk is bootable, you need to update the system tracks of the +disk. This is done using a SYSCOPY command such as `SYSCOPY +C:=B:ZSYS.SYS`. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M 2.2 +disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS. CPMLDR.SYS +is not provided on the ROM disk, so you will need to upload it from the +distribution. + +Finally, if you have copies of any of the RomWBW custom applications on +your hard disk, you need to update them with the latest copies. The +following applications are found on your ROM disk. Use COPY to copy them +over any older versions of the app on your disk: + + - ASSIGN.COM + - SYSCOPY.COM + - MODE.COM + - FDU.COM (was FDTST.COM) + - FORMAT.COM + - XM.COM + - FLASH.COM + - FDISK80.COM + - TALK.COM + - RTC.COM + - TIMER.COM + - INTTEST.COM + +For example: `B>COPY ASSIGN.COM C:` + +Some RomWBW custom applications are too large to fit on the ROM disk. If +you are using any of these you will need to transfer them to your system +and then update all copies. These applications are found in the +Binary\\Apps directory of the distribution and in all of the disk +images. + + - FAT.COM + - TUNE.COM + # RomWBW Distribution All source code and distributions are maintained on GitHub. Code diff --git a/ReadMe.txt b/ReadMe.txt index d0f9a7d7..121121bc 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -3,7 +3,7 @@ RomWBW Z80/Z180 System Software Version 2.9.2 Prerelease -Sunday 22 March 2020 +Wednesday 25 March 2020 Wayne Warthen wwarthen@gmail.com @@ -105,40 +105,41 @@ directory contains the pre-built ROM and disk images. The ROM image files all end in “.rom”. Based on the table below, carefully pick the appropriate ROM image for your hardware. - -------------------------------------------------------------------------- - Platform ROM Image File Baud Description - ---------- ---------------- -------- ------------------------------------- - SBC V1/V2 SBC_std.rom 38400 RetroBrew SBC v1 or v2 ECB Z80 + ------------------------------------------------------------------------- + Platform ROM Image File Baud Description + ---------- ----------------- -------- ----------------------------------- + SBC SBC_std.rom 38400 RetroBrew SBC v1 or v2 ECB Z80 - Zeta V1 ZETA_std.rom 38400 RetroBrew Zeta V1 Z80, ParPortProp - (optional) + Zeta V1 ZETA_std.rom 38400 RetroBrew Zeta V1 Z80, ParPortProp + (optional) - Zeta V2 ZETA2_std.rom 38400 RetroBrew Zeta V2 Z80, ParPortProp - (optional) + Zeta V2 ZETA2_std.rom 38400 RetroBrew Zeta V2 Z80, ParPortProp + (optional) - N8 N8_std.rom 38400 RetroBrew N8 Z180, date code >= 2312 + N8 N8_std.rom 38400 RetroBrew N8 Z180, date code >= + 2312 - Mark IV MK4_std.rom 38400 RetroBrew Mark IV ECB Z180 + Mark IV MK4_std.rom 38400 RetroBrew Mark IV ECB Z180 - RC2014 Z80 RCZ80_std.rom 115200 RC2014 w/ Z80 CPU, requires 512K - RAM/ROM module + RC Z80 RCZ80_std.rom 115200 RC2014 w/ Z80 CPU, requires 512K + RAM/ROM module - RC2014 RCZ180_ext.rom 115200 RC2014 w/ Z180 CPU & 512K banked - Z180* RAM/ROM module + RC Z180* RCZ180_ext.rom 115200 RC2014 w/ Z180 CPU & 512K banked + RAM/ROM module - RC2014 RCZ180_nat.rom 115200 RC2014 w/ Z180 CPU & 512K native - Z180* RAM/ROM module + RC Z180* RCZ180_nat.rom 115200 RC2014 w/ Z180 CPU & 512K native + RAM/ROM module - Easy Z80 EZZ80_std.rom 115200 Sergey Kiselev’s Easy Z80 + Easy Z80 EZZ80_std.rom 115200 Sergey Kiselev’s Easy Z80 - SC126 SCZ180_126.rom 115200 Stephen Cousin’s SC126 Z180 + SC126 SCZ180_126.rom 115200 Stephen Cousin’s SC126 Z180 - SC130 SCZ180_130.rom 115200 Stephen Cousin’s SC130 Z180 + SC130 SCZ180_130.rom 115200 Stephen Cousin’s SC130 Z180 - SC131 SCZ180_131.rom 115200 Stephen Cousin’s SC131 Z180 + SC131 SCZ180_131.rom 115200 Stephen Cousin’s SC131 Z180 - Dyno DYNO_std.rom 38400 Steve Garcia’s Z180 Dyno Computer - -------------------------------------------------------------------------- + Dyno DYNO_std.rom 38400 Steve Garcia’s Z180 Dyno Computer + ------------------------------------------------------------------------- *The RC2014 Z180 requires a separate RAM/ROM memory module. There are two types of these modules and you must pick the ROM for your type of @@ -178,118 +179,6 @@ disappear at the next power on (RAM is generally not persistent). Also note that attempts to save files to the ROM disk (B:) will fail because ROM is not writable. -Upgrading - -Upgrading to a newer release of RomWBW is essentially just a matter of -updating the ROM chip in your system. If you have spare ROM chips for -your system and a ROM programmer, it is always safest to retain your -existing, working ROM chip and program a new one with the new firmware. -If the new one fails to boot, you can easily return to the known working -ROM. - -Prior to attempting to reprogram your actual ROM chip, you may wish to -“try” the upgrade. With RomWBW, you can upload a new system image -executable and load it from the command line. For each ROM image file -(.rom) in the Binary directory, you will also find a corresponding -application file (.com). For example, for SBC_std.rom, there is also an -SBC_std.com file. You can upload the .com file to your system using -XModem, then simply run the .com file. You will see your system go -through the normal startup process just like it was started from ROM. -However, your ROM has not been updated and the next time you boot your -system, it will revert to the system image contained in ROM. You may -find that you are unable to load the .com file because it is too large -to fit in available application RAM (TPA). Unfortunately, in this case, -you will not be able to use the .com file mechanism to start your -system. - -If you do not have easy access to a ROM programmer, it is usually -possible to reprogram your system ROM using the FLASH utility from Will -Sowerbutts. This application, called FLASH.COM, can be found on the ROM -drive of any running system. In this case, you would need to transfer -the new ROM image (.rom) over to your system using XModem (or one of the -other mechanisms described in the Transferring Files section below). The -ROM image is too large to fit on your RAM drive, so you will need to -transfer it to a larger storage drive. Once the ROM image is on your -system, you can use the FLASH application to update your ROM. The -following is a typical example of transferring ROM image using XModem -and flashing the chip in-situ. - - E>xm r rom.img - - XMODEM v12.5 - 07/13/86 - RBC, 28-Aug-2019 [WBW], ASCI - - Receiving: E0:ROM.IMG - 7312k available for uploads - File open - ready to receive - To cancel: Ctrl-X, pause, Ctrl-X - - Thanks for the upload - - E>flash write rom.img - FLASH4 by Will Sowerbutts version 1.2.3 - - Using RomWBW (v2.6+) bank switching. - Flash memory chip ID is 0xBFB7: 39F040 - Flash memory has 128 sectors of 4096 bytes, total 512KB - Write complete: Reprogrammed 2/128 sectors. - Verify (128 sectors) complete: OK! - -Obviously, there is some risk to this approach since any issues with the -programming or ROM image could result in a non-functional system. - -To confirm your ROM chip has been successfully updated, restart your -system and boot an operating system from ROM. Do not boot from a disk -device yet. Review the boot messages to see if any issues have occurred. - -Once you are satisfied that the ROM is working well, you will need to -update the system images and RomWBW custom applications on your disk -drives. The system images and custom applications are matched to the -RomWBW ROM firmware in use. If you attempt to boot a disk or run -applications that have not been updated to match the current ROM -firmware, you are likely to have odd problems. - -The simplest way to update your disk media is to just use your modern -computer to overwrite the entire media with the latest disk image of -your choice. This process is described below in the Disk Images section. -If you wish to update existing disk media in your system, you need to -perform the following steps. - -If the disk is bootable, you need to update the system tracks of the -disk.This is done using a SYSCOPY command such as SYSCOPY C:=B:ZSYS.SYS. -For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M 2.2 disk, use CPM.SYS. -For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS. CPMLDR.SYS is not provided on -the ROM disk, so you would need to upload it from the distribution. - -Finally, if you have copies of any of the RomWBW custom applications on -your hard disk, you need to update them with the latest copies. The -following applications are found on your ROM disk. Use COPY to copy them -over any older versions of the app on your disk: - -- ASSIGN.COM -- SYSCOPY.COM -- MODE.COM -- FDU.COM (was FDTST.COM) -- OSLDR.COM -- FORMAT.COM -- XM.COM -- FLASH.COM -- FDISK80.COM -- TALK.COM -- RTC.COM -- TIMER.COM -- INTTEST.COM - -For example: B>COPY ASSIGN.COM C: - -Some RomWBW custom applications are too large to fit on the ROM disk. If -you are using any of these you will need to transfer them to your system -and then update all copies. These applications are found in the -Binary\Apps directory of the distribution and in all of the disk images. - -- FAT.COM -- TUNE.COM - General Usage Each of the operating systems and ROM applications included with RomWBW @@ -495,38 +384,38 @@ the OS variants included with RomWBW. The following custom applications are found on the ROM disk and are, therefore, globally available. - -------------------------------------------------------------------------- + ----------------------------------------------------------------------------- Application Description - ------------- ------------------------------------------------------------ - ASSIGN Add, change, and delete drive letter assignments. Use ASSIGN - /? for usage instructions. + ------------- --------------------------------------------------------------- + ASSIGN Add, change, and delete drive letter assignments. Use ASSIGN /? + for usage instructions. - SYSCOPY Copy system image to a device to make it bootable. Use - SYSCOPY with no parms for usage instructions. + SYSCOPY Copy system image to a device to make it bootable. Use SYSCOPY + with no parms for usage instructions. - FDU Format and test floppy disks. Menu driven interface. + MODE Reconfigures serial ports dynamically. - OSLDR Load a new OS on the fly. For example, you can switch to - Z-System when running CP/M. Use OSLDR with no parms for - usage instructions. + FDU Format and test floppy disks. Menu driven interface. FORMAT Will someday be a command line tool to format floppy disks. Currently does nothing! - MODE Reconfigures serial ports dynamically. + XM XModem file transfer program adapted to hardware. Automatically + uses primary serial port on system. - XM XModem file transfer program adapted to hardware. - Automatically uses primary serial port on system. + FLASH Will Sowerbutts’ in-situ ROM programming utility. FDISK80 John Coffman’s Z80 hard disk partitioning tool. See documentation in Doc directory. - FAT Access MS-DOS FAT filesystems from RomWBW (based on FatFs). + TALK Direct console I/O to a specified character device. - FLASH Will Sowerbutts’ in-situ ROM programming utility. + RTC Manage and test the Real Time Clock hardware. - CLRDIR Initialize the directory area of a CP/M disk (Max Scane). - -------------------------------------------------------------------------- + TIMER Display value of running periodic system timer. + + INTTEST Test interrupt vector hooking. + ----------------------------------------------------------------------------- Some custom applications do not fit on the ROM disk. They are found on the disk image files or the individual files can be found in the @@ -537,8 +426,8 @@ Binary\Apps directory of the distribution. TUNE Play .PT2, .PT3, .MYM audio files. FAT Access MS-DOS FAT filesystems from RomWBW (based on FatFs). -There is additional documentation on some of these applications at the -RomWBW Applications Page. +Additional documentation on all of these applications can be found in +“RomWBW Applications.pdf” in the Doc directory of the distribution. Using Disks @@ -846,6 +735,16 @@ usage (“CPM Manual.pdf”). If you are new to the CP/M world, I would recommend using this CP/M variant to start with simply because it is the most stable and you are less likely to encounter problems. +Errata + +- The original versions of DDT, DDTZ, and ZSID used the RST 38 vector + which conflicts with interrupt mode 1 use of this vector. The DDT, + DDTZ, and ZSID applications in RomWBW have been modified to use RTS + 30 to avoid this issue. + +- Z-System applications will not run under CP/M 2.2. For example, the + LDDS date stamper with not run. + ZSDOS 1.1 ZSDOS is the most popular non-DRI CP/M “clone” which is generally @@ -858,6 +757,13 @@ Z-System Notes. Additionally, the official documentation for Z-System is included in the RomWBW distribution Doc directory (“ZSDOS Manual.pdf” and “ZCPR Manual.pdf”). +Errata + +- Although most CP/M 2.2 applications will run under Z-System, some + may not work as expected. The best example is PIP which is not aware + of the ZSDOS paths and will fail in some scenarios (use COPY + instead). + NZCOM Automatic Z-System NZCOM is a much further refined version of Z-System (ZCPR 3.4). NZCOM @@ -868,11 +774,16 @@ On the RomWBW NZCOM disk images, the boot OS is ZSDOS 1.1. After you configure NZCOM, you can add a PROFILE.SUB file to automatically launch NZCOM at boot. -To use, NZCOM, you must run through a simple configuration process. This -is well documented in the NZCOM manual in the “NZCOM Users Manual.pdf” -file in the RomWBW Doc directory. Additionally, there are instructions -for automatically launching NZCOM when the disk is booted under the host -OS via an auto command submission process. +NZCOM is not pre-configured. You must run through a simple configuration +process before loading it. Run MKZCM to do this. + +NZCOM has substantially more functionality than CP/M or basic Z-System. +It is important to read the the “NZCOM Users Manual.pdf” file in the +RomWBW Doc directory. + +Errata + +- There is no DIR command, you must use SDZ instead. Digital Research CP/M 3 @@ -884,7 +795,13 @@ support tools and help system. Note that to make a CP/M 3 boot disk, you actually place CPMLDR.SYS on the system tracks of the disk. You do not place CPM3.SYS on the system -tracks. +tracks. CPMLDR.SYS chain loads CPM3.SYS. + +Errata + +- CLRDIR is not working right under CP/M 3. It only partially clears + the disk sectors of the directory area. The extent of this issue has + not been evaluated, but it is not a RomWBW issue. Simeon Cran’s ZPM3 @@ -894,12 +811,21 @@ ZCPR 3. Essentially, it has the features of and compatibility with both. Like CP/M 3, to make ZPM3 boot disk, you put CPMLDR.SYS on the system tracks of the disk. +Errata + +- CLRDIR is not working right under ZPM3. It only partially clears the + disk sectors of the directory area. The extent of this issue has not + been evaluated, but it is not a RomWBW issue. +- ZPMLDR is included with ZPM3, but it is not working correctly. +- The ZPM operatins system is contained in the file called CPM3.SYS + which is confusing, but it is the author’s intended way of using + ZPM3. + FreeRTOS -Note that Phillip Stevens has also ported FreeRTOS to run under RomWBW. -FreeRTOS is not provided in the RomWBW distribution. FreeRTOS is -available under the MIT licence and further general information is -available at FreeRTOS. +Phillip Stevens has ported FreeRTOS to run under RomWBW. FreeRTOS is not +provided in the RomWBW distribution. FreeRTOS is available under the MIT +licence and further general information is available at FreeRTOS. You can also contact Phillip for detailed information on the Z180 implementation of FreeRTOS for RomWBW. @@ -1087,6 +1013,122 @@ support for VGA3 as soon as it reaches production status. Please refer to the UNA BIOS Firmware Page for more information on UNA. +Upgrading + +Upgrading to a newer release of RomWBW is essentially just a matter of +updating the ROM chip in your system. If you have spare ROM chips for +your system and a ROM programmer, it is always safest to retain your +existing, working ROM chip and program a new one with the new firmware. +If the new one fails to boot, you can easily return to the known working +ROM. + +Prior to attempting to reprogram your actual ROM chip, you may wish to +“try” the upgrade. With RomWBW, you can upload a new system image +executable and load it from the command line. For each ROM image file +(.rom) in the Binary directory, you will also find a corresponding +application file (.com). For example, for SBC_std.rom, there is also an +SBC_std.com file. You can upload the .com file to your system using +XModem, then simply run the .com file. You will see your system go +through the normal startup process just like it was started from ROM. +However, your ROM has not been updated and the next time you boot your +system, it will revert to the system image contained in ROM. + +There are two restrictions to be aware of related to loading a system +image as a .com application. First, this is only supported under +Z-System and CP/M 2.2. You must boot into one of these OSes before +attempting to launch the .com file. Second, you may find that you are +unable to load the .com file because it is too large to fit in available +application RAM (TPA). Your only recourse in this situation is to build +a custom ROM with fewer features. + +If you do not have easy access to a ROM programmer, it is usually +possible to reprogram your system ROM using the FLASH utility from Will +Sowerbutts. This application, called FLASH.COM, can be found on the ROM +drive of any running system. In this case, you would need to transfer +the new ROM image (.rom) over to your system using XModem (or one of the +other mechanisms described in the Transferring Files section). The ROM +image is too large to fit on your RAM drive, so you will need to +transfer it to a larger storage drive. Once the ROM image is on your +system, you can use the FLASH application to update your ROM. The +following is a typical example of transferring ROM image using XModem +and flashing the chip in-situ. + + E>xm r rom.img + + XMODEM v12.5 - 07/13/86 + RBC, 28-Aug-2019 [WBW], ASCI + + Receiving: E0:ROM.IMG + 7312k available for uploads + File open - ready to receive + To cancel: Ctrl-X, pause, Ctrl-X + + Thanks for the upload + + E>flash write rom.img + FLASH4 by Will Sowerbutts version 1.2.3 + + Using RomWBW (v2.6+) bank switching. + Flash memory chip ID is 0xBFB7: 39F040 + Flash memory has 128 sectors of 4096 bytes, total 512KB + Write complete: Reprogrammed 2/128 sectors. + Verify (128 sectors) complete: OK! + +Obviously, there is some risk to this approach since any issues with the +programming or ROM image could result in a non-functional system. + +To confirm your ROM chip has been successfully updated, restart your +system and boot an operating system from ROM. Do not boot from a disk +device yet. Review the boot messages to see if any issues have occurred. + +Once you are satisfied that the ROM is working well, you will need to +update the system images and RomWBW custom applications on your disk +drives. The system images and custom applications are matched to the +RomWBW ROM firmware in use. If you attempt to boot a disk or run +applications that have not been updated to match the current ROM +firmware, you are likely to have odd problems. + +The simplest way to update your disk media is to just use your modern +computer to overwrite the entire media with the latest disk image of +your choice. This process is described below in the Disk Images section. +If you wish to update existing disk media in your system, you need to +perform the following steps. + +If the disk is bootable, you need to update the system tracks of the +disk. This is done using a SYSCOPY command such as +SYSCOPY C:=B:ZSYS.SYS. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M +2.2 disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS. +CPMLDR.SYS is not provided on the ROM disk, so you will need to upload +it from the distribution. + +Finally, if you have copies of any of the RomWBW custom applications on +your hard disk, you need to update them with the latest copies. The +following applications are found on your ROM disk. Use COPY to copy them +over any older versions of the app on your disk: + +- ASSIGN.COM +- SYSCOPY.COM +- MODE.COM +- FDU.COM (was FDTST.COM) +- FORMAT.COM +- XM.COM +- FLASH.COM +- FDISK80.COM +- TALK.COM +- RTC.COM +- TIMER.COM +- INTTEST.COM + +For example: B>COPY ASSIGN.COM C: + +Some RomWBW custom applications are too large to fit on the ROM disk. If +you are using any of these you will need to transfer them to your system +and then update all copies. These applications are found in the +Binary\Apps directory of the distribution and in all of the disk images. + +- FAT.COM +- TUNE.COM + RomWBW Distribution All source code and distributions are maintained on GitHub. Code diff --git a/Source/Apps/Build.cmd b/Source/Apps/Build.cmd index f3d58557..794aee0d 100644 --- a/Source/Apps/Build.cmd +++ b/Source/Apps/Build.cmd @@ -16,7 +16,6 @@ call :asm SysCopy || goto :eof call :asm Assign || goto :eof call :asm Format || goto :eof call :asm Talk || goto :eof -call :asm OSLdr || goto :eof call :asm Mode || goto :eof call :asm RTC || goto :eof call :asm Timer || goto :eof diff --git a/Source/Apps/Makefile b/Source/Apps/Makefile index bc549c46..49db6949 100644 --- a/Source/Apps/Makefile +++ b/Source/Apps/Makefile @@ -1,5 +1,5 @@ OBJECTS = SysGen.com Survey.com \ - SysCopy.com Assign.com Format.com Talk.com OSLdr.com Mode.com RTC.com \ + SysCopy.com Assign.com Format.com Talk.com Mode.com RTC.com \ Timer.com IntTest.com OTHERS = *.hex *.com SUBDIRS = XM FDU FAT Tune diff --git a/Source/Apps/OSLdr.asm b/Source/Apps/OSLdr.asm deleted file mode 100644 index 15037790..00000000 --- a/Source/Apps/OSLdr.asm +++ /dev/null @@ -1,1017 +0,0 @@ -;=============================================================================== -; OSLdr - Load a new OS image from filesystem on running system. -; Optionally, load a new HBIOS image at the same time. -;=============================================================================== -; -; Author: Wayne Warthen (wwarthen@gmail.com) -;_______________________________________________________________________________ -; -; Usage: -; OSLDR /F [] -; /F (force) overrides all compatibility checking -; ex. OSLDR CPM.SYS -; OSLDR CPM.SYS HBIOS.BIO -; -; is an os image file such as cpm.sys or zsys.sys -; is an optional bios image such as hbios.bio -;_______________________________________________________________________________ -; -; Operation: -; This application reads an OS image (and optionally HBIOS image) -; into TPA memory from the filesystem. It then copies the images to -; their appropriate locations and restarts the system. -; Note that the application itself is relocated to upper memory -; after starting so that it can manipulate the lower memory bank. -; -; The application uses the following memory layout: -; -; Loc Size Usage -; ----- ----- ----------------------------- -; $0400-$3FFF $3C00 OS Image (max of 15K possible) -; $4000-$BFFF $8000 HBIOS Image (32K fixed size) -; $C000-$CFFF $1000 Application (after relocation) -; -; Notes: -; 1) Drive assignments are not retained. Drive assignments are -; reset during the OS boot. -; 2) The OS boot drive is not explicitly set by this app. If a new -; HBIOS image is not loaded, the boot drive passed to the OS will -; be the same as it was at the last boot. If a new HBIOS image -; is being loaded, the boot drive will be the default imbedded in -; the HBIOS image. -; 3) It is not possible to load a new UNA BIOS. However, when the -; app is run under UNA, it can load a new OS image and optionally -; load an HBIOS image. -;_______________________________________________________________________________ -; -; Change Log: -;_______________________________________________________________________________ -; -; ToDo: -;_______________________________________________________________________________ -; -; Known Issues: -; 1) App will fail badly if OS image exceeds 15K -; 2) No attempt is made to match the BIOS image version against -; the running BIOS version. This is intended behavior and is -; to allow a different BIOS version to be tested. A failure -; could occur if the BIOS image does not conform to the -; expected structure (size, meta data location, entry point -; location, etc.) -; 3) Hardware platform has been removed from the bootloader, so the -; platform check has been removed for OS loading. This is fine -; unless you attempt to switch between UNA and RomWBW. -;_______________________________________________________________________________ -; -;=============================================================================== -; Definitions -;=============================================================================== -; -stksiz .equ $40 ; we are a stack pig -; -restart .equ $0000 ; CP/M restart vector -bdos .equ $0005 ; BDOS invocation vector -; -; Memory layout (see Operation description above) -; -osimg .equ $0400 ; OS image load location (max 15K) -hbimg .equ $4000 ; HBIOS image load location (32K fixed) -runloc .equ $C000 ; running location (after relocation) -; -; Below are offsets in OS image of specific data fields -; The first 1.5K of the OS image is a header -; -hdrsiz .equ $600 ; Len of OS image header (3 sectors) -ossig .equ osimg + $580 ; Signature ($A55A) -osplt .equ osimg + $582 ; Platform ID -osver .equ osimg + $5E3 ; Version (4 bytes, maj, min, up, pat) -osloc .equ osimg + $5FA ; Intended address to load OS image -osend .equ osimg + $5FC ; Ending load address of OS image -osent .equ osimg + $5FE ; Entry point for OS image -osbin .equ osimg + hdrsiz ; Start of actual OS binary (after header) -; -; HBIOS internal info (adjust if HBIOS changes) -; -bfgbnk .equ $F3 ; HBIOS Get Bank function -bfver .equ $F1 ; HBIOS Get Version function -sigptr .equ hbimg + 3 ; HBIOS signature pointer -hbmrk .equ hbimg + $100 ; HBIOS marker -hbver .equ hbimg + $102 ; HBIOS version -hbplt .equ hbimg + $104 ; HBIOS platform -bidusr .equ hbimg + $10B ; User bank id -bidbios .equ hbimg + $10C ; BIOS bank id -pxyimg .equ hbimg + $200 ; Proxy image offset within HBIOS image -pxyloc .equ $FE00 ; Proxy run location -pxysiz .equ $0200 ; Proxy size -srcbnk .equ $FFE4 ; Address of bank copy source bank id -dstbnk .equ $FFE7 ; Address of bank copy destination bank id -curbnk .equ $FFE0 ; Address of current bank id in hbios proxy -hbxbnk .equ $FFF3 ; Bank select function entry address -hbxcpy .equ $FFF6 ; Bank copy function entry address -; -;=============================================================================== -; Code Section -;=============================================================================== -; - .org $100 ; startup org - - ; relocate ourselves to upper memory - ld hl,$0000 ; from startup location - ld de,runloc ; to running location - ld bc,$0800 ; assume we are no more that 2048 bytes - ldir ; copy ourselves - jp phase2 ; jump to new location - - .org $ + runloc ; adjust for phase 2 location -phase2: - ; setup stack (save old value) - ld (stksav),sp ; save stack - ld sp,stack ; set new stack - - ; processing... - call main ; do the real work - call crlf ; formatting - - ; return (we only get here if an error occurs) - jp 0 ; return to CP/M via reset -; -; Main routine -; -main: - call init ; initialize - ret nz ; abort on failure - - call parse ; parse command tail - ret nz ; abort on failure - -; call confirm ; confirm pending action -; ret nz ; abort on failure - - call crlf2 ; formatting - - ; Read OS image into TPA - call rdos ; do the os read - ret nz ; abort on failure - - ; If specified, read BIOS image - ld a,(newbio) ; get BIOS load flag - or a ; set flags - call nz,rdbio ; do the bios read - ret nz ; abort on failure - - call crlf ; formatting - - ; If force flag set, bypass image validitity checking - ld a,(force) ; load the flag - or a ; set flags - jr nz,main1 ; if set, bypass checks - - ; Check BIOS Image is acceptable - ld a,(newbio) ; get BIOS load flag - or a ; set flags - call nz,chkbios ; check the bios image - ret nz ; abort on failure - - ; Check OS Image is acceptable for requested operation - call chkos ; check the os image - ret nz ; abort on failure - -main1: - ; Load OS image into upper memory OS location - call ldos ; load OS - ret nz ; abort on failure - - ; If specified, load BIOS image to BIOS bank - ld a,(newbio) ; get BIOS load flag - or a ; set flags - jr z,main3 ; if not set, skip BIOS load and init - call ldbio ; load BIOS - ret nz ; abort on failure - - ; Initialize BIOS - call initbio ; initialize BIOS - -main3: - ; Launch... - ld hl,(osent) ; OS entry point - jp (hl) ; jump to OS BOOT vector -; -; Initialization -; -init: - call crlf - ld de,msgban ; point to banner - call prtstr ; display it - - ; locate cbios function table address - ld hl,(restart+1) ; load address of CP/M restart vector - ld de,-3 ; adjustment for start of table - add hl,de ; HL now has start of table - ld (cbftbl),hl ; save it - - ; save current drive no - ld c,$19 ; bdos func: get current drive - call bdos ; invoke BDOS function - inc a ; 1-based index for fcb - ld (defdrv),a ; save it - - ; check for UNA (UBIOS) - ld de,msghb ; assume HBIOS (point to HBIOS mode string) - ld a,($fffd) ; fixed location of UNA API vector - cp $c3 ; jp instruction? - jr nz,init1 ; 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,init1 ; 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,init1 ; if not, not UNA - ld hl,unamod ; point to UNA mode flag - ld (hl),$ff ; set UNA mode - ld a,6 ; UNA platform ID - ld (bioplt),a ; save it - ld de,msgub ; point to UBIOS string - -init1: - call prtstr ; print BIOS name - - ; if HBIOS active, get version number - ld a,(unamod) ; get UNA mode flag - or a ; set flags - jr nz,init2 ; skip if UNA BIOS active - ld b,bfver ; HBIOS func: get version - rst 08 ; do it - ld a,l ; platform to A - ld (bioplt),a ; save platform - ld h,e ; switch bytes - ld l,d ; ... to save as maj/min, up/pat - ld (biover),hl ; save version - ld b,bfgbnk ; HBIOS func: get current bank - rst 08 ; do it - ld a,c ; move to A - ld (tpabnk),a ; save it - -init2: - ; return success - xor a - ret -; -; Parse command tail -; -parse: - ld hl,$81 ; point to start of command tail (after length byte) - call nonblank ; locate start of parms - jp z,erruse ; no parms - call options ; process options - ret nz ; abort if error - ld de,osfcb ; point to os image fcb - call convert ; convert destination spec - jp nz,erramb ; Error, ambiguous file specification - call nonblank ; skip blanks - or a ; end of command tail (null)? - jr z,parse1 ; if end, skip bios image fcb - ld de,biofcb ; point to bios image fcb - call convert ; convert spec to fcb - jp nz,erramb ; Error, ambiguous file specification - or $FF ; flag = true - ld (newbio),a ; set newbio flag to true -; -parse1: - ; return success - xor a ; signal success - ret ; done parsing -; -options: - ; process options - cp '/' ; option introducer? - jr nz,options2 ; if not '/' exit with success - inc hl ; bump past option introducer - ld a,(hl) ; get the next character - cp 'F' ; compare to 'F' - jr z,optf ; handle if so - jp erruse ; bail out if unexpected option - -options1: - ; post-processing after option - inc hl ; move past option - call nonblank ; skip blanks - jr options ; loop - -options2: - ; success exit - xor a ; signal success - ret - -optf: - ; set force flag - or $FF ; load true - ld (force),a ; set flag - jr options1 ; done -; -; Confirm pending action with user -; -confirm: -; ; prompt -; call crlf -; ld de,sconf1 -; call prtstr -; ld hl,biofcb -; call prtfcb -; ld de,sconf2 -; call prtstr -; ld hl,osfcb -; call prtfcb -; ld de,sconf3 -; call prtstr -;; -; ; get input -; ld c,$0A ; get console buffer -; ld de,osimg ; into buf -; ld a,1 ; max of 1 character -; ld (de),a ; set up buffer -; call bdos ; invoke BDOS -; ld a,(osimg+1) ; get num chars entered -; dec a ; check that we got exactly one char -; jr nz,confirm ; bad input, re-prompt -; ld a,(osimg+2) ; get the character -; and $DF ; force upper case -; cp 'Y' ; compare to Y - xor a ; *temp* - ret ; return with Z set appropriately -; -; Read OS image file into memory -; -rdos: - ld de,msgros ; point to "Reading OS" message - call prtstr ; display it - - ; open the file - ld c,$0F ; bdos open file - ld de,osfcb ; bios image fcb - ld (rwfcb),de ; save it - call bdos ; invoke bdos function - cp $FF ; $FF is error - jp z,errfil ; handle error condition - ; read the header - ld a,$14 ; setup for bdos read sequential - ld (rwfun),a ; save bdos function - ld a,12 ; start with 1536 byte header (12 records) - ld (reccnt),a ; init record counter - ld hl,osimg ; start of buffer - ld (bufptr),hl ; init buffer pointer - call rwfil ; read the header - ret nz ; abort on error (no need to close file) - ; check header and get image size - call chkhdr ; verifies marker, hl = image size - ret nz ; abort on error (no need to close file) - ld b,7 ; right shift 7 bits to get 128 byte record count -rdos1: srl h ; shift right msb - rr l ; shift lsb w/ carry from msb - djnz rdos1 ; loop till done - ld a,l ; record count to a - ld (reccnt),a ; set remaining records to read - add a,12 ; add the header back - ld (imgsiz),a ; and save the total image size (in records) - call rwfil ; do it - ret nz ; abort on error - ; return via close file - jp closefile ; close file -; -; -; -rdbio: - ld de,msgrbio ; point to "Reading BIOS" message - call prtstr ; display it - - ; open the file - ld c,$0F ; bdos open file - ld de,biofcb ; bios image fcb - ld (rwfcb),de ; save it - call bdos ; invoke bdos function - cp $FF ; $FF is error - jp z,errfil ; handle error condition - ; read 32K HBIOS image - ld a,$14 ; setup for bdos read sequential - ld (rwfun),a ; save bdos function - ld a,0 ; 0 means 256 records (32K) - ld (reccnt),a ; init record counter - ld hl,hbimg ; start of buffer - ld (bufptr),hl ; init buffer pointer - call rwfil ; read the header - ret nz ; abort on error (no need to close file) - ; return via close file - jp closefile ; close file -; -; Examine the BIOS image loaded. Confirm existence of expected -; BIOS identification marker in first page (fail if not there). -; Display the BIOS identification information. Confirm it is HBIOS -; and fail if not. Save the HBIOS version number. -; -chkbios: - ; locate ROM signature in image - ld hl,sigptr ; point to ROM signature adr - ld a,(hl) ; dereference - inc hl ; ... to point - ld h,(hl) ; ... to location - ld l,a ; ... of signature block - ld de,hbimg ; offset by start - add hl,de ; ... of BIOS image - - ; check signature - ld a,$76 ; first byte value - cp (hl) ; compare - jp nz,errsig ; if not equal, signature error - inc hl ; bump to next byte - ld a,$B5 ; second byte value - cp (hl) ; compare - jp nz,errsig ; if not equal, signature error - inc hl ; bump to next byte - - ;; display short name - ;inc hl ; bump past structure version number - ;inc hl ; bump past rom size - ;ld e,(hl) ; load rom name - ;inc hl ; ... pointer - ;ld d,(hl) ; ... into DE - ;ld hl,hbimg ; offset by start - ;add hl,de ; ... of BIOS image - ;ex de,hl ; get pointer to DE - ;call crlf ; formatting - ;call prtstr ; and display it - - ; check BIOS variant, only HBIOS supported - ld hl,hbmrk ; get the HBIOS marker - ld a,'W' ; first byte should be 'W' - cp (hl) ; compare - jp nz,errbio ; if not equal, fail - inc hl ; next byte - ld a,~'W' ; ... should be ~'W' - cp (hl) ; compare - jp nz,errbio ; if not equal, fail - - ; if UNA is running, skip platform/ver stuff - ld a,(unamod) ; get UNA mode flag - or a ; set flags - jr nz,chkbios1 ; skip if UNA - - ; get and check platform (must match) - ld hl,hbplt ; point to BIOS platform id - ld a,(bioplt) ; get current running platform id - cp (hl) ; match? - jp nz,errplt ; if not, platform error - - ; get HBIOS image version - ld hl,(hbver) ; get version byte from image - ld (biover),hl ; save it for later - -chkbios1: - xor a - ret -; -; Examine the OS image loaded. Confirm existence of expected -; OS identification marker (fail if not there). Check the version -; number in the OS image header. Fail if OS image version does -; not match BIOS version. -; -chkos: - ; check for signature - ; Already verified in chkhdr - - ;; compare platform id - ;ld a,(bioplt) ; get current HBIOS platform ID - ;ld hl,osplt ; point to OS image platform ID - ;cp (hl) ; compare - ;jp nz,errplt ; if not equal platform error - - ; bypass version check if UNA running - ld a,(unamod) ; get UNA mode flag - or a ; set flags - jr nz,chkos1 ; if UNA, bypass - - ; compare version - ld a,(osver) ; get first OS version byte (major) - rlca ; move low nibble - rlca ; ... - rlca ; ... - rlca ; ... to high nibble - ld b,a ; save in b - ld a,(osver + 1) ; get second OS version byte (minor) - or b ; combine with major nibble - ld hl,biover ; point to HBIOS version - cp (hl) ; compare - jp nz,errver ; if not equal, fail - -chkos1: - xor a ; signal success - ret -; -; Load OS image into correct destination -; -ldos: - ; compute the image size (does not include size of header) - ld hl,(osend) ; get CPM_END - ld de,(osloc) ; get CPM_LOC - or a ; clear CF - sbc hl,de ; image size := CPM_END - CPM_LOC - push hl ; move image size - pop bc ; ... to BC - ld hl,osbin ; copy from buf, skip header - ld de,(osloc) ; OS location - ldir ; do the copy - xor a - ret -; -; Load BIOS into correct destination -; -ldbio: -; - ; copy the proxy to upper memory - ld hl,pxyimg ; location of proxy image - ld de,pxyloc ; target location of proxy - ld bc,pxysiz ; size of proxy - ldir ; copy it - ld a,(tpabnk) ; get active tpa bank id - ld (curbnk),a ; fixup the proxy -; - ; copy image to bios bank - ld a,(curbnk) ; load from current bank - ld (srcbnk),a ; set source bank - ld a,(bidbios) ; copy to bios bank - ld (dstbnk),a ; set destination bank - ld hl,hbimg ; set source address - ld de,0 ; set destination address - ld bc,$8000 ; set length - ld a,(curbnk) ; return to current bank - call hbxcpy ; to the inter-bank copy -; - xor a ; signal success - ret -; -; -; -initbio: -; - ; initialize HBIOS - ld a,(bidbios) ; get bios bank - call hbxbnk ; ... and activate it - call $0000 ; call bios init entry point - ld a,(tpabnk) ; get active tpa bank id - call hbxbnk ; ... and activate it -; - xor a - ret -; -; Common routine to handle read/write for file system -; -rwfil: - ld c,$1A ; BDOS set dma - ld de,(bufptr) ; current buffer pointer - push de ; save pointer - call bdos ; do it - pop de ; recover pointer - ld hl,128 ; record length - add hl,de ; increment buffer pointer - ld (bufptr),hl ; save it - ld a,(rwfun) ; get the active function - ld c,a ; set it - ld de,(rwfcb) ; active fcb - call bdos ; do it - or a ; check return code - jp nz,errdos ; BDOS err -; call prtdot ; mark progress - ld hl,reccnt ; point to record count - dec (hl) ; decrement record count - jr nz,rwfil ; loop till done - xor a ; signal success - ret ; done -; -; Close file -; -closefile: - ld c,$10 ; BDOS close file - ld de,(rwfcb) ; active fcb - call bdos ; do it - cp $FF ; $FF is error - jp z,errclo ; if error, handle it - xor a ; signal success - ret ; done -; -jphl: jp (hl) ; indirect jump -; -; Verify system image header in osimg by checking the expected signature. -; Compute and return image size (based on header values) in HL. Size -; does not include header. NZ set if signature error. -; -chkhdr: - ; check signature - ld hl,(ossig) ; get signature - ld de,$A55A ; signature value - or a ; clear CF - sbc hl,de ; compare - jp nz,errsig ; invalid signature - ; compute the image size (does not include size of header) - ld hl,(osend) ; get CPM_END - ld de,(osloc) ; get CPM_LOC - or a ; clear CF - sbc hl,de ; image size := CPM_END - CPM_LOC - xor a ; signal success - ret ; done -; -; Convert a filename at (HL) into an FCB at (DE). -; Includes wildcard expansion. -; On return, A=0 if unambiguous name specified, and -; (HL) points to character following filename spec -; -convert: - push de ; put fcb address on stack - ex de,hl - ld a,(de) ; get first character. - or a - jp z,convrt1 - sbc a,'A'-1 ; might be a drive name, convert to binary. - ld b,a ; and save. - inc de ; check next character for a ':'. - ld a,(de) - cp ':' - jp z,convrt2 - dec de ; nope, move pointer back to the start of the line. -convrt1: - ld a,(defdrv) - ld (hl),a - jp convrt3 -convrt2: - ld a,b - ld (hl),b - inc de - ; Convert the base file name. -convrt3:ld b,08h -convrt4:ld a,(de) - call delim - jp z,convrt8 - inc hl - cp '*' ; note that an '*' will fill the remaining - jp nz,convrt5 ; field with '?' - ld (hl),'?' - jp convrt6 -convrt5:ld (hl),a - inc de -convrt6:dec b - jp nz,convrt4 -convrt7:ld a,(de) - call delim ; get next delimiter - jp z,getext - inc de - jp convrt7 -convrt8:inc hl ; blank fill the file name - ld (hl),' ' - dec b - jp nz,convrt8 -getext: ld b,03h - cp '.' - jp nz,getext5 - inc de -getext1:ld a,(de) - call delim - jp z,getext5 - inc hl - cp '*' - jp nz,getext2 - ld (hl),'?' - jp getext3 -getext2:ld (hl),a - inc de -getext3:dec b - jp nz,getext1 -getext4:ld a,(de) - call delim - jp z,getext6 - inc de - jp getext4 -getext5:inc hl - ld (hl),' ' - dec b - jp nz,getext5 -getext6:ld b,3 -getext7:inc hl - ld (hl),0 - dec b - jp nz,getext7 - pop hl ; HL := start of FCB - push de ; save input line pointer - ; Check to see if this is an ambiguous file name specification. - ; Set the A register to non-zero if it is. - ld bc,11 ; set name length. -getext8:inc hl - ld a,(hl) - cp '?' ; any question marks? - jp nz,getext9 - inc b ; count them. -getext9:dec c - jp nz,getext8 - ld a,b - or a - pop hl ; return with updated input pointer - ret -; -; Print formatted FCB at (HL) -; -prtfcb: - push hl ; save HL - call chkfcb ; set flags indicating nature of FCB - pop hl ; restore HL - ret z ; nothing to print - push af ; save FCB flags - ld a,(hl) ; get first byte of FCB (drive) - inc hl ; point to next char - or a ; is drive specified (non-zero)? - jr z,prtfcb1 ; if zero, do not print drive letter - add a,'@' ; adjust drive number to alpha - call prtchr ; print it - ld a,':' - call prtchr ; print drive separator -prtfcb1: - pop af ; restore FCB flags - bit 1,a ; bit 1 set if filename specified - ret z ; return if no filename - ld b,8 ; base is 8 characters - call prtfcb2 ; print them - ld a,'.' - call prtchr ; print file extension separator - ld b,3 ; extension is 3 characters -prtfcb2: - ld a,(hl) ; load the next character - inc hl ; point to next character - cp ' ' ; check for blank - call nz,prtchr ; print char if it is not a blank - djnz prtfcb2 ; loop till done - ret ; return -; -; Check FCB to see if a drive and/or filename is specified. -; Set bit 0 for drive and bit 1 for filename in A -; -chkfcb: - ld c,0 ; use C for flags, start with none - ld a,(hl) ; get drive - or a ; anything there? - jr z,chkfcb1 ; skip if nothing there - set 0,c ; set bit zero to indicate a drive spec -chkfcb1: - ld b,11 ; set up to check 11 bytes (base & ext) -chkfcb2: - inc hl ; bump to next byte - ld a,(hl) ; get next - cp 'A' ; blank means empty byte - jr nc,chkfcb3 ; if not blank, we have a filename - djnz chkfcb2 ; loop - jr chkfcb4 ; nothing there -chkfcb3: - set 1,c ; set bit 1 to indicate a file spec -chkfcb4: - ld a,c ; put result in a - or a ; set flags - ret -; -; Print character in A without destroying any registers -; -prtchr: - 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 - ret -; -prtdot: - push af - ld a,'.' - call prtchr - pop af - ret -; -; Print a zero terminated string at (DE) without destroying any registers -; -prtstr: - 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 - ret -; -; Print the value in A in hex without destroying any registers -; -prthex: - push af ; save AF - push de ; save DE - call hexascii ; convert value in A to hex chars in DE - ld a,d ; get the high order hex char - call prtchr ; print it - ld a,e ; get the low order hex char - call prtchr ; print it - pop de ; restore DE - pop af ; restore AF - ret ; done -; -; Convert binary value in A to ascii hex characters in DE -; -hexascii: - ld d,a ; save A in D - call hexconv ; convert low nibble of A to hex - ld e,a ; save it in E - ld a,d ; get original value back - rlca ; rotate high order nibble to low bits - rlca - rlca - rlca - call hexconv ; convert nibble - ld d,a ; save it in D - ret ; done -; -; Convert low nibble of A to ascii hex -; -hexconv: - and $0F ; low nibble only - add a,$90 - daa - adc a,$40 - daa - ret -; -; Start a new line (or 2) -; -crlf2: - call crlf ; double new line entry -crlf: - ld a,13 ; - call prtchr ; print it - ld a,10 ; - jr prtchr ; print it -; -; Get the next non-blank character from (HL). -; -nonblank: - ld a,(hl) ; 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 hl ; if blank, increment character pointer - jr nonblank ; and loop -; -; Check character at (DE) for delimiter. -; -delim: or a - ret z - cp ' ' ; blank - ret z - jr c,delim1 ; handle control characters - cp '=' ; equal - ret z - cp '_' ; underscore - ret z - cp '.' ; period - ret z - cp ':' ; colon - ret z - cp $3b ; semicolon - ret z - cp '<' ; less than - ret z - cp '>' ; greater than - ret -delim1: - ; treat control chars as delimiters - xor a ; set Z - ret ; return -; -; Invoke CBIOS function -; The CBIOS function offset must be stored in the byte -; following the call instruction. ex: -; call cbios -; .db $0C ; offset of CONOUT CBIOS function -; -cbios: - ex (sp),hl - ld a,(hl) ; get the function offset - inc hl ; point past value following call instruction - ex (sp),hl ; put address back at top of stack and recover HL - ld hl,(cbftbl) ; address of CBIOS function table to HL - call addhl ; determine specific function address - jp (hl) ; invoke CBIOS -; -; Add the value in A to HL (HL := HL + A) -; -addhl: - add a,l ; A := A + L - ld l,a ; Put result back in L - ret nc ; if no carry, we are done - inc h ; if carry, increment H - ret ; and return -; -; Errors -; -erruse: ; command usage error (syntax) - ld de,msguse - jr err -erramb: ; ambiguous file spec (wild cards) is not allowed - ld de,msgamb - jr err -errdlm: ; invalid delimiter in command tail - ld de,msgdlm - jr err -errfil: ; source file not found - ld de,msgfil - jr err -errclo: ; file close error - ld de,msgclo - jr err -errsig: ; invalid system image signature error - ld de,msgsig - jr err -errbio: ; invalid BIOS image, not HBIOS - ld de,msgbio - jr err -errplt: ; platform mismatch - ld de,msgplt - jr err -errver: ; version mismatch - ld de,msgver - jr err -err: ; print error string and return error signal - call crlf2 ; print newline - call prtstr ; print error string - or $FF ; signal error - ret ; done -errdos: ; handle BDOS errors - push af ; save return code - call crlf2 ; newline - ld de,msgdos ; load - call prtstr ; and print error string - pop af ; recover return code - call prthex ; print error code - or $FF ; signal error - ret ; done -; -;=============================================================================== -; Storage Section -;=============================================================================== -; -defdrv .db 0 ; default drive for FCB -cbftbl .dw 0 ; address of CBIOS function table -imgsiz .db 0 ; image size (count of 128 byte records) -; -osfcb .fill 36,0 ; os image FCB -biofcb .fill 36,0 ; bios image FCB -; -unamod .db 0 ; UNA move flag (non-zero if UNA running) -newbio .db 0 ; BIOS load flag (non-zero if new BIOS load) -force .db 0 ; force operation (bypass compatibility checks) -tpabnk .db 0 ; bank id of TPA when app starts -bioplt .db 0 ; Platform ID of running HBIOS -biover .dw 0 ; version of BIOS being loaded -; -stksav .dw 0 ; stack pointer saved at start - .fill stksiz,0 ; stack -stack .equ $ ; stack top -; -rwfun .db 0 ; active read/write function -rwfcb .dw 0 ; active read/write FCB -reccnt .db 0 ; active remaining records to read/write -bufptr .dw 0 ; active pointer into buffer -; -; Messages -; -msgban .db "OSLDR v1.2 for RomWBW, 20-Feb-2020",0 -msghb .db " (HBIOS Mode)",0 -msgub .db " (UBIOS Mode)",0 -msguse .db "Usage: OSLDR [/F] []\r\n" - .db " /F (force) overrides all compatibility checking",0 -msgamb .db "Ambiguous file specification not allowed",0 -msgdlm .db "Invalid delimiter",0 -msgfil .db "File not found",0 -msgclo .db "File close error",0 -msgsig .db "Obsolete or invalid BIOS image (BIOS signature)",0 -msgbio .db "Obsolete or invalid HBIOS image (HBIOS signature)",0 -msgplt .db "Platform (hardware) mismatch",0 -msgver .db "Version mismatch",0 -msgdos .db "DOS error, return code=0x",0 - -msgros .db "Reading OS... ",0 -msgrbio .db "Reading BIOS... ",0 -msglos .db "Loading OS... ",0 -msglbio .db "Loading BIOS... ",0 -; - .end diff --git a/Source/Apps/RTC.asm b/Source/Apps/RTC.asm index c6f7b645..07b5c447 100644 --- a/Source/Apps/RTC.asm +++ b/Source/Apps/RTC.asm @@ -1265,31 +1265,31 @@ RTC_UCL: RET Z CP 'H' - JR Z,RTC_TOP_LOOP_HELP + JP Z,RTC_TOP_LOOP_HELP CP 'D' - JR Z,RTC_TOP_LOOP_DELAY + JP Z,RTC_TOP_LOOP_DELAY CP 'B' - JR Z,RTC_TOP_LOOP_BOOT + JP Z,RTC_TOP_LOOP_BOOT CP 'C' - JR Z,RTC_TOP_LOOP_CHARGE + JP Z,RTC_TOP_LOOP_CHARGE CP 'N' - JR Z,RTC_TOP_LOOP_NOCHARGE + JP Z,RTC_TOP_LOOP_NOCHARGE CP 'A' - JR Z,RTC_TOP_LOOP_START + JP Z,RTC_TOP_LOOP_START CP 'S' JP Z,RTC_TOP_LOOP_SET CP 'I' - JR Z,RTC_TOP_LOOP_INIT + JP Z,RTC_TOP_LOOP_INIT CP 'T' - JR Z,RTC_TOP_LOOP_TIME + JP Z,RTC_TOP_LOOP_TIME LD DE,CRLF_MSG LD C,09H ; CP/M write string to console call @@ -1309,6 +1309,16 @@ RTC_TOP_LOOP_DELAY: JP RTC_TOP_LOOP_1 RTC_TOP_LOOP_BOOT: + LD DE,BOOTMSG ; BOOT message + LD C,9 ; BDOS string display function + CALL BDOS ; Do it + ; WAIT FOR MESSAGE TO BE DISPLAYED + LD HL,10000 +DELAY_LOOP: ; LOOP IS 26TS + DEC HL ; 6TS + LD A,H ; 4TS + OR L ; 4TS + JR NZ,DELAY_LOOP ; 12TS LD A,BID_BOOT ; BOOT BANK LD HL,0 ; ADDRESS ZERO CALL HB_BNKCALL ; DOES NOT RETURN @@ -1685,6 +1695,7 @@ PLTERR .TEXT "\r\n\r\nUnknown/unsupported hardware platform, aborting...\r\n$" UBERR .TEXT "\r\nUNA UBIOS is not currently supported, aborting...\r\n$" HBTAG .TEXT "RomWBW HBIOS$" UBTAG .TEXT "UNA UBIOS" +BOOTMSG .TEXT "\r\n\r\nRebooting...$" PLT_SBC .TEXT ", SBC/Zeta RTC Latch Port 0x70\r\n$" PLT_N8 .TEXT ", N8 RTC Latch Port 0x88\r\n$" PLT_MK4 .TEXT ", Mark 4 RTC Latch Port 0x8A\r\n$" diff --git a/Source/Apps/Tune/Tune.asm b/Source/Apps/Tune/Tune.asm index 2526fccf..14814b23 100644 --- a/Source/Apps/Tune/Tune.asm +++ b/Source/Apps/Tune/Tune.asm @@ -100,9 +100,19 @@ CFGSEL: LD A,(PLT) ; Get platform id of loaded config CP E ; Equal? JR NZ,CFGSEL ; If no match keep trying +; + ; Activate card if applicable + CALL SLOWIO ; Slow down I/O now + LD A,(ACR) ; Get ACR port address (if any) + INC A ; $FF -> $00 & set flags + JR Z,PROBE ; Skip ahead to probe if no ACR + DEC A ; Restore real ACR port address + LD C,A ; Put in C for I/O + LD A,$FF ; Value to activate card + OUT (C),A ; Write value to ACR ; +PROBE: ; Test for hardware (sound chip detection) - CALL SLOWIO LD DE,(PORTS) ; D := RDAT, E := RSEL LD C,E ; Port = RSEL LD A,2 ; Register 2 @@ -110,17 +120,16 @@ CFGSEL: LD C,D ; Port = RDAT LD A,$AA ; Value = $AA OUT (C),A ; Write $AA to register 2 - ;LD C,E ; Port = RSEL LD A,(RIN) ; Port = RIN LD C,A ; ... to C IN A,(C) ; Read back value in register 2 - PUSH AF - CALL NORMIO - POP AF - ;CALL PRTHEX ; *debug* CP $AA ; Value as written? - JR NZ,CFGSEL ; If not, keep trying configs + JR Z,MAT ; Hardware matched! + CALL NORMIO ; Back to normal I/O speeds + JR CFGSEL ; And keep trying ; +MAT: + ; Hardware matched! CALL CRLF ; Formatting LD DE,(DESC) ; Load hardware description pointer CALL PRTSTR ; Print description @@ -150,15 +159,6 @@ SETDLY: RR E ; ... for delay factor EX DE,HL ; Move result to HL LD (QDLY),HL ; Save result as quark delay factor -; - ; Activate SCG card if applicable - LD A,(ACR) - CP $FF - JR Z,NOSCG - LD C,A - LD A,$FF - OUT (C),A -NOSCG: ; ; Clear heap storage LD HL,HEAP ; Point to heap start @@ -766,7 +766,7 @@ FILTYP .DB 0 ; Sound file type (TYPPT2, TYPPT3, TYPMYM) TMP .DB 0 ; work around use of undocumented Z80 ; -MSGBAN .DB "Tune Player for RomWBW v2.3, 11-Feb-2020",0 +MSGBAN .DB "Tune Player for RomWBW v2.4, 23-Mar-2020",0 MSGUSE .DB "Copyright (C) 2020, Wayne Warthen, GNU GPL v3",13,10 .DB "PTxPlayer Copyright (C) 2004-2007 S.V.Bulba",13,10 .DB "MYMPlay by Marq/Lieves!Tuore",13,10,13,10 diff --git a/Source/CBIOS/cbios.asm b/Source/CBIOS/cbios.asm index 5482cbc1..a822887f 100644 --- a/Source/CBIOS/cbios.asm +++ b/Source/CBIOS/cbios.asm @@ -2277,7 +2277,7 @@ CLRRAM2: CLRRAM3: LD A,(BNKUSER) ; USR BANK (TPA) CALL HB_BNKSEL ; SELECT BANK - EI ; RESUME INTRRUPTS + EI ; RESUME INTERRUPTS #ENDIF ; #ENDIF diff --git a/Source/CPM22/loader.asm b/Source/CPM22/loader.asm index 72febbef..d60c0b16 100644 --- a/Source/CPM22/loader.asm +++ b/Source/CPM22/loader.asm @@ -31,17 +31,16 @@ SYS_ENT .EQU $E600 ; SYSTEM (OS) ENTRY POINT ADDRESS SYS_LOC .EQU $D000 ; STARTING ADDRESS TO LOAD SYSTEM IMAGE SYS_END .EQU $FE00 ; ENDING ADDRESS OF SYSTEM IMAGE ; -BYT .EQU 1 ; used to describe METADATA_SIZE below -WRD .EQU 2 +SEC_SIZE .EQU 512 ; DISK SECTOR SIZE +BLK_SIZE .EQU 128 ; OS BLOCK/RECORD SIZE ; -SECTOR_SIZE .EQU 512 -BLOCK_SIZE .EQU 128 -PREFIX_SIZE .EQU (3 * SECTOR_SIZE) ; 3 SECTORS -METADATA_SIZE .EQU BYT+WRD+(4*BYT)+16+BYT+WRD+WRD+WRD+WRD ; (as defined below) +PREFIX_SIZE .EQU (SEC_SIZE * 3) ; 3 SECTORS ; -PARTTBL_LOC .EQU $1BE -PARTTBL_SIZ .EQU $40 -BOOTSIG_LOC .EQU $1FE +META_SIZE .EQU 32 ; SEE BELOW +META_LOC .EQU (PREFIX_SIZE - META_SIZE) +; +PT_LOC .EQU $1BE +PT_SIZ .EQU $40 ; ;------------------------------------------------------------------------------- ; SECTOR 1 @@ -52,7 +51,8 @@ BOOTSIG_LOC .EQU $1FE ;---------------------------------------------------------------------------- ; ; THE FOLLOWING BOOTSTRAP CODE IS BUILT TO ASSUME IT WILL BE EXECUTED AT A STARTING -; ADDRESS OF $8000. +; ADDRESS OF $8000. THIS CODE IS *ONLY* FOR UNA. THE ROMWBW ROM BOOTLOADER +; USES THE METADATA TO LOAD THE OS DIRECTLY. ; .ORG $8000 JR BOOT @@ -145,10 +145,10 @@ HEXASCII: ; CONVERT LOW NIBBLE OF A TO ASCII HEX ; HEXCONV: - AND 0FH ;LOW NIBBLE ONLY - ADD A,90H + AND $0F ;LOW NIBBLE ONLY + ADD A,$90 DAA - ADC A,40H + ADC A,$40 DAA RET ; @@ -163,17 +163,17 @@ STR_LOAD .DB "\r\nLoading",0 STR_DONE .DB "\r\n",0 STR_ERR .DB " Read Error!",0 ; - .ORG $ - $8000 ; RESTORE ORG - .FILL PARTTBL_LOC - $ ; FILL TO START OF PARTITION TABLE + .ORG $ - $8000 ; BACK TO ABSOLUTE ADDRESS +; + .FILL PT_LOC - $,0 ; FILL TO START OF PARTITION TABLE ; ; RESERVE SPACE FOR STANDARD IBM-PC PARTITION TABLE. ALTHOUGH A ; PARTITION TABLE IS NOT RELEVANT FOR A FLOPPY DISK, IT DOES NO HARM. ; THE CONTENTS OF THE PARTITION TABLE MUST BE MANAGED BY FDISK80. ; -PARTTBL .FILL PARTTBL_SIZ,$00 ; PARTITION TABLE, FILL WITH ZEROES +PARTTBL .FILL PT_SIZ,0 ; PARTITION TABLE, FILL WITH ZEROES ; -; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT -; SIGNATURE. +; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT SIGNATURE. ; BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; @@ -184,7 +184,7 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 512,0 ; JUST FILL SECTOR WITH ZEROES + .FILL SEC_SIZE,0 ; JUST FILL SECTOR WITH ZEROES ; ;------------------------------------------------------------------------------- ; SECTOR 3 @@ -193,36 +193,34 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 128 * 3,0 ; FIRST 384 BYTES ARE NOT YET DEFINED + .FILL (BLK_SIZE * 3),0 ; FIRST 384 BYTES ARE NOT YET DEFINED ; ; THE FOLLOWING TWO BYTES ARE AN ADDITIONAL SIGNATURE THAT IS VERIFIED BY ; SOME HARDWARE BIOSES. ; PR_SIG .DB $5A,$A5 ; SIGNATURE GOES HERE ; -; FIRST CHUNK OF METADATA IMMEDIATELY FOLLOWS THE SIGNATURE BYTES -; -PR_PLATFORM .DB 0 ; PLATFORM ID (SEE STD.ASM) -PR_DEVICE .DB 0 ; ? (PROBABLY UNUSED) -PR_FORMATTER .DB 0,0,0,0,0,0,0,0 ; ? (PROBABLY UNUSED) -PR_DRIVE .DB 0 ; ? (PROBABLY UNUSED) -PR_LOG_UNIT .DW 0 ; ? (PROBABLY UNUSED) -; -; FILLER TO PLACE SECOND CHUNK OF METADATA AT THE END OF THE SECTOR -; - .FILL ((PREFIX_SIZE - METADATA_SIZE) - $),00H + .FILL (META_LOC - $),0 ; -; SECOND CHUNK OF METADATA +; METADATA ; -PR_WP .DB 0 ; WRITE PROTECT BOOLEADN -PR_UPDSEQ .DW 0 ; PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) -PR_VER .DB RMJ,RMN,RUP,RTP ; OS BUILD VERSION -PR_LABEL .DB "Unlabeled Drive ","$" ; DISK LABEL (EXACTLY 16 BYTES!!!) - .DW 0 ; DEPRECATED -PR_LDLOC .DW SYS_LOC ; ADDRESS TO START LOADING SYSTEM -PR_LDEND .DW SYS_END ; ADDRESS TO STOP LOADING SYSTEM -PR_ENTRY .DW SYS_ENT ; ADDRESS TO ENTER SYSTEM (OS) +PR_WP .DB 0 ; (1) WRITE PROTECT BOOLEAN +PR_UPDSEQ .DW 0 ; (2) PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) +PR_VER .DB RMJ,RMN,RUP,RTP ; (4) OS BUILD VERSION +PR_LABEL .DB "Unlabeled Drive ","$" ; (17) DISK LABEL (EXACTLY 16 BYTES!!!) + .DW 0 ; (2) DEPRECATED +PR_LDLOC .DW SYS_LOC ; (2) ADDRESS TO START LOADING SYSTEM +PR_LDEND .DW SYS_END ; (2) ADDRESS TO STOP LOADING SYSTEM +PR_ENTRY .DW SYS_ENT ; (2) ADDRESS TO ENTER SYSTEM (OS) ; +#IF (META_SIZE != ($ - META_LOC)) + .ECHO "META_SIZE VALUE IS WRONG!!!\r\n" + !!! +#ENDIF ; +#IF ($ != PREFIX_SIZE) + .ECHO "LOADER PREFIX IS WRONG SIZE!!!\r\n" + !!! +#ENDIF ; - .END + .END diff --git a/Source/CPM3/boot.z80 b/Source/CPM3/boot.z80 index a252faff..9c423f68 100644 --- a/Source/CPM3/boot.z80 +++ b/Source/CPM3/boot.z80 @@ -59,14 +59,15 @@ init$2: call ?pmsg ; print it ; Get boot disk unit and save it - ld bc,0F8E0h ; HBIOS func: get boot info - rst 08 ; do it, D := boot unit, E: := boot slice - ld a,d ; move boot unit to A - ld (@bootdu),a ; save it - ld a,e ; move boot slice to A - ld (@bootsl),a ; save it + ld bc,0F8E0h ; HBIOS func: get boot info + rst 08 ; do it, D := boot unit, E: := boot slice + ld a,d ; move boot unit to A + ld (@bootdu),a ; save it + ld a,e ; move boot slice to A + ld (@bootsl),a ; save it call dinit + call clrram ret cinit: @@ -298,6 +299,75 @@ stpimg db 'W',~'W' ; marker dw cbx ; address of cbios ext data stpsiz equ $ - stpimg + + cseg ; ram disk init must be done from resident memory + +; +; Initialize ram disk by filling directory with 'e5' bytes +; Fill first 8k of ram disk track 1 with 'e5' +; +clrram: + di ; no interrupts + ld a,(0FFE0h) ; get current bank + push af ; save it + ;ld a,(bnkramd) ; first bank of ram disk + ld a,080h ; first bank of ram disk + ;call hb_bnksel ; select bank + call 0FFF3h ; select bank + + ; Check first 32 directory entries. If any start with an invalid + ; value, init the ram disk. Valid entries are e5 (empty entry) or + ; 0-15 (user number). + ld hl,0 + ld de,32 + ld b,32 +clrram0: + ld a,(hl) + cp 0E5h + jr z,clrram1 ; e5 is valid + cp 16 + jr c,clrram1 ; 0-15 is also valid + jr clrram2 ; invalid entry! jump to init +clrram1: + add hl,de ; loop for 32 entries + djnz clrram0 +; jr clrram2 ; *debug* + jr clrram3 ; all entries valid, bypass init +clrram2: + ld hl,0 ; source adr for fill + ld bc,2000h ; length of fill is 8k + ld a,0E5h ; fill value + call fill ; do it + or 0ffh ; flag value for cleared + ld (clrflg),a ; save it +clrram3: + ;ld a,(bnkuser) ; usr bank (tpa) + pop af ; recover original bank + ;call hb_bnksel ; select bank + call 0FFF3h ; select bank + ei ; resume interrupts + + ld a,(clrflg) ; get cleared flag + or a ; set flags + ld hl,clr$msg ; clear ram disk message + call nz,?pmsg ; print msg if true + + ret + +; +; Fill memory at hl with value a, length in bc. All regs used. +; Length *must* be greater than 1 for proper operation!!! +; +fill: + ld d,h ; set de to hl + ld e,l ; so destination equals source + ld (hl),a ; fill the first byte with desired value + inc de ; increment destination + dec bc ; decrement the count + ldir ; do the rest + ret ; return + + cseg ; boot loading most be done from resident memory ; This version of the boot loader loads the CCP from a file @@ -569,6 +639,9 @@ read: ld c,20 jp bdos +clrflg db 0 ; RAM disk cleared flag +clr$msg db 'RAM Disk Initialized',13,10,13,10,0 + if zpm signon$msg db 13,10,'ZPM3' diff --git a/Source/CPM3/loader.asm b/Source/CPM3/loader.asm index 979ef532..0a417849 100644 --- a/Source/CPM3/loader.asm +++ b/Source/CPM3/loader.asm @@ -31,17 +31,16 @@ SYS_ENT .EQU $0100 ; SYSTEM (OS) ENTRY POINT ADDRESS SYS_LOC .EQU $0100 ; STARTING ADDRESS TO LOAD SYSTEM IMAGE SYS_END .EQU $1480 ; ENDING ADDRESS OF SYSTEM IMAGE ; -BYT .EQU 1 ; used to describe METADATA_SIZE below -WRD .EQU 2 +SEC_SIZE .EQU 512 ; DISK SECTOR SIZE +BLK_SIZE .EQU 128 ; OS BLOCK/RECORD SIZE ; -SECTOR_SIZE .EQU 512 -BLOCK_SIZE .EQU 128 -PREFIX_SIZE .EQU (3 * SECTOR_SIZE) ; 3 SECTORS -METADATA_SIZE .EQU BYT+WRD+(4*BYT)+16+BYT+WRD+WRD+WRD+WRD ; (as defined below) +PREFIX_SIZE .EQU (SEC_SIZE * 3) ; 3 SECTORS ; -PARTTBL_LOC .EQU $1BE -PARTTBL_SIZ .EQU $40 -BOOTSIG_LOC .EQU $1FE +META_SIZE .EQU 32 ; SEE BELOW +META_LOC .EQU (PREFIX_SIZE - META_SIZE) +; +PT_LOC .EQU $1BE +PT_SIZ .EQU $40 ; ;------------------------------------------------------------------------------- ; SECTOR 1 @@ -52,7 +51,8 @@ BOOTSIG_LOC .EQU $1FE ;---------------------------------------------------------------------------- ; ; THE FOLLOWING BOOTSTRAP CODE IS BUILT TO ASSUME IT WILL BE EXECUTED AT A STARTING -; ADDRESS OF $8000. +; ADDRESS OF $8000. THIS CODE IS *ONLY* FOR UNA. THE ROMWBW ROM BOOTLOADER +; USES THE METADATA TO LOAD THE OS DIRECTLY. ; .ORG $8000 JR BOOT @@ -145,10 +145,10 @@ HEXASCII: ; CONVERT LOW NIBBLE OF A TO ASCII HEX ; HEXCONV: - AND 0FH ;LOW NIBBLE ONLY - ADD A,90H + AND $0F ;LOW NIBBLE ONLY + ADD A,$90 DAA - ADC A,40H + ADC A,$40 DAA RET ; @@ -163,17 +163,17 @@ STR_LOAD .DB "\r\nLoading",0 STR_DONE .DB "\r\n",0 STR_ERR .DB " Read Error!",0 ; - .ORG $ - $8000 ; RESTORE ORG - .FILL PARTTBL_LOC - $ ; FILL TO START OF PARTITION TABLE + .ORG $ - $8000 ; BACK TO ABSOLUTE ADDRESS +; + .FILL PT_LOC - $,0 ; FILL TO START OF PARTITION TABLE ; ; RESERVE SPACE FOR STANDARD IBM-PC PARTITION TABLE. ALTHOUGH A ; PARTITION TABLE IS NOT RELEVANT FOR A FLOPPY DISK, IT DOES NO HARM. ; THE CONTENTS OF THE PARTITION TABLE MUST BE MANAGED BY FDISK80. ; -PARTTBL .FILL PARTTBL_SIZ,$00 ; PARTITION TABLE, FILL WITH ZEROES +PARTTBL .FILL PT_SIZ,0 ; PARTITION TABLE, FILL WITH ZEROES ; -; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT -; SIGNATURE. +; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT SIGNATURE. ; BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; @@ -184,7 +184,7 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 512,0 ; JUST FILL SECTOR WITH ZEROES + .FILL SEC_SIZE,0 ; JUST FILL SECTOR WITH ZEROES ; ;------------------------------------------------------------------------------- ; SECTOR 3 @@ -193,36 +193,34 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 128 * 3,0 ; FIRST 384 BYTES ARE NOT YET DEFINED + .FILL (BLK_SIZE * 3),0 ; FIRST 384 BYTES ARE NOT YET DEFINED ; ; THE FOLLOWING TWO BYTES ARE AN ADDITIONAL SIGNATURE THAT IS VERIFIED BY ; SOME HARDWARE BIOSES. ; PR_SIG .DB $5A,$A5 ; SIGNATURE GOES HERE ; -; FIRST CHUNK OF METADATA IMMEDIATELY FOLLOWS THE SIGNATURE BYTES -; -PR_PLATFORM .DB 0 ; PLATFORM ID (SEE STD.ASM) -PR_DEVICE .DB 0 ; ? (PROBABLY UNUSED) -PR_FORMATTER .DB 0,0,0,0,0,0,0,0 ; ? (PROBABLY UNUSED) -PR_DRIVE .DB 0 ; ? (PROBABLY UNUSED) -PR_LOG_UNIT .DW 0 ; ? (PROBABLY UNUSED) -; -; FILLER TO PLACE SECOND CHUNK OF METADATA AT THE END OF THE SECTOR -; - .FILL ((PREFIX_SIZE - METADATA_SIZE) - $),00H + .FILL (META_LOC - $),0 ; -; SECOND CHUNK OF METADATA +; METADATA ; -PR_WP .DB 0 ; WRITE PROTECT BOOLEADN -PR_UPDSEQ .DW 0 ; PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) -PR_VER .DB RMJ,RMN,RUP,RTP ; OS BUILD VERSION -PR_LABEL .DB "Unlabeled Drive ","$" ; DISK LABEL (EXACTLY 16 BYTES!!!) - .DW 0 ; DEPRECATED -PR_LDLOC .DW SYS_LOC ; ADDRESS TO START LOADING SYSTEM -PR_LDEND .DW SYS_END ; ADDRESS TO STOP LOADING SYSTEM -PR_ENTRY .DW SYS_ENT ; ADDRESS TO ENTER SYSTEM (OS) +PR_WP .DB 0 ; (1) WRITE PROTECT BOOLEAN +PR_UPDSEQ .DW 0 ; (2) PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) +PR_VER .DB RMJ,RMN,RUP,RTP ; (4) OS BUILD VERSION +PR_LABEL .DB "Unlabeled Drive ","$" ; (17) DISK LABEL (EXACTLY 16 BYTES!!!) + .DW 0 ; (2) DEPRECATED +PR_LDLOC .DW SYS_LOC ; (2) ADDRESS TO START LOADING SYSTEM +PR_LDEND .DW SYS_END ; (2) ADDRESS TO STOP LOADING SYSTEM +PR_ENTRY .DW SYS_ENT ; (2) ADDRESS TO ENTER SYSTEM (OS) ; +#IF (META_SIZE != ($ - META_LOC)) + .ECHO "META_SIZE VALUE IS WRONG!!!\r\n" + !!! +#ENDIF ; +#IF ($ != PREFIX_SIZE) + .ECHO "LOADER PREFIX IS WRONG SIZE!!!\r\n" + !!! +#ENDIF ; - .END + .END diff --git a/Source/Doc/Applications.md b/Source/Doc/Applications.md index 55c155a1..4a145533 100644 --- a/Source/Doc/Applications.md +++ b/Source/Doc/Applications.md @@ -12,10 +12,10 @@ classoption: - oneside papersize: letter geometry: - - top=1in - - bottom=1in - - left=1in - - right=1in + - top=1.5in + - bottom=1.5in + - left=1.5in + - right=1.5in # - showframe linestretch: 1.25 colorlinks: true @@ -69,7 +69,6 @@ found: | SYSCOPY | Yes | Yes | Yes | | MODE | Yes | Yes | Yes | | FDU | Yes | Yes | Yes | -| OSLDR | Yes | Yes | Yes | | FORMAT | Yes | Yes | Yes | | XM | Yes | Yes | Yes | | FLASH | Yes | Yes | Yes | @@ -402,63 +401,6 @@ provided in the RomWBW distribution. `\clearpage`{=latex} -# OSLDR - -RomWBW supports loading new operating systems on-the-fly. For example, -if CP/M 2.2 is currently running, you can load and run Z-System from -the command line. The `OSLDR` application provides this functionality. - -## Syntax - -`OSLDR [/F] `*``*` [`*``*`]` - -*``* is the name of a file containing an operating system image - -*``* is the name of a file containing an HBIOS firmware image - -`/F` forces operation bypassing compatibility checking - -## Usage - -`OSLDR `*``* will read the specified file, confirm it is an -operating system image file, then load it as though it was being -booted. For example, `OSLDR ZSYS.SYS` would load the Z-System -operating system. - -`OSLDR `*``* *``* will first read and load the -specified *``* file as a new HBIOS image and then read and -load the specified *``* file. HBIOS image can be produced by -the RomWBW build process, but they are not produced by default. You -are encouraged to contact Wayne Warthen for more information on this -capability. - -## Notes - -The primary function of `OSLDR` is to allow switching to a new -operating system while the system if running without a full reboot. - -`OSLDR` is considered generally reliable for when used simply to load -a new operating system (one parameter). However, using it to load an -HBIOS image is considered experimental and should not be relied upon. - -`OSLDR` can also be used to load "test" versions of operating systems -from files transferred to your system. This is especially useful in -when loading both an operating system and HBIOS image because you can -essentially simulate starting your system with new firmware without -reprogramming your ROM. - -`OSLDR` attempts to check the file(s) specified for correctness before -loading them, but it is far from perfect. This application should be -used with caution and may not work in some cases that are hard to -define. - -## Etymology - -The `OSLDR` command is an original product and the source code is -provided in the RomWBW distribution. - -`\clearpage`{=latex} - # FORMAT This application is just a placeholder for a future version that will @@ -476,7 +418,7 @@ function beyond this display currently. ## Etymology -The `OSLDR` command is an original product and the source code is +The `FORMAT` command is an original product and the source code is provided in the RomWBW distribution. `\clearpage`{=latex} diff --git a/Source/Doc/Architecture.md b/Source/Doc/Architecture.md index 2d545893..90d531ba 100644 --- a/Source/Doc/Architecture.md +++ b/Source/Doc/Architecture.md @@ -17,10 +17,10 @@ numbersections: true secnumdepth: 1 papersize: letter geometry: -- top=1in -- bottom=1in -- left=1in -- right=1in +- top=1.5in +- bottom=1.5in +- left=1.5in +- right=1.5in # - showframe # - pass linestretch: 1.25 @@ -1327,13 +1327,16 @@ The hardware platform is identified in L: Id | Platform -- | --------------------------------------------------- 1 | SBC V1 or V2 -2 | ZETA -3 | ZETA 2 +2 | Zeta +3 | Zeta V2 4 | N8 -5 | MK4 +5 | Mark IV 6 | UNA 7 | RC2014 w/ Z80 -8 | RC2014 w/ Z180 +8 | RC2014 w/ Z180 & banked memory module +9 | RC2014 w/ Z180 & linear memory module +10 | SCZ180 (SC126, SC130, SC131) +11 | Dyno ### Function 0xF2 -- System Set Bank (SYSSETBNK) diff --git a/Source/Doc/GettingStarted.md b/Source/Doc/GettingStarted.md index fa4c5337..7f087dcd 100644 --- a/Source/Doc/GettingStarted.md +++ b/Source/Doc/GettingStarted.md @@ -14,10 +14,10 @@ classoption: toc: true papersize: letter geometry: - - top=1in - - bottom=1in - - left=1in - - right=1in + - top=1.5in + - bottom=1.5in + - left=1.5in + - right=1.5in # - showframe linestretch: 1.25 colorlinks: true @@ -142,21 +142,21 @@ directory contains the pre-built ROM and disk images. The ROM image files all end in ".rom". Based on the table below, **carefully** pick the appropriate ROM image for your hardware. -| Platform | ROM Image File | Baud | Description | -| --------------| --------------------- | --------: | ------------------------------------------------ | -| SBC V1/V2 | SBC_std.rom | 38400 | RetroBrew SBC v1 or v2 ECB Z80 | -| Zeta V1 | ZETA_std.rom | 38400 | RetroBrew Zeta V1 Z80, ParPortProp (optional) | -| Zeta V2 | ZETA2_std.rom | 38400 | RetroBrew Zeta V2 Z80, ParPortProp (optional) | -| N8 | N8_std.rom | 38400 | RetroBrew N8 Z180, date code >= 2312 | -| Mark IV | MK4_std.rom | 38400 | RetroBrew Mark IV ECB Z180 | -| RC2014 Z80 | RCZ80_std.rom | 115200 | RC2014 w/ Z80 CPU, requires 512K RAM/ROM module | -| RC2014 Z180\* | RCZ180_ext.rom | 115200 | RC2014 w/ Z180 CPU & 512K banked RAM/ROM module | -| RC2014 Z180\* | RCZ180_nat.rom | 115200 | RC2014 w/ Z180 CPU & 512K native RAM/ROM module | -| Easy Z80 | EZZ80_std.rom | 115200 | Sergey Kiselev's Easy Z80 | -| SC126 | SCZ180_126.rom | 115200 | Stephen Cousin's SC126 Z180 | -| SC130 | SCZ180_130.rom | 115200 | Stephen Cousin's SC130 Z180 | -| SC131 | SCZ180_131.rom | 115200 | Stephen Cousin's SC131 Z180 | -| Dyno | DYNO_std.rom | 38400 | Steve Garcia's Z180 Dyno Computer | +| Platform | ROM Image File | Baud | Description | +| -------------- | ------------------------ | ----------: | ------------------------------------------------ | +| SBC | SBC_std.rom | 38400 | RetroBrew SBC v1 or v2 ECB Z80 | +| Zeta V1 | ZETA_std.rom | 38400 | RetroBrew Zeta V1 Z80, ParPortProp (optional) | +| Zeta V2 | ZETA2_std.rom | 38400 | RetroBrew Zeta V2 Z80, ParPortProp (optional) | +| N8 | N8_std.rom | 38400 | RetroBrew N8 Z180, date code >= 2312 | +| Mark IV | MK4_std.rom | 38400 | RetroBrew Mark IV ECB Z180 | +| RC Z80 | RCZ80_std.rom | 115200 | RC2014 w/ Z80 CPU, requires 512K RAM/ROM module | +| RC Z180\* | RCZ180_ext.rom | 115200 | RC2014 w/ Z180 CPU & 512K banked RAM/ROM module | +| RC Z180\* | RCZ180_nat.rom | 115200 | RC2014 w/ Z180 CPU & 512K native RAM/ROM module | +| Easy Z80 | EZZ80_std.rom | 115200 | Sergey Kiselev's Easy Z80 | +| SC126 | SCZ180_126.rom | 115200 | Stephen Cousin's SC126 Z180 | +| SC130 | SCZ180_130.rom | 115200 | Stephen Cousin's SC130 Z180 | +| SC131 | SCZ180_131.rom | 115200 | Stephen Cousin's SC131 Z180 | +| Dyno | DYNO_std.rom | 38400 | Steve Garcia's Z180 Dyno Computer | \*The RC2014 Z180 requires a separate RAM/ROM memory module. There are two types of these modules and you must pick the ROM for your type of @@ -196,123 +196,6 @@ to the RAM disk (A:) will disappear at the next power on (RAM is generally not persistent). Also note that attempts to save files to the ROM disk (B:) will fail because ROM is not writable. -# Upgrading - -Upgrading to a newer release of RomWBW is essentially just a matter of -updating the ROM chip in your system. If you have spare ROM chips for -your system and a ROM programmer, it is always safest to retain your -existing, working ROM chip and program a new one with the new -firmware. If the new one fails to boot, you can easily return to the -known working ROM. - -Prior to attempting to reprogram your actual ROM chip, you may wish to -"try" the upgrade. With RomWBW, you can upload a new system image -executable and load it from the command line. For each ROM image file -(.rom) in the Binary directory, you will also find a corresponding -application file (.com). For example, for SBC_std.rom, there is also -an SBC_std.com file. You can upload the .com file to your system using -XModem, then simply run the .com file. You will see your system go -through the normal startup process just like it was started from ROM. -However, your ROM has not been updated and the next time you boot your -system, it will revert to the system image contained in ROM. You may -find that you are unable to load the .com file because it is too large -to fit in available application RAM (TPA). Unfortunately, in this -case, you will not be able to use the .com file mechanism to start -your system. - -If you do not have easy access to a ROM programmer, it is usually -possible to reprogram your system ROM using the FLASH utility from -Will Sowerbutts. This application, called FLASH.COM, can be found on the -ROM drive of any running system. In this case, you would need to -transfer the new ROM image (.rom) over to your system using XModem (or -one of the other mechanisms described in the Transferring Files -section below). The ROM image is too large to fit on your RAM drive, -so you will need to transfer it to a larger storage drive. Once the -ROM image is on your system, you can use the FLASH application to -update your ROM. The following is a typical example of transferring -ROM image using XModem and flashing the chip in-situ. - -``` -E>xm r rom.img - -XMODEM v12.5 - 07/13/86 -RBC, 28-Aug-2019 [WBW], ASCI - -Receiving: E0:ROM.IMG -7312k available for uploads -File open - ready to receive -To cancel: Ctrl-X, pause, Ctrl-X - -Thanks for the upload - -E>flash write rom.img -FLASH4 by Will Sowerbutts version 1.2.3 - -Using RomWBW (v2.6+) bank switching. -Flash memory chip ID is 0xBFB7: 39F040 -Flash memory has 128 sectors of 4096 bytes, total 512KB -Write complete: Reprogrammed 2/128 sectors. -Verify (128 sectors) complete: OK! -``` - -Obviously, there is some risk to this approach since any issues with the -programming or ROM image could result in a non-functional system. - -To confirm your ROM chip has been successfully updated, restart your -system and boot an operating system from ROM. Do not boot from a disk -device yet. Review the boot messages to see if any issues have -occurred. - -Once you are satisfied that the ROM is working well, you will need to -update the system images and RomWBW custom applications on your disk -drives. The system images and custom applications are matched to the -RomWBW ROM firmware in use. If you attempt to boot a disk or run -applications that have not been updated to match the current ROM -firmware, you are likely to have odd problems. - -The simplest way to update your disk media is to just use your modern -computer to overwrite the entire media with the latest disk image of your -choice. This process is described below in the Disk Images section. If -you wish to update existing disk media in your system, you need to perform -the following steps. - -If the disk is bootable, you need to update the system tracks of the -disk.This is done using a SYSCOPY command such as `SYSCOPY -C:=B:ZSYS.SYS`. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M 2.2 -disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS. -CPMLDR.SYS is not provided on the ROM disk, so you would need to -upload it from the distribution. - -Finally, if you have copies of any of the RomWBW custom applications -on your hard disk, you need to update them with the latest copies. The -following applications are found on your ROM disk. Use COPY to copy -them over any older versions of the app on your disk: - -* ASSIGN.COM -* SYSCOPY.COM -* MODE.COM -* FDU.COM (was FDTST.COM) -* OSLDR.COM -* FORMAT.COM -* XM.COM -* FLASH.COM -* FDISK80.COM -* TALK.COM -* RTC.COM -* TIMER.COM -* INTTEST.COM - -For example: `B>COPY ASSIGN.COM C:` - -Some RomWBW custom applications are too large to fit on the ROM disk. -If you are using any of these you will need to transfer them to your -system and then update all copies. These applications are found in -the Binary\\Apps directory of the distribution and in all of the disk -images. - -* FAT.COM -* TUNE.COM - # General Usage Each of the operating systems and ROM applications included with @@ -524,19 +407,20 @@ functional on all of the OS variants included with RomWBW. The following custom applications are found on the ROM disk and are, therefore, globally available. -| Application | Description | -| ----------- | -------------------------------------------------------------- | -| ASSIGN | Add, change, and delete drive letter assignments. Use ASSIGN /? for usage instructions. | +| Application | Description | +| ----------- | ---------------------------------------------------------------------------------------------------- | +| ASSIGN | Add, change, and delete drive letter assignments. Use ASSIGN /? for usage instructions. | | SYSCOPY | Copy system image to a device to make it bootable. Use SYSCOPY with no parms for usage instructions. | -| FDU | Format and test floppy disks. Menu driven interface. | -| OSLDR | Load a new OS on the fly. For example, you can switch to Z-System when running CP/M. Use OSLDR with no parms for usage instructions. | -| FORMAT | Will someday be a command line tool to format floppy disks. Currently does nothing! | -| MODE | Reconfigures serial ports dynamically. | -| XM | XModem file transfer program adapted to hardware. Automatically uses primary serial port on system. | -| FDISK80 | John Coffman's Z80 hard disk partitioning tool. See documentation in Doc directory. | -| FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | -| FLASH | Will Sowerbutts' in-situ ROM programming utility. | -| CLRDIR | Initialize the directory area of a CP/M disk (Max Scane). | +| MODE | Reconfigures serial ports dynamically. | +| FDU | Format and test floppy disks. Menu driven interface. | +| FORMAT | Will someday be a command line tool to format floppy disks. Currently does nothing! | +| XM | XModem file transfer program adapted to hardware. Automatically uses primary serial port on system. | +| FLASH | Will Sowerbutts' in-situ ROM programming utility. | +| FDISK80 | John Coffman's Z80 hard disk partitioning tool. See documentation in Doc directory. | +| TALK | Direct console I/O to a specified character device. | +| RTC | Manage and test the Real Time Clock hardware. | +| TIMER | Display value of running periodic system timer. | +| INTTEST | Test interrupt vector hooking. | Some custom applications do not fit on the ROM disk. They are found on the disk image files or the individual files can be found in the Binary\\Apps @@ -547,8 +431,8 @@ directory of the distribution. | TUNE | Play .PT2, .PT3, .MYM audio files. | | FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | -There is additional documentation on some of these applications at the -[RomWBW Applications Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:romwbw:apps). +Additional documentation on all of these applications can be found in +"RomWBW Applications.pdf" in the Doc directory of the distribution. # Using Disks @@ -869,6 +753,16 @@ are new to the CP/M world, I would recommend using this CP/M variant to start with simply because it is the most stable and you are less likely to encounter problems. +### Errata + +- The original versions of DDT, DDTZ, and ZSID used the RST 38 +vector which conflicts with interrupt mode 1 use of this vector. +The DDT, DDTZ, and ZSID applications in RomWBW have been modified +to use RTS 30 to avoid this issue. + +- Z-System applications will not run under CP/M 2.2. For example, +the `LDDS` date stamper with not run. + ## ZSDOS 1.1 ZSDOS is the most popular non-DRI CP/M "clone" which is generally @@ -883,6 +777,12 @@ Additionally, the official documentation for Z-System is included in the RomWBW distribution Doc directory ("ZSDOS Manual.pdf" and "ZCPR Manual.pdf"). +### Errata + +- Although most CP/M 2.2 applications will run under Z-System, some +may not work as expected. The best example is PIP which is not aware +of the ZSDOS paths and will fail in some scenarios (use `COPY` instead). + ## NZCOM Automatic Z-System NZCOM is a much further refined version of Z-System (ZCPR 3.4). NZCOM @@ -893,11 +793,16 @@ a host OS. On the RomWBW NZCOM disk images, the boot OS is ZSDOS 1.1. After you configure NZCOM, you can add a `PROFILE.SUB` file to automatically launch NZCOM at boot. -To use, NZCOM, you must run through a simple configuration process. -This is well documented in the NZCOM manual in the "NZCOM Users -Manual.pdf" file in the RomWBW Doc directory. Additionally, there are -instructions for automatically launching NZCOM when the disk is -booted under the host OS via an auto command submission process. +NZCOM is not pre-configured. You must run through a simple +configuration process before loading it. Run MKZCM to do this. + +NZCOM has substantially more functionality than CP/M or basic +Z-System. It is important to read the the "NZCOM Users +Manual.pdf" file in the RomWBW Doc directory. + +### Errata + +- There is no `DIR` command, you must use `SDZ` instead. ## Digital Research CP/M 3 @@ -909,7 +814,13 @@ support tools and help system. Note that to make a CP/M 3 boot disk, you actually place CPMLDR.SYS on the system tracks of the disk. You do not place CPM3.SYS on the -system tracks. +system tracks. `CPMLDR.SYS` chain loads `CPM3.SYS`. + +### Errata + +- CLRDIR is not working right under CP/M 3. It only partially clears +the disk sectors of the directory area. The extent of this issue +has not been evaluated, but it is not a RomWBW issue. ## Simeon Cran's ZPM3 @@ -920,11 +831,20 @@ both. Like CP/M 3, to make ZPM3 boot disk, you put CPMLDR.SYS on the system tracks of the disk. +### Errata + +- CLRDIR is not working right under ZPM3. It only partially clears +the disk sectors of the directory area. The extent of this issue +has not been evaluated, but it is not a RomWBW issue. +- ZPMLDR is included with ZPM3, but it is not working correctly. +- The ZPM operatins system is contained in the file called CPM3.SYS +which is confusing, but it is the author's intended way of using ZPM3. + ## FreeRTOS -Note that Phillip Stevens has also ported FreeRTOS to run under -RomWBW. FreeRTOS is not provided in the RomWBW distribution. FreeRTOS -is available under the +Phillip Stevens has ported FreeRTOS to run under RomWBW. FreeRTOS is +not provided in the RomWBW distribution. FreeRTOS is available under +the [MIT licence](https://www.freertos.org/a00114.html) and further general information is available at [FreeRTOS](https://www.freertos.org/RTOS.html). @@ -1119,6 +1039,126 @@ Please refer to the [UNA BIOS Firmware Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:una:start) for more information on UNA. +# Upgrading + +Upgrading to a newer release of RomWBW is essentially just a matter of +updating the ROM chip in your system. If you have spare ROM chips for +your system and a ROM programmer, it is always safest to retain your +existing, working ROM chip and program a new one with the new +firmware. If the new one fails to boot, you can easily return to the +known working ROM. + +Prior to attempting to reprogram your actual ROM chip, you may wish to +"try" the upgrade. With RomWBW, you can upload a new system image +executable and load it from the command line. For each ROM image file +(.rom) in the Binary directory, you will also find a corresponding +application file (.com). For example, for SBC_std.rom, there is also +an SBC_std.com file. You can upload the .com file to your system using +XModem, then simply run the .com file. You will see your system go +through the normal startup process just like it was started from ROM. +However, your ROM has not been updated and the next time you boot your +system, it will revert to the system image contained in ROM. + +There are two restrictions to be aware of related to loading a system +image as a .com application. First, this is only supported under +Z-System and CP/M 2.2. You must boot into one of these OSes before +attempting to launch the .com file. Second, you may find that you +are unable to load the .com file because it is too large to fit in +available application RAM (TPA). Your only recourse in this +situation is to build a custom ROM with fewer features. + +If you do not have easy access to a ROM programmer, it is usually +possible to reprogram your system ROM using the FLASH utility from +Will Sowerbutts. This application, called FLASH.COM, can be found on the +ROM drive of any running system. In this case, you would need to +transfer the new ROM image (.rom) over to your system using XModem (or +one of the other mechanisms described in the Transferring Files +section). The ROM image is too large to fit on your RAM drive, +so you will need to transfer it to a larger storage drive. Once the +ROM image is on your system, you can use the FLASH application to +update your ROM. The following is a typical example of transferring +ROM image using XModem and flashing the chip in-situ. + +``` +E>xm r rom.img + +XMODEM v12.5 - 07/13/86 +RBC, 28-Aug-2019 [WBW], ASCI + +Receiving: E0:ROM.IMG +7312k available for uploads +File open - ready to receive +To cancel: Ctrl-X, pause, Ctrl-X + +Thanks for the upload + +E>flash write rom.img +FLASH4 by Will Sowerbutts version 1.2.3 + +Using RomWBW (v2.6+) bank switching. +Flash memory chip ID is 0xBFB7: 39F040 +Flash memory has 128 sectors of 4096 bytes, total 512KB +Write complete: Reprogrammed 2/128 sectors. +Verify (128 sectors) complete: OK! +``` + +Obviously, there is some risk to this approach since any issues with the +programming or ROM image could result in a non-functional system. + +To confirm your ROM chip has been successfully updated, restart your +system and boot an operating system from ROM. Do not boot from a disk +device yet. Review the boot messages to see if any issues have +occurred. + +Once you are satisfied that the ROM is working well, you will need to +update the system images and RomWBW custom applications on your disk +drives. The system images and custom applications are matched to the +RomWBW ROM firmware in use. If you attempt to boot a disk or run +applications that have not been updated to match the current ROM +firmware, you are likely to have odd problems. + +The simplest way to update your disk media is to just use your modern +computer to overwrite the entire media with the latest disk image of +your choice. This process is described below in the Disk Images +section. If you wish to update existing disk media in your system, you +need to perform the following steps. + +If the disk is bootable, you need to update the system tracks of the +disk. This is done using a SYSCOPY command such as `SYSCOPY +C:=B:ZSYS.SYS`. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M 2.2 +disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS. +CPMLDR.SYS is not provided on the ROM disk, so you will need to +upload it from the distribution. + +Finally, if you have copies of any of the RomWBW custom applications +on your hard disk, you need to update them with the latest copies. The +following applications are found on your ROM disk. Use COPY to copy +them over any older versions of the app on your disk: + +* ASSIGN.COM +* SYSCOPY.COM +* MODE.COM +* FDU.COM (was FDTST.COM) +* FORMAT.COM +* XM.COM +* FLASH.COM +* FDISK80.COM +* TALK.COM +* RTC.COM +* TIMER.COM +* INTTEST.COM + +For example: `B>COPY ASSIGN.COM C:` + +Some RomWBW custom applications are too large to fit on the ROM disk. +If you are using any of these you will need to transfer them to your +system and then update all copies. These applications are found in +the Binary\\Apps directory of the distribution and in all of the disk +images. + +* FAT.COM +* TUNE.COM + # RomWBW Distribution All source code and distributions are maintained on GitHub. Code diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index b84902e9..ff098d8e 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -110,7 +110,7 @@ $ImgFile = "${OutDir}/${RomName}.img" # Final name of IMG image (memory loadable if ($Platform -eq "UNA") {$Bios = 'una'} else {$Bios = 'wbw'} # List of RomWBW proprietary apps to imbed in ROM disk. -$RomApps = "assign","fdu","format","mode","osldr","rtc","survey","syscopy","sysgen","talk","timer","xm","inttest" +$RomApps = "assign","fdu","format","mode","rtc","survey","syscopy","sysgen","talk","timer","xm","inttest" "" "Building ${RomName} ${ROMSize}KB ROM configuration ${Config} for Z${CPUType}..." diff --git a/Source/HBIOS/Build.sh b/Source/HBIOS/Build.sh index 62c85db4..24abfa41 100755 --- a/Source/HBIOS/Build.sh +++ b/Source/HBIOS/Build.sh @@ -57,7 +57,7 @@ else BIOS=wbw fi -Apps=(assign fdu format mode osldr rtc survey syscopy sysgen talk timer xm inttest) +Apps=(assign fdu format mode rtc survey syscopy sysgen talk timer xm inttest) blankfile=Blank${romsize}KB.dat romdiskfile=RomDisk.tmp diff --git a/Source/HBIOS/Config/RCZ180_ext.asm b/Source/HBIOS/Config/RCZ180_ext.asm index 7c9cca5b..a1dbad03 100644 --- a/Source/HBIOS/Config/RCZ180_ext.asm +++ b/Source/HBIOS/Config/RCZ180_ext.asm @@ -42,4 +42,4 @@ FDMODE .SET FDMODE_RCWDC ; FD: DRIVER MODE: FDMODE_[DIO|ZETA|DIDE|N8|DIO3] ; IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM) ; -PPIDEENABLE .SET FALSE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) +PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) diff --git a/Source/HBIOS/Config/RCZ180_nat.asm b/Source/HBIOS/Config/RCZ180_nat.asm index 5c83fe9a..46f9c43f 100644 --- a/Source/HBIOS/Config/RCZ180_nat.asm +++ b/Source/HBIOS/Config/RCZ180_nat.asm @@ -42,4 +42,4 @@ FDMODE .SET FDMODE_RCWDC ; FD: DRIVER MODE: FDMODE_[DIO|ZETA|DIDE|N8|DIO3] ; IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM) ; -PPIDEENABLE .SET FALSE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) +PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) diff --git a/Source/HBIOS/Config/RCZ80_kio.asm b/Source/HBIOS/Config/RCZ80_kio.asm index 8526fa8e..e88df73d 100644 --- a/Source/HBIOS/Config/RCZ80_kio.asm +++ b/Source/HBIOS/Config/RCZ80_kio.asm @@ -22,9 +22,10 @@ ; PLEASE REFER TO THE CUSTOM BUILD INSTRUCTIONS (README.TXT) IN THE SOURCE DIRECTORY (TWO ; DIRECTORIES ABOVE THIS ONE). ; -#include "cfg_rcz80.asm" +#DEFINE PLATFORM_NAME "RC2014 (KIO)" +; +#include "Config/RCZ80_std.asm" ; -CPUOSC .SET 7372800 ; CPU OSC FREQ IN MHZ INTMODE .SET 2 ; INTERRUPTS: 0=NONE, 1=MODE 1, 2=MODE 2 ; KIOENABLE .SET TRUE ; ENABLE ZILOG KIO SUPPORT @@ -41,10 +42,3 @@ SIO0BASE .SET KIOBASE+$08 ; SIO 0: REGISTERS BASE ADR SIO0CTCC .SET 0 ; SIO 0: CTC CHANNEL CLOCK SCALER, (0-3), -1 FOR NONE SIO0ACLK .SET 1843200 ; SIO 0A: OSC FREQ IN HZ, ZP=2457600/4915200, RC/SMB=7372800 SIO0BCLK .SET 1843200 ; SIO 0B: OSC FREQ IN HZ, ZP=2457600/4915200, RC/SMB=7372800 -; -FDENABLE .SET FALSE ; FD: ENABLE FLOPPY DISK DRIVER (FD.ASM) -FDMODE .SET FDMODE_RCWDC ; FD: DRIVER MODE: FDMODE_[DIO|ZETA|DIDE|N8|DIO3] -; -IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM) -; -PPIDEENABLE .SET FALSE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) diff --git a/Source/HBIOS/Config/RCZ80_mt.asm b/Source/HBIOS/Config/RCZ80_mt.asm index bdd72e8d..8806bedd 100644 --- a/Source/HBIOS/Config/RCZ80_mt.asm +++ b/Source/HBIOS/Config/RCZ80_mt.asm @@ -22,7 +22,7 @@ ; PLEASE REFER TO THE CUSTOM BUILD INSTRUCTIONS (README.TXT) IN THE SOURCE DIRECTORY (TWO ; DIRECTORIES ABOVE THIS ONE). ; -#DEFINE PLATFORM_NAME "RC2014 (mt)" +#DEFINE PLATFORM_NAME "RC2014 (MT)" ; #include "Config/RCZ80_std.asm" ; diff --git a/Source/HBIOS/Config/RCZ80_std.asm b/Source/HBIOS/Config/RCZ80_std.asm index d266d9f2..f9e0f1fa 100644 --- a/Source/HBIOS/Config/RCZ80_std.asm +++ b/Source/HBIOS/Config/RCZ80_std.asm @@ -35,4 +35,4 @@ FDMODE .SET FDMODE_RCWDC ; FD: DRIVER MODE: FDMODE_[DIO|ZETA|DIDE|N8|DIO3] ; IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM) ; -PPIDEENABLE .SET FALSE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) +PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) diff --git a/Source/HBIOS/Config/SCZ180_126.asm b/Source/HBIOS/Config/SCZ180_126.asm index 851f3476..d1f1cd1d 100644 --- a/Source/HBIOS/Config/SCZ180_126.asm +++ b/Source/HBIOS/Config/SCZ180_126.asm @@ -45,7 +45,7 @@ FDMODE .SET FDMODE_RCWDC ; FD: DRIVER MODE: FDMODE_[DIO|ZETA|DIDE|N8|DIO3] ; IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM) ; -PPIDEENABLE .SET FALSE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) +PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) ; SDENABLE .SET TRUE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM) SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD & SC ONLY diff --git a/Source/HBIOS/Config/SCZ180_130.asm b/Source/HBIOS/Config/SCZ180_130.asm index b3f22265..9b838598 100644 --- a/Source/HBIOS/Config/SCZ180_130.asm +++ b/Source/HBIOS/Config/SCZ180_130.asm @@ -51,6 +51,6 @@ FDMODE .SET FDMODE_RCWDC ; FD: DRIVER MODE: FDMODE_[DIO|ZETA|DIDE|N8|DIO3] ; IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM) ; -PPIDEENABLE .SET FALSE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) +PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM) ; SDENABLE .SET TRUE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM) diff --git a/Source/HBIOS/fd.asm b/Source/HBIOS/fd.asm index a72f1ba9..df2673be 100644 --- a/Source/HBIOS/fd.asm +++ b/Source/HBIOS/fd.asm @@ -1296,9 +1296,13 @@ FC_PULSETC: ; SET FST_DOR FOR MOTOR CONTROL ON ; FC_MOTORON: - LD BC,300H -; LD BC,10H - LD (FCD_IDLECNT),BC +; LD BC,300H +; LD BC,50H +; LD (FCD_IDLECNT),BC + + LD A,(CB_CPUMHZ) + RLCA + LD (FCD_IDLECNT),A #IF (FDTRACE >= 3) LD DE,FDSTR_MOTON diff --git a/Source/HBIOS/romldr.asm b/Source/HBIOS/romldr.asm index 6ce3ce6c..22294698 100644 --- a/Source/HBIOS/romldr.asm +++ b/Source/HBIOS/romldr.asm @@ -447,18 +447,32 @@ MENU_N .EQU ((MENU_E - MENU_S) / MENU_V) ; NUMBER OF MENU ITEMS ; REBOOT: ; -#IF (BIOS == BIOS_WBW) LD DE,STR_REBOOT ; POINT TO MESSAGE CALL WRITESTR ; PRINT IT +; + ; WAIT FOR MESSAGE TO BE DISPLAYED + LD HL,10000 +REBOOT1: ; LOOP IS 26TS + DEC HL ; 6TS + LD A,H ; 4TS + OR L ; 4TS + JR NZ,REBOOT1 ; 12TS +; +#IF (BIOS == BIOS_WBW) +; #IF (DSKYENABLE) LD HL,MSG_BOOT ; POINT TO BOOT MESSAGE CALL DSKY_SHOWSEG ; DISPLAY MESSAGE #ENDIF +; + ; SWITCH TO ROM BANK 0 AND JUMP TO ADDRESS 0 LD A,BID_BOOT ; BOOT BANK LD HL,0 ; ADDRESS ZERO CALL HB_BNKCALL ; DOES NOT RETURN #ENDIF +; #IF (BIOS == BIOS_UNA) + ; SWITCH TO ROM BANK 0 AND JUMP TO ADDRESS 0 LD BC,$01FB ; UNA FUNC = SET BANK LD DE,0 ; ROM BANK 0 RST 08 ; DO IT diff --git a/Source/Images/Common/ZAP.COM b/Source/Images/Common/ZAP.COM index 47ffcbb8..60dddd4f 100644 Binary files a/Source/Images/Common/ZAP.COM and b/Source/Images/Common/ZAP.COM differ diff --git a/Source/Images/d_bp.txt b/Source/Images/d_bp.txt index b075ca86..fa445326 100644 --- a/Source/Images/d_bp.txt +++ b/Source/Images/d_bp.txt @@ -17,3 +17,7 @@ ../BPBIOS/myterm.z3t 0: ../BPBIOS/Z34RCP11/z34rcp11.rel 0:rcp.zrl ../BPBIOS/NZFCP13/nzfcp13.rel 0:fcp.zrl +# +# Add Common Applications +# +Common/*.* 0: diff --git a/Source/Images/d_bp/u0/COMPARE.COM b/Source/Images/d_bp/u0/COMPARE.COM deleted file mode 100644 index 29fa41e6..00000000 Binary files a/Source/Images/d_bp/u0/COMPARE.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/DDTZ.COM b/Source/Images/d_bp/u0/DDTZ.COM deleted file mode 100644 index 4f6eca6b..00000000 Binary files a/Source/Images/d_bp/u0/DDTZ.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/NULU.COM b/Source/Images/d_bp/u0/NULU.COM deleted file mode 100644 index fc5594b1..00000000 Binary files a/Source/Images/d_bp/u0/NULU.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/UNARC.COM b/Source/Images/d_bp/u0/UNARC.COM deleted file mode 100644 index 8cc90746..00000000 Binary files a/Source/Images/d_bp/u0/UNARC.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/ZAP.COM b/Source/Images/d_bp/u0/ZAP.COM deleted file mode 100644 index 47ffcbb8..00000000 Binary files a/Source/Images/d_bp/u0/ZAP.COM and /dev/null differ diff --git a/Source/Images/d_bp/u0/ZDE.COM b/Source/Images/d_bp/u0/ZDE.COM deleted file mode 100644 index 9bc493c3..00000000 Binary files a/Source/Images/d_bp/u0/ZDE.COM and /dev/null differ diff --git a/Source/RomDsk/ROM_1024KB/ZAP.COM b/Source/RomDsk/ROM_1024KB/ZAP.COM index 47ffcbb8..60dddd4f 100644 Binary files a/Source/RomDsk/ROM_1024KB/ZAP.COM and b/Source/RomDsk/ROM_1024KB/ZAP.COM differ diff --git a/Source/RomDsk/ROM_512KB/ZAP.COM b/Source/RomDsk/ROM_512KB/ZAP.COM index 47ffcbb8..60dddd4f 100644 Binary files a/Source/RomDsk/ROM_512KB/ZAP.COM and b/Source/RomDsk/ROM_512KB/ZAP.COM differ diff --git a/Source/ZPM3/loader.asm b/Source/ZPM3/loader.asm index 979ef532..0a417849 100644 --- a/Source/ZPM3/loader.asm +++ b/Source/ZPM3/loader.asm @@ -31,17 +31,16 @@ SYS_ENT .EQU $0100 ; SYSTEM (OS) ENTRY POINT ADDRESS SYS_LOC .EQU $0100 ; STARTING ADDRESS TO LOAD SYSTEM IMAGE SYS_END .EQU $1480 ; ENDING ADDRESS OF SYSTEM IMAGE ; -BYT .EQU 1 ; used to describe METADATA_SIZE below -WRD .EQU 2 +SEC_SIZE .EQU 512 ; DISK SECTOR SIZE +BLK_SIZE .EQU 128 ; OS BLOCK/RECORD SIZE ; -SECTOR_SIZE .EQU 512 -BLOCK_SIZE .EQU 128 -PREFIX_SIZE .EQU (3 * SECTOR_SIZE) ; 3 SECTORS -METADATA_SIZE .EQU BYT+WRD+(4*BYT)+16+BYT+WRD+WRD+WRD+WRD ; (as defined below) +PREFIX_SIZE .EQU (SEC_SIZE * 3) ; 3 SECTORS ; -PARTTBL_LOC .EQU $1BE -PARTTBL_SIZ .EQU $40 -BOOTSIG_LOC .EQU $1FE +META_SIZE .EQU 32 ; SEE BELOW +META_LOC .EQU (PREFIX_SIZE - META_SIZE) +; +PT_LOC .EQU $1BE +PT_SIZ .EQU $40 ; ;------------------------------------------------------------------------------- ; SECTOR 1 @@ -52,7 +51,8 @@ BOOTSIG_LOC .EQU $1FE ;---------------------------------------------------------------------------- ; ; THE FOLLOWING BOOTSTRAP CODE IS BUILT TO ASSUME IT WILL BE EXECUTED AT A STARTING -; ADDRESS OF $8000. +; ADDRESS OF $8000. THIS CODE IS *ONLY* FOR UNA. THE ROMWBW ROM BOOTLOADER +; USES THE METADATA TO LOAD THE OS DIRECTLY. ; .ORG $8000 JR BOOT @@ -145,10 +145,10 @@ HEXASCII: ; CONVERT LOW NIBBLE OF A TO ASCII HEX ; HEXCONV: - AND 0FH ;LOW NIBBLE ONLY - ADD A,90H + AND $0F ;LOW NIBBLE ONLY + ADD A,$90 DAA - ADC A,40H + ADC A,$40 DAA RET ; @@ -163,17 +163,17 @@ STR_LOAD .DB "\r\nLoading",0 STR_DONE .DB "\r\n",0 STR_ERR .DB " Read Error!",0 ; - .ORG $ - $8000 ; RESTORE ORG - .FILL PARTTBL_LOC - $ ; FILL TO START OF PARTITION TABLE + .ORG $ - $8000 ; BACK TO ABSOLUTE ADDRESS +; + .FILL PT_LOC - $,0 ; FILL TO START OF PARTITION TABLE ; ; RESERVE SPACE FOR STANDARD IBM-PC PARTITION TABLE. ALTHOUGH A ; PARTITION TABLE IS NOT RELEVANT FOR A FLOPPY DISK, IT DOES NO HARM. ; THE CONTENTS OF THE PARTITION TABLE MUST BE MANAGED BY FDISK80. ; -PARTTBL .FILL PARTTBL_SIZ,$00 ; PARTITION TABLE, FILL WITH ZEROES +PARTTBL .FILL PT_SIZ,0 ; PARTITION TABLE, FILL WITH ZEROES ; -; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT -; SIGNATURE. +; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT SIGNATURE. ; BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; @@ -184,7 +184,7 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 512,0 ; JUST FILL SECTOR WITH ZEROES + .FILL SEC_SIZE,0 ; JUST FILL SECTOR WITH ZEROES ; ;------------------------------------------------------------------------------- ; SECTOR 3 @@ -193,36 +193,34 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 128 * 3,0 ; FIRST 384 BYTES ARE NOT YET DEFINED + .FILL (BLK_SIZE * 3),0 ; FIRST 384 BYTES ARE NOT YET DEFINED ; ; THE FOLLOWING TWO BYTES ARE AN ADDITIONAL SIGNATURE THAT IS VERIFIED BY ; SOME HARDWARE BIOSES. ; PR_SIG .DB $5A,$A5 ; SIGNATURE GOES HERE ; -; FIRST CHUNK OF METADATA IMMEDIATELY FOLLOWS THE SIGNATURE BYTES -; -PR_PLATFORM .DB 0 ; PLATFORM ID (SEE STD.ASM) -PR_DEVICE .DB 0 ; ? (PROBABLY UNUSED) -PR_FORMATTER .DB 0,0,0,0,0,0,0,0 ; ? (PROBABLY UNUSED) -PR_DRIVE .DB 0 ; ? (PROBABLY UNUSED) -PR_LOG_UNIT .DW 0 ; ? (PROBABLY UNUSED) -; -; FILLER TO PLACE SECOND CHUNK OF METADATA AT THE END OF THE SECTOR -; - .FILL ((PREFIX_SIZE - METADATA_SIZE) - $),00H + .FILL (META_LOC - $),0 ; -; SECOND CHUNK OF METADATA +; METADATA ; -PR_WP .DB 0 ; WRITE PROTECT BOOLEADN -PR_UPDSEQ .DW 0 ; PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) -PR_VER .DB RMJ,RMN,RUP,RTP ; OS BUILD VERSION -PR_LABEL .DB "Unlabeled Drive ","$" ; DISK LABEL (EXACTLY 16 BYTES!!!) - .DW 0 ; DEPRECATED -PR_LDLOC .DW SYS_LOC ; ADDRESS TO START LOADING SYSTEM -PR_LDEND .DW SYS_END ; ADDRESS TO STOP LOADING SYSTEM -PR_ENTRY .DW SYS_ENT ; ADDRESS TO ENTER SYSTEM (OS) +PR_WP .DB 0 ; (1) WRITE PROTECT BOOLEAN +PR_UPDSEQ .DW 0 ; (2) PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) +PR_VER .DB RMJ,RMN,RUP,RTP ; (4) OS BUILD VERSION +PR_LABEL .DB "Unlabeled Drive ","$" ; (17) DISK LABEL (EXACTLY 16 BYTES!!!) + .DW 0 ; (2) DEPRECATED +PR_LDLOC .DW SYS_LOC ; (2) ADDRESS TO START LOADING SYSTEM +PR_LDEND .DW SYS_END ; (2) ADDRESS TO STOP LOADING SYSTEM +PR_ENTRY .DW SYS_ENT ; (2) ADDRESS TO ENTER SYSTEM (OS) ; +#IF (META_SIZE != ($ - META_LOC)) + .ECHO "META_SIZE VALUE IS WRONG!!!\r\n" + !!! +#ENDIF ; +#IF ($ != PREFIX_SIZE) + .ECHO "LOADER PREFIX IS WRONG SIZE!!!\r\n" + !!! +#ENDIF ; - .END + .END diff --git a/Source/ZSDOS/loader.asm b/Source/ZSDOS/loader.asm index 74f2a6b7..d60c0b16 100644 --- a/Source/ZSDOS/loader.asm +++ b/Source/ZSDOS/loader.asm @@ -1,5 +1,5 @@ ;=============================================================================== -; BL.ASM +; LOADER.ASM ; ; BOOTLOADER FOR ROMWBW DISK OPERATING SYSTEMS. ; @@ -31,17 +31,16 @@ SYS_ENT .EQU $E600 ; SYSTEM (OS) ENTRY POINT ADDRESS SYS_LOC .EQU $D000 ; STARTING ADDRESS TO LOAD SYSTEM IMAGE SYS_END .EQU $FE00 ; ENDING ADDRESS OF SYSTEM IMAGE ; -BYT .EQU 1 ; used to describe METADATA_SIZE below -WRD .EQU 2 +SEC_SIZE .EQU 512 ; DISK SECTOR SIZE +BLK_SIZE .EQU 128 ; OS BLOCK/RECORD SIZE ; -SECTOR_SIZE .EQU 512 -BLOCK_SIZE .EQU 128 -PREFIX_SIZE .EQU (3 * SECTOR_SIZE) ; 3 SECTORS -METADATA_SIZE .EQU BYT+WRD+(4*BYT)+16+BYT+WRD+WRD+WRD+WRD ; (as defined below) +PREFIX_SIZE .EQU (SEC_SIZE * 3) ; 3 SECTORS ; -PARTTBL_LOC .EQU $1BE -PARTTBL_SIZ .EQU $40 -BOOTSIG_LOC .EQU $1FE +META_SIZE .EQU 32 ; SEE BELOW +META_LOC .EQU (PREFIX_SIZE - META_SIZE) +; +PT_LOC .EQU $1BE +PT_SIZ .EQU $40 ; ;------------------------------------------------------------------------------- ; SECTOR 1 @@ -52,7 +51,8 @@ BOOTSIG_LOC .EQU $1FE ;---------------------------------------------------------------------------- ; ; THE FOLLOWING BOOTSTRAP CODE IS BUILT TO ASSUME IT WILL BE EXECUTED AT A STARTING -; ADDRESS OF $8000. +; ADDRESS OF $8000. THIS CODE IS *ONLY* FOR UNA. THE ROMWBW ROM BOOTLOADER +; USES THE METADATA TO LOAD THE OS DIRECTLY. ; .ORG $8000 JR BOOT @@ -145,10 +145,10 @@ HEXASCII: ; CONVERT LOW NIBBLE OF A TO ASCII HEX ; HEXCONV: - AND 0FH ;LOW NIBBLE ONLY - ADD A,90H + AND $0F ;LOW NIBBLE ONLY + ADD A,$90 DAA - ADC A,40H + ADC A,$40 DAA RET ; @@ -163,17 +163,17 @@ STR_LOAD .DB "\r\nLoading",0 STR_DONE .DB "\r\n",0 STR_ERR .DB " Read Error!",0 ; - .ORG $ - $8000 ; RESTORE ORG - .FILL PARTTBL_LOC - $ ; FILL TO START OF PARTITION TABLE + .ORG $ - $8000 ; BACK TO ABSOLUTE ADDRESS +; + .FILL PT_LOC - $,0 ; FILL TO START OF PARTITION TABLE ; ; RESERVE SPACE FOR STANDARD IBM-PC PARTITION TABLE. ALTHOUGH A ; PARTITION TABLE IS NOT RELEVANT FOR A FLOPPY DISK, IT DOES NO HARM. ; THE CONTENTS OF THE PARTITION TABLE MUST BE MANAGED BY FDISK80. ; -PARTTBL .FILL PARTTBL_SIZ,$00 ; PARTITION TABLE, FILL WITH ZEROES +PARTTBL .FILL PT_SIZ,0 ; PARTITION TABLE, FILL WITH ZEROES ; -; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT -; SIGNATURE. +; THE END OF THE FIRST SECTOR MUST CONTAIN THE TWO BYTE BOOT SIGNATURE. ; BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; @@ -184,7 +184,7 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 512,0 ; JUST FILL SECTOR WITH ZEROES + .FILL SEC_SIZE,0 ; JUST FILL SECTOR WITH ZEROES ; ;------------------------------------------------------------------------------- ; SECTOR 3 @@ -193,36 +193,34 @@ BOOTSIG .DB $55,$AA ; STANDARD BOOT SIGNATURE ; ;---------------------------------------------------------------------------- ; - .FILL 128 * 3,0 ; FIRST 384 BYTES ARE NOT YET DEFINED + .FILL (BLK_SIZE * 3),0 ; FIRST 384 BYTES ARE NOT YET DEFINED ; ; THE FOLLOWING TWO BYTES ARE AN ADDITIONAL SIGNATURE THAT IS VERIFIED BY ; SOME HARDWARE BIOSES. ; PR_SIG .DB $5A,$A5 ; SIGNATURE GOES HERE ; -; FIRST CHUNK OF METADATA IMMEDIATELY FOLLOWS THE SIGNATURE BYTES -; -PR_PLATFORM .DB 0 ; PLATFORM ID (SEE STD.ASM) -PR_DEVICE .DB 0 ; ? (PROBABLY UNUSED) -PR_FORMATTER .DB 0,0,0,0,0,0,0,0 ; ? (PROBABLY UNUSED) -PR_DRIVE .DB 0 ; ? (PROBABLY UNUSED) -PR_LOG_UNIT .DW 0 ; ? (PROBABLY UNUSED) -; -; FILLER TO PLACE SECOND CHUNK OF METADATA AT THE END OF THE SECTOR -; - .FILL ((PREFIX_SIZE - METADATA_SIZE) - $),00H + .FILL (META_LOC - $),0 ; -; SECOND CHUNK OF METADATA +; METADATA ; -PR_WP .DB 0 ; WRITE PROTECT BOOLEADN -PR_UPDSEQ .DW 0 ; PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) -PR_VER .DB RMJ,RMN,RUP,RTP ; OS BUILD VERSION -PR_LABEL .DB "Unlabeled Drive ","$" ; DISK LABEL (EXACTLY 16 BYTES!!!) - .DW 0 ; DEPRECATED -PR_LDLOC .DW SYS_LOC ; ADDRESS TO START LOADING SYSTEM -PR_LDEND .DW SYS_END ; ADDRESS TO STOP LOADING SYSTEM -PR_ENTRY .DW SYS_ENT ; ADDRESS TO ENTER SYSTEM (OS) +PR_WP .DB 0 ; (1) WRITE PROTECT BOOLEAN +PR_UPDSEQ .DW 0 ; (2) PREFIX UPDATE SEQUENCE NUMBER (DEPRECATED?) +PR_VER .DB RMJ,RMN,RUP,RTP ; (4) OS BUILD VERSION +PR_LABEL .DB "Unlabeled Drive ","$" ; (17) DISK LABEL (EXACTLY 16 BYTES!!!) + .DW 0 ; (2) DEPRECATED +PR_LDLOC .DW SYS_LOC ; (2) ADDRESS TO START LOADING SYSTEM +PR_LDEND .DW SYS_END ; (2) ADDRESS TO STOP LOADING SYSTEM +PR_ENTRY .DW SYS_ENT ; (2) ADDRESS TO ENTER SYSTEM (OS) ; +#IF (META_SIZE != ($ - META_LOC)) + .ECHO "META_SIZE VALUE IS WRONG!!!\r\n" + !!! +#ENDIF ; +#IF ($ != PREFIX_SIZE) + .ECHO "LOADER PREFIX IS WRONG SIZE!!!\r\n" + !!! +#ENDIF ; - .END + .END