diff --git a/Doc/ChangeLog.txt b/Doc/ChangeLog.txt index 214e9dac..fbd670a7 100644 --- a/Doc/ChangeLog.txt +++ b/Doc/ChangeLog.txt @@ -39,6 +39,7 @@ Version 3.5 - WBW: Add Warm/Cold reboot options to CPUSPD utility - D?N: Added support for eZ80 CPU - MAP: Contributed COPYSL utility +- MAP: Added new HBIOS function SYSGET_DIOMED Version 3.4 ----------- diff --git a/Doc/RomWBW Applications.pdf b/Doc/RomWBW Applications.pdf index cef5b316..37b03ef9 100644 Binary files a/Doc/RomWBW Applications.pdf and b/Doc/RomWBW Applications.pdf differ diff --git a/Doc/RomWBW Disk Catalog.pdf b/Doc/RomWBW Disk Catalog.pdf index 316f02f0..a1075823 100644 Binary files a/Doc/RomWBW Disk Catalog.pdf and b/Doc/RomWBW Disk Catalog.pdf differ diff --git a/Doc/RomWBW Errata.pdf b/Doc/RomWBW Errata.pdf index f189aa1f..9e9d71d9 100644 Binary files a/Doc/RomWBW Errata.pdf and b/Doc/RomWBW Errata.pdf differ diff --git a/Doc/RomWBW System Guide.pdf b/Doc/RomWBW System Guide.pdf index eb0909ed..2b383e04 100644 Binary files a/Doc/RomWBW System Guide.pdf and b/Doc/RomWBW System Guide.pdf differ diff --git a/Doc/RomWBW User Guide.pdf b/Doc/RomWBW User Guide.pdf index 9404b1a9..62762828 100644 Binary files a/Doc/RomWBW User Guide.pdf and b/Doc/RomWBW User Guide.pdf differ diff --git a/ReadMe.md b/ReadMe.md index 3be45541..d50046ad 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,293 +1,293 @@ - - -**RomWBW ReadMe** \ -Version 3.5 \ -Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \ -27 Sep 2024 - -# Overview - -RomWBW software provides a complete, commercial quality implementation -of CP/M (and workalike) operating systems and applications for modern -Z80/180/280 retro-computing hardware systems. A wide variety of -platforms are supported including those produced by these developer -communities: - -- [RetroBrew Computers](https://www.retrobrewcomputers.org) - () -- [RC2014](https://rc2014.co.uk) (), - [RC2014-Z80](https://groups.google.com/g/rc2014-z80) - () -- [Retro Computing](https://groups.google.com/g/retro-comp) - () -- [Small Computer Central](https://smallcomputercentral.com/) - () - -A complete list of the currently supported platforms is found in the -\[Installation\] section. - -General features include: - -- Z80 Family CPUs including Z80, Z180, and Z280 -- Banked memory services for several banking designs -- Disk drivers for RAM, ROM, Floppy, IDE ATA/ATAPI, CF, SD, USB, Zip, - Iomega -- Serial drivers including UART (16550-like), ASCI, ACIA, SIO -- Video drivers including TMS9918, SY6545, MOS8563, HD6445 -- Keyboard (PS/2) drivers via VT8242 or PPI interfaces -- Real time clock drivers including DS1302, BQ4845 -- OSes: CP/M 2.2, ZSDOS, CP/M 3, NZ-COM, ZPM3, QPM, p-System, and - FreeRTOS -- Built-in VT-100 terminal emulation support - -RomWBW is distributed as both source code and pre-built ROM and disk -images. Some of the provided software can be launched directly from the -ROM firmware itself: - -- System Monitor -- Operating Systems (CP/M 2.2, ZSDOS) -- ROM BASIC (Nascom BASIC and Tasty BASIC) -- ROM Forth - -A dynamic disk drive letter assignment mechanism allows mapping -operating system drive letters to any available disk media. -Additionally, mass storage devices (IDE Disk, CF Card, SD Card, etc.) -support the use of multiple slices (up to 256 per device). Each slice -contains a complete CP/M filesystem and can be mapped independently to -any drive letter. This overcomes the inherent size limitations in legacy -OSes and allows up to 2GB of accessible storage on a single device. - -The pre-built ROM firmware images are generally suitable for most users. -However, it is also very easy to modify and build custom ROM images that -fully tailor the firmware to your specific preferences. All tools -required to build custom ROM firmware under Windows are included – no -need to install assemblers, etc. The firmware can also be built using -Linux or MacOS after confirming a few standard tools have been -installed. - -Multiple disk images are provided in the distribution. Most disk images -contain a complete, bootable, ready-to-run implementation of a specific -operating system. A “combo” disk image contains multiple slices, each -with a full operating system implementation. If you use this disk image, -you can easily pick whichever operating system you want to boot without -changing media. - -By design, RomWBW isolates all of the hardware specific functions in the -ROM chip itself. The ROM provides a hardware abstraction layer such that -all of the operating systems and applications on a disk will run on any -RomWBW-based system. To put it simply, you can take a disk (or CF/SD/USB -Card) and move it between systems transparently. - -A tool is provided that allows you to access a FAT-12/16/32 filesystem. -The FAT filesystem may be coresident on the same disk media as RomWBW -slices or on stand-alone media. This makes exchanging files with modern -OSes such as Windows, MacOS, and Linux very easy. - -# Acquiring RomWBW - -The [RomWBW Repository](https://github.com/wwarthen/RomWBW) -() on GitHub is the official -distribution location for all project source and documentation. The -fully-built distribution releases are available on the [RomWBW Releases -Page](https://github.com/wwarthen/RomWBW/releases) -() of the repository. On -this page, you will normally see a Development Snapshot as well as -recent stable releases. Unless you have a specific reason, I suggest you -stick to the most recent stable release. Expand the “Assets” drop-down -for the release you want to download, then select the asset named -RomWBW-vX.X.X-Package.zip. The Package asset includes all pre-built ROM -and Disk images as well as full source code. The other assets contain -only source code and do not have the pre-built ROM or disk images. - -All source code and distributions are maintained on GitHub. Code -contributions are very welcome. - -# Installation & Operation - -In general, installation of RomWBW on your platform is very simple. You -just need to program your ROM with the correct ROM image from the RomWBW -distribution. Subsequently, you can write disk images on your disk -drives (IDE disk, CF Card, SD Card, etc.) which then provides even more -functionality. - -Complete instructions for installation and operation of RomWBW are found -in the [RomWBW User -Guide](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20User%20Guide.pdf). - -## Documentation - -Documentation for RomWBW includes: - -- [RomWBW User - Guide](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20User%20Guide.pdf) -- [RomWBW System - Guide](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20System%20Guide.pdf) -- [RomWBW - Applications](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20Applications.pdf) -- [RomWBW - Errata](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20Errata.pdf) - -# Acknowledgments - -I want to acknowledge that a great deal of the code and inspiration for -RomWBW has been provided by or derived from the work of others in the -RetroBrew Computers Community. I sincerely appreciate all of their -contributions. The list below is probably missing many names – please -let me know if I missed you! - -- Andrew Lynch started it all when he created the N8VEM Z80 SBC which - became the first platform RomWBW supported. Some of his original code - can still be found in RomWBW. - -- Dan Werner wrote much of the code from which RomWBW was originally - derived and he has always been a great source of knowledge and advice. - -- Douglas Goodall contributed code, time, testing, and advice in “the - early days”. He created an entire suite of application programs to - enhance the use of RomWBW. Unfortunately, they have become unusable - due to internal changes within RomWBW. As of RomWBW 2.6, these - applications are no longer provided. - -- Sergey Kiselev created several hardware platforms for RomWBW including - the very popular Zeta. - -- David Giles created support for the Z180 CSIO which is now included SD - Card driver. - -- Phil Summers contributed the Forth and BASIC adaptations in ROM, the - AY-3-8910 sound driver, DMA support, and a long list of general code - and documentation enhancements. - -- Ed Brindley contributed some of the code that supports the RCBus - platform. - -- Spencer Owen created the RC2014 series of hobbyist kit computers which - has exponentially increased RomWBW usage. Some of his kits include - RomWBW. - -- Stephen Cousins has likewise created a series of hobbyist kit - computers at Small Computer Central and is distributing RomWBW with - many of them. - -- Alan Cox has contributed some driver code and has provided a great - deal of advice. - -- The CP/NET client files were developed by Douglas Miller. - -- Phillip Stevens contributed support for FreeRTOS. - -- Curt Mayer contributed the original Linux / MacOS build process. - -- UNA BIOS and FDISK80 are the products of John Coffman. - -- FLASH4 is a product of Will Sowerbutts. - -- CLRDIR is a product of Max Scane. - -- Tasty Basic is a product of Dimitri Theulings. - -- Dean Netherton contributed eZ80 CPU support, the sound driver - interface, and the SN76489 sound driver. - -- The RomWBW Disk Catalog document was produced by Mykl Orders. - -- Rob Prouse has created many of the supplemental disk images including - Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft BASIC Compiler, - Microsoft Fortran Compiler, and a Games compendium. - -- Martin R has provided substantial help reviewing and improving the - User Guide and Applications documents. - -- Mark Pruden has also contributed a great deal of content to the User - Guide as well as the COPYSL utility. - -- Jacques Pelletier has contributed the DS1501 RTC driver code. - -- Jose Collado has contributed enhancements to the TMS driver including - compatibility with standard TMS register configuration. - -- Kevin Boone has contributed a generic HBIOS date/time utility (WDATE). - -- Matt Carroll has contributed a fix to XM.COM that corrects the port - specification when doing a send. - -- Dean Jenkins enhanced the build process to accommodate the Raspberry - Pi 4. - -- Tom Plano has contributed a new utility (HTALK) to allow talking - directly to HBIOS COM ports. - -- Lars Nelson has contributed several generic utilities such as a - universal (OS agnostic) UNARC application. - -- Dylan Hall added support for specifying a secondary console. - -- Bill Shen has contributed boot loaders for several of his systems. - -- Laszlo Szolnoki has contributed an EF9345 video display controller - driver. - -- Ladislau Szilagyi has contributed an enhanced version of CP/M Cowgol - that leverages RomWBW memory banking. - -- Les Bird has contributed support for the NABU w/ Option Board - -Contributions of all kinds to RomWBW are very welcome. - -# Licensing - -RomWBW is free software: you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation, either version 3 of the License, or (at your -option) any later version. - -RomWBW is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -more details. - -You should have received a copy of the GNU General Public License along -with RomWBW. If not, see . - -Portions of RomWBW were created by, contributed by, or derived from the -work of others. It is believed that these works are being used in -accordance with the intentions and/or licensing of their creators. - -If anyone feels their work is being used outside of its intended -licensing, please notify: - -> Wayne Warthen -> - -RomWBW is an aggregate work. It is composed of many individual, -standalone programs that are distributed as a whole to function as a -cohesive system. Each program may have its own licensing which may be -different from other programs within the aggregate. - -In some cases, a single program (e.g., CP/M Operating System) is -composed of multiple components with different licenses. It is believed -that in all such cases the licenses are compatible with GPL version 3. - -RomWBW encourages code contributions from others. Contributors may -assert their own copyright in their contributions by annotating the -contributed source code appropriately. Contributors are further -encouraged to submit their contributions via the RomWBW source code -control system to ensure their contributions are clearly documented. - -All contributions to RomWBW are subject to this license. - -# Getting Assistance - -The best way to get assistance with RomWBW or any aspect of the -RetroBrew Computers projects is via one of the community forums: - -- [RetroBrew Computers Forum](https://www.retrobrewcomputers.org/forum/) -- [RC2014 Google - Group](https://groups.google.com/forum/#!forum/rc2014-z80) -- [retro-comp Google - Group](https://groups.google.com/forum/#!forum/retro-comp) - -Submission of issues and bugs are welcome at the [RomWBW GitHub -Repository](https://github.com/wwarthen/RomWBW). - -Also feel free to email Wayne Warthen at . + + +**RomWBW ReadMe** \ +Version 3.5 \ +Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \ +05 Oct 2024 + +# Overview + +RomWBW software provides a complete, commercial quality implementation +of CP/M (and workalike) operating systems and applications for modern +Z80/180/280 retro-computing hardware systems. A wide variety of +platforms are supported including those produced by these developer +communities: + +- [RetroBrew Computers](https://www.retrobrewcomputers.org) + () +- [RC2014](https://rc2014.co.uk) (), + [RC2014-Z80](https://groups.google.com/g/rc2014-z80) + () +- [Retro Computing](https://groups.google.com/g/retro-comp) + () +- [Small Computer Central](https://smallcomputercentral.com/) + () + +A complete list of the currently supported platforms is found in the +\[Installation\] section. + +General features include: + +- Z80 Family CPUs including Z80, Z180, and Z280 +- Banked memory services for several banking designs +- Disk drivers for RAM, ROM, Floppy, IDE ATA/ATAPI, CF, SD, USB, Zip, + Iomega +- Serial drivers including UART (16550-like), ASCI, ACIA, SIO +- Video drivers including TMS9918, SY6545, MOS8563, HD6445 +- Keyboard (PS/2) drivers via VT8242 or PPI interfaces +- Real time clock drivers including DS1302, BQ4845 +- OSes: CP/M 2.2, ZSDOS, CP/M 3, NZ-COM, ZPM3, QPM, p-System, and + FreeRTOS +- Built-in VT-100 terminal emulation support + +RomWBW is distributed as both source code and pre-built ROM and disk +images. Some of the provided software can be launched directly from the +ROM firmware itself: + +- System Monitor +- Operating Systems (CP/M 2.2, ZSDOS) +- ROM BASIC (Nascom BASIC and Tasty BASIC) +- ROM Forth + +A dynamic disk drive letter assignment mechanism allows mapping +operating system drive letters to any available disk media. +Additionally, mass storage devices (IDE Disk, CF Card, SD Card, etc.) +support the use of multiple slices (up to 256 per device). Each slice +contains a complete CP/M filesystem and can be mapped independently to +any drive letter. This overcomes the inherent size limitations in legacy +OSes and allows up to 2GB of accessible storage on a single device. + +The pre-built ROM firmware images are generally suitable for most users. +However, it is also very easy to modify and build custom ROM images that +fully tailor the firmware to your specific preferences. All tools +required to build custom ROM firmware under Windows are included – no +need to install assemblers, etc. The firmware can also be built using +Linux or MacOS after confirming a few standard tools have been +installed. + +Multiple disk images are provided in the distribution. Most disk images +contain a complete, bootable, ready-to-run implementation of a specific +operating system. A “combo” disk image contains multiple slices, each +with a full operating system implementation. If you use this disk image, +you can easily pick whichever operating system you want to boot without +changing media. + +By design, RomWBW isolates all of the hardware specific functions in the +ROM chip itself. The ROM provides a hardware abstraction layer such that +all of the operating systems and applications on a disk will run on any +RomWBW-based system. To put it simply, you can take a disk (or CF/SD/USB +Card) and move it between systems transparently. + +A tool is provided that allows you to access a FAT-12/16/32 filesystem. +The FAT filesystem may be coresident on the same disk media as RomWBW +slices or on stand-alone media. This makes exchanging files with modern +OSes such as Windows, MacOS, and Linux very easy. + +# Acquiring RomWBW + +The [RomWBW Repository](https://github.com/wwarthen/RomWBW) +() on GitHub is the official +distribution location for all project source and documentation. The +fully-built distribution releases are available on the [RomWBW Releases +Page](https://github.com/wwarthen/RomWBW/releases) +() of the repository. On +this page, you will normally see a Development Snapshot as well as +recent stable releases. Unless you have a specific reason, I suggest you +stick to the most recent stable release. Expand the “Assets” drop-down +for the release you want to download, then select the asset named +RomWBW-vX.X.X-Package.zip. The Package asset includes all pre-built ROM +and Disk images as well as full source code. The other assets contain +only source code and do not have the pre-built ROM or disk images. + +All source code and distributions are maintained on GitHub. Code +contributions are very welcome. + +# Installation & Operation + +In general, installation of RomWBW on your platform is very simple. You +just need to program your ROM with the correct ROM image from the RomWBW +distribution. Subsequently, you can write disk images on your disk +drives (IDE disk, CF Card, SD Card, etc.) which then provides even more +functionality. + +Complete instructions for installation and operation of RomWBW are found +in the [RomWBW User +Guide](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20User%20Guide.pdf). + +## Documentation + +Documentation for RomWBW includes: + +- [RomWBW User + Guide](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20User%20Guide.pdf) +- [RomWBW System + Guide](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20System%20Guide.pdf) +- [RomWBW + Applications](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20Applications.pdf) +- [RomWBW + Errata](https://github.com/wwarthen/RomWBW/raw/master/Doc/RomWBW%20Errata.pdf) + +# Acknowledgments + +I want to acknowledge that a great deal of the code and inspiration for +RomWBW has been provided by or derived from the work of others in the +RetroBrew Computers Community. I sincerely appreciate all of their +contributions. The list below is probably missing many names – please +let me know if I missed you! + +- Andrew Lynch started it all when he created the N8VEM Z80 SBC which + became the first platform RomWBW supported. Some of his original code + can still be found in RomWBW. + +- Dan Werner wrote much of the code from which RomWBW was originally + derived and he has always been a great source of knowledge and advice. + +- Douglas Goodall contributed code, time, testing, and advice in “the + early days”. He created an entire suite of application programs to + enhance the use of RomWBW. Unfortunately, they have become unusable + due to internal changes within RomWBW. As of RomWBW 2.6, these + applications are no longer provided. + +- Sergey Kiselev created several hardware platforms for RomWBW including + the very popular Zeta. + +- David Giles created support for the Z180 CSIO which is now included SD + Card driver. + +- Phil Summers contributed the Forth and BASIC adaptations in ROM, the + AY-3-8910 sound driver, DMA support, and a long list of general code + and documentation enhancements. + +- Ed Brindley contributed some of the code that supports the RCBus + platform. + +- Spencer Owen created the RC2014 series of hobbyist kit computers which + has exponentially increased RomWBW usage. Some of his kits include + RomWBW. + +- Stephen Cousins has likewise created a series of hobbyist kit + computers at Small Computer Central and is distributing RomWBW with + many of them. + +- Alan Cox has contributed some driver code and has provided a great + deal of advice. + +- The CP/NET client files were developed by Douglas Miller. + +- Phillip Stevens contributed support for FreeRTOS. + +- Curt Mayer contributed the original Linux / MacOS build process. + +- UNA BIOS and FDISK80 are the products of John Coffman. + +- FLASH4 is a product of Will Sowerbutts. + +- CLRDIR is a product of Max Scane. + +- Tasty Basic is a product of Dimitri Theulings. + +- Dean Netherton contributed eZ80 CPU support, the sound driver + interface, and the SN76489 sound driver. + +- The RomWBW Disk Catalog document was produced by Mykl Orders. + +- Rob Prouse has created many of the supplemental disk images including + Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft BASIC Compiler, + Microsoft Fortran Compiler, and a Games compendium. + +- Martin R has provided substantial help reviewing and improving the + User Guide and Applications documents. + +- Mark Pruden has also contributed a great deal of content to the User + Guide as well as the COPYSL utility. + +- Jacques Pelletier has contributed the DS1501 RTC driver code. + +- Jose Collado has contributed enhancements to the TMS driver including + compatibility with standard TMS register configuration. + +- Kevin Boone has contributed a generic HBIOS date/time utility (WDATE). + +- Matt Carroll has contributed a fix to XM.COM that corrects the port + specification when doing a send. + +- Dean Jenkins enhanced the build process to accommodate the Raspberry + Pi 4. + +- Tom Plano has contributed a new utility (HTALK) to allow talking + directly to HBIOS COM ports. + +- Lars Nelson has contributed several generic utilities such as a + universal (OS agnostic) UNARC application. + +- Dylan Hall added support for specifying a secondary console. + +- Bill Shen has contributed boot loaders for several of his systems. + +- Laszlo Szolnoki has contributed an EF9345 video display controller + driver. + +- Ladislau Szilagyi has contributed an enhanced version of CP/M Cowgol + that leverages RomWBW memory banking. + +- Les Bird has contributed support for the NABU w/ Option Board + +Contributions of all kinds to RomWBW are very welcome. + +# Licensing + +RomWBW is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your +option) any later version. + +RomWBW is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +more details. + +You should have received a copy of the GNU General Public License along +with RomWBW. If not, see . + +Portions of RomWBW were created by, contributed by, or derived from the +work of others. It is believed that these works are being used in +accordance with the intentions and/or licensing of their creators. + +If anyone feels their work is being used outside of its intended +licensing, please notify: + +> Wayne Warthen +> + +RomWBW is an aggregate work. It is composed of many individual, +standalone programs that are distributed as a whole to function as a +cohesive system. Each program may have its own licensing which may be +different from other programs within the aggregate. + +In some cases, a single program (e.g., CP/M Operating System) is +composed of multiple components with different licenses. It is believed +that in all such cases the licenses are compatible with GPL version 3. + +RomWBW encourages code contributions from others. Contributors may +assert their own copyright in their contributions by annotating the +contributed source code appropriately. Contributors are further +encouraged to submit their contributions via the RomWBW source code +control system to ensure their contributions are clearly documented. + +All contributions to RomWBW are subject to this license. + +# Getting Assistance + +The best way to get assistance with RomWBW or any aspect of the +RetroBrew Computers projects is via one of the community forums: + +- [RetroBrew Computers Forum](https://www.retrobrewcomputers.org/forum/) +- [RC2014 Google + Group](https://groups.google.com/forum/#!forum/rc2014-z80) +- [retro-comp Google + Group](https://groups.google.com/forum/#!forum/retro-comp) + +Submission of issues and bugs are welcome at the [RomWBW GitHub +Repository](https://github.com/wwarthen/RomWBW). + +Also feel free to email Wayne Warthen at . diff --git a/ReadMe.txt b/ReadMe.txt index aeac66fc..440fbc13 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -1,299 +1,298 @@ -RomWBW ReadMe -Wayne Warthen (wwarthen@gmail.com) -27 Sep 2024 - - - -OVERVIEW - - -RomWBW software provides a complete, commercial quality implementation -of CP/M (and workalike) operating systems and applications for modern -Z80/180/280 retro-computing hardware systems. A wide variety of -platforms are supported including those produced by these developer -communities: - -- RetroBrew Computers (https://www.retrobrewcomputers.org) -- RC2014 (https://rc2014.co.uk), - RC2014-Z80 (https://groups.google.com/g/rc2014-z80) -- Retro Computing (https://groups.google.com/g/retro-comp) -- Small Computer Central (https://smallcomputercentral.com/) - -A complete list of the currently supported platforms is found in the -[Installation] section. - -General features include: - -- Z80 Family CPUs including Z80, Z180, and Z280 -- Banked memory services for several banking designs -- Disk drivers for RAM, ROM, Floppy, IDE ATA/ATAPI, CF, SD, USB, Zip, - Iomega -- Serial drivers including UART (16550-like), ASCI, ACIA, SIO -- Video drivers including TMS9918, SY6545, MOS8563, HD6445 -- Keyboard (PS/2) drivers via VT8242 or PPI interfaces -- Real time clock drivers including DS1302, BQ4845 -- OSes: CP/M 2.2, ZSDOS, CP/M 3, NZ-COM, ZPM3, QPM, p-System, and - FreeRTOS -- Built-in VT-100 terminal emulation support - -RomWBW is distributed as both source code and pre-built ROM and disk -images. Some of the provided software can be launched directly from the -ROM firmware itself: - -- System Monitor -- Operating Systems (CP/M 2.2, ZSDOS) -- ROM BASIC (Nascom BASIC and Tasty BASIC) -- ROM Forth - -A dynamic disk drive letter assignment mechanism allows mapping -operating system drive letters to any available disk media. -Additionally, mass storage devices (IDE Disk, CF Card, SD Card, etc.) -support the use of multiple slices (up to 256 per device). Each slice -contains a complete CP/M filesystem and can be mapped independently to -any drive letter. This overcomes the inherent size limitations in legacy -OSes and allows up to 2GB of accessible storage on a single device. - -The pre-built ROM firmware images are generally suitable for most users. -However, it is also very easy to modify and build custom ROM images that -fully tailor the firmware to your specific preferences. All tools -required to build custom ROM firmware under Windows are included – no -need to install assemblers, etc. The firmware can also be built using -Linux or MacOS after confirming a few standard tools have been -installed. - -Multiple disk images are provided in the distribution. Most disk images -contain a complete, bootable, ready-to-run implementation of a specific -operating system. A “combo” disk image contains multiple slices, each -with a full operating system implementation. If you use this disk image, -you can easily pick whichever operating system you want to boot without -changing media. - -By design, RomWBW isolates all of the hardware specific functions in the -ROM chip itself. The ROM provides a hardware abstraction layer such that -all of the operating systems and applications on a disk will run on any -RomWBW-based system. To put it simply, you can take a disk (or CF/SD/USB -Card) and move it between systems transparently. - -A tool is provided that allows you to access a FAT-12/16/32 filesystem. -The FAT filesystem may be coresident on the same disk media as RomWBW -slices or on stand-alone media. This makes exchanging files with modern -OSes such as Windows, MacOS, and Linux very easy. - - - -ACQUIRING ROMWBW - - -The RomWBW Repository (https://github.com/wwarthen/RomWBW) on GitHub is -the official distribution location for all project source and -documentation. The fully-built distribution releases are available on -the RomWBW Releases Page (https://github.com/wwarthen/RomWBW/releases) -of the repository. On this page, you will normally see a Development -Snapshot as well as recent stable releases. Unless you have a specific -reason, I suggest you stick to the most recent stable release. Expand -the “Assets” drop-down for the release you want to download, then select -the asset named RomWBW-vX.X.X-Package.zip. The Package asset includes -all pre-built ROM and Disk images as well as full source code. The other -assets contain only source code and do not have the pre-built ROM or -disk images. - -All source code and distributions are maintained on GitHub. Code -contributions are very welcome. - - - -INSTALLATION & OPERATION - - -In general, installation of RomWBW on your platform is very simple. You -just need to program your ROM with the correct ROM image from the RomWBW -distribution. Subsequently, you can write disk images on your disk -drives (IDE disk, CF Card, SD Card, etc.) which then provides even more -functionality. - -Complete instructions for installation and operation of RomWBW are found -in the RomWBW User Guide. - - -Documentation - -Documentation for RomWBW includes: - -- RomWBW User Guide -- RomWBW System Guide -- RomWBW Applications -- RomWBW Errata - - - -ACKNOWLEDGMENTS - - -I want to acknowledge that a great deal of the code and inspiration for -RomWBW has been provided by or derived from the work of others in the -RetroBrew Computers Community. I sincerely appreciate all of their -contributions. The list below is probably missing many names – please -let me know if I missed you! - -- Andrew Lynch started it all when he created the N8VEM Z80 SBC which - became the first platform RomWBW supported. Some of his original - code can still be found in RomWBW. - -- Dan Werner wrote much of the code from which RomWBW was originally - derived and he has always been a great source of knowledge and - advice. - -- Douglas Goodall contributed code, time, testing, and advice in “the - early days”. He created an entire suite of application programs to - enhance the use of RomWBW. Unfortunately, they have become unusable - due to internal changes within RomWBW. As of RomWBW 2.6, these - applications are no longer provided. - -- Sergey Kiselev created several hardware platforms for RomWBW - including the very popular Zeta. - -- David Giles created support for the Z180 CSIO which is now included - SD Card driver. - -- Phil Summers contributed the Forth and BASIC adaptations in ROM, the - AY-3-8910 sound driver, DMA support, and a long list of general code - and documentation enhancements. - -- Ed Brindley contributed some of the code that supports the RCBus - platform. - -- Spencer Owen created the RC2014 series of hobbyist kit computers - which has exponentially increased RomWBW usage. Some of his kits - include RomWBW. - -- Stephen Cousins has likewise created a series of hobbyist kit - computers at Small Computer Central and is distributing RomWBW with - many of them. - -- Alan Cox has contributed some driver code and has provided a great - deal of advice. - -- The CP/NET client files were developed by Douglas Miller. - -- Phillip Stevens contributed support for FreeRTOS. - -- Curt Mayer contributed the original Linux / MacOS build process. - -- UNA BIOS and FDISK80 are the products of John Coffman. - -- FLASH4 is a product of Will Sowerbutts. - -- CLRDIR is a product of Max Scane. - -- Tasty Basic is a product of Dimitri Theulings. - -- Dean Netherton contributed eZ80 CPU support, the sound driver - interface, and the SN76489 sound driver. - -- The RomWBW Disk Catalog document was produced by Mykl Orders. - -- Rob Prouse has created many of the supplemental disk images - including Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft - BASIC Compiler, Microsoft Fortran Compiler, and a Games compendium. - -- Martin R has provided substantial help reviewing and improving the - User Guide and Applications documents. - -- Mark Pruden has also contributed a great deal of content to the User - Guide as well as the COPYSL utility. - -- Jacques Pelletier has contributed the DS1501 RTC driver code. - -- Jose Collado has contributed enhancements to the TMS driver - including compatibility with standard TMS register configuration. - -- Kevin Boone has contributed a generic HBIOS date/time utility - (WDATE). - -- Matt Carroll has contributed a fix to XM.COM that corrects the port - specification when doing a send. - -- Dean Jenkins enhanced the build process to accommodate the Raspberry - Pi 4. - -- Tom Plano has contributed a new utility (HTALK) to allow talking - directly to HBIOS COM ports. - -- Lars Nelson has contributed several generic utilities such as a - universal (OS agnostic) UNARC application. - -- Dylan Hall added support for specifying a secondary console. - -- Bill Shen has contributed boot loaders for several of his systems. - -- Laszlo Szolnoki has contributed an EF9345 video display controller - driver. - -- Ladislau Szilagyi has contributed an enhanced version of CP/M Cowgol - that leverages RomWBW memory banking. - -- Les Bird has contributed support for the NABU w/ Option Board - -Contributions of all kinds to RomWBW are very welcome. - - - -LICENSING - - -RomWBW is free software: you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation, either version 3 of the License, or (at your -option) any later version. - -RomWBW is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -more details. - -You should have received a copy of the GNU General Public License along -with RomWBW. If not, see https://www.gnu.org/licenses/. - -Portions of RomWBW were created by, contributed by, or derived from the -work of others. It is believed that these works are being used in -accordance with the intentions and/or licensing of their creators. - -If anyone feels their work is being used outside of its intended -licensing, please notify: - - Wayne Warthen - wwarthen@gmail.com - -RomWBW is an aggregate work. It is composed of many individual, -standalone programs that are distributed as a whole to function as a -cohesive system. Each program may have its own licensing which may be -different from other programs within the aggregate. - -In some cases, a single program (e.g., CP/M Operating System) is -composed of multiple components with different licenses. It is believed -that in all such cases the licenses are compatible with GPL version 3. - -RomWBW encourages code contributions from others. Contributors may -assert their own copyright in their contributions by annotating the -contributed source code appropriately. Contributors are further -encouraged to submit their contributions via the RomWBW source code -control system to ensure their contributions are clearly documented. - -All contributions to RomWBW are subject to this license. - - - -GETTING ASSISTANCE - - -The best way to get assistance with RomWBW or any aspect of the -RetroBrew Computers projects is via one of the community forums: - -- RetroBrew Computers Forum -- RC2014 Google Group -- retro-comp Google Group - -Submission of issues and bugs are welcome at the RomWBW GitHub -Repository. - -Also feel free to email Wayne Warthen at wwarthen@gmail.com. +RomWBW ReadMe +Wayne Warthen (wwarthen@gmail.com) +05 Oct 2024 + + + +OVERVIEW + + +RomWBW software provides a complete, commercial quality implementation +of CP/M (and workalike) operating systems and applications for modern +Z80/180/280 retro-computing hardware systems. A wide variety of +platforms are supported including those produced by these developer +communities: + +- RetroBrew Computers (https://www.retrobrewcomputers.org) +- RC2014 (https://rc2014.co.uk), + RC2014-Z80 (https://groups.google.com/g/rc2014-z80) +- Retro Computing (https://groups.google.com/g/retro-comp) +- Small Computer Central (https://smallcomputercentral.com/) + +A complete list of the currently supported platforms is found in the +[Installation] section. + +General features include: + +- Z80 Family CPUs including Z80, Z180, and Z280 +- Banked memory services for several banking designs +- Disk drivers for RAM, ROM, Floppy, IDE ATA/ATAPI, CF, SD, USB, Zip, + Iomega +- Serial drivers including UART (16550-like), ASCI, ACIA, SIO +- Video drivers including TMS9918, SY6545, MOS8563, HD6445 +- Keyboard (PS/2) drivers via VT8242 or PPI interfaces +- Real time clock drivers including DS1302, BQ4845 +- OSes: CP/M 2.2, ZSDOS, CP/M 3, NZ-COM, ZPM3, QPM, p-System, and + FreeRTOS +- Built-in VT-100 terminal emulation support + +RomWBW is distributed as both source code and pre-built ROM and disk +images. Some of the provided software can be launched directly from the +ROM firmware itself: + +- System Monitor +- Operating Systems (CP/M 2.2, ZSDOS) +- ROM BASIC (Nascom BASIC and Tasty BASIC) +- ROM Forth + +A dynamic disk drive letter assignment mechanism allows mapping +operating system drive letters to any available disk media. +Additionally, mass storage devices (IDE Disk, CF Card, SD Card, etc.) +support the use of multiple slices (up to 256 per device). Each slice +contains a complete CP/M filesystem and can be mapped independently to +any drive letter. This overcomes the inherent size limitations in legacy +OSes and allows up to 2GB of accessible storage on a single device. + +The pre-built ROM firmware images are generally suitable for most users. +However, it is also very easy to modify and build custom ROM images that +fully tailor the firmware to your specific preferences. All tools +required to build custom ROM firmware under Windows are included – no +need to install assemblers, etc. The firmware can also be built using +Linux or MacOS after confirming a few standard tools have been +installed. + +Multiple disk images are provided in the distribution. Most disk images +contain a complete, bootable, ready-to-run implementation of a specific +operating system. A “combo” disk image contains multiple slices, each +with a full operating system implementation. If you use this disk image, +you can easily pick whichever operating system you want to boot without +changing media. + +By design, RomWBW isolates all of the hardware specific functions in the +ROM chip itself. The ROM provides a hardware abstraction layer such that +all of the operating systems and applications on a disk will run on any +RomWBW-based system. To put it simply, you can take a disk (or CF/SD/USB +Card) and move it between systems transparently. + +A tool is provided that allows you to access a FAT-12/16/32 filesystem. +The FAT filesystem may be coresident on the same disk media as RomWBW +slices or on stand-alone media. This makes exchanging files with modern +OSes such as Windows, MacOS, and Linux very easy. + + + +ACQUIRING ROMWBW + + +The RomWBW Repository (https://github.com/wwarthen/RomWBW) on GitHub is +the official distribution location for all project source and +documentation. The fully-built distribution releases are available on +the RomWBW Releases Page (https://github.com/wwarthen/RomWBW/releases) +of the repository. On this page, you will normally see a Development +Snapshot as well as recent stable releases. Unless you have a specific +reason, I suggest you stick to the most recent stable release. Expand +the “Assets” drop-down for the release you want to download, then select +the asset named RomWBW-vX.X.X-Package.zip. The Package asset includes +all pre-built ROM and Disk images as well as full source code. The other +assets contain only source code and do not have the pre-built ROM or +disk images. + +All source code and distributions are maintained on GitHub. Code +contributions are very welcome. + + + +INSTALLATION & OPERATION + + +In general, installation of RomWBW on your platform is very simple. You +just need to program your ROM with the correct ROM image from the RomWBW +distribution. Subsequently, you can write disk images on your disk +drives (IDE disk, CF Card, SD Card, etc.) which then provides even more +functionality. + +Complete instructions for installation and operation of RomWBW are found +in the RomWBW User Guide. + +Documentation + +Documentation for RomWBW includes: + +- RomWBW User Guide +- RomWBW System Guide +- RomWBW Applications +- RomWBW Errata + + + +ACKNOWLEDGMENTS + + +I want to acknowledge that a great deal of the code and inspiration for +RomWBW has been provided by or derived from the work of others in the +RetroBrew Computers Community. I sincerely appreciate all of their +contributions. The list below is probably missing many names – please +let me know if I missed you! + +- Andrew Lynch started it all when he created the N8VEM Z80 SBC which + became the first platform RomWBW supported. Some of his original + code can still be found in RomWBW. + +- Dan Werner wrote much of the code from which RomWBW was originally + derived and he has always been a great source of knowledge and + advice. + +- Douglas Goodall contributed code, time, testing, and advice in “the + early days”. He created an entire suite of application programs to + enhance the use of RomWBW. Unfortunately, they have become unusable + due to internal changes within RomWBW. As of RomWBW 2.6, these + applications are no longer provided. + +- Sergey Kiselev created several hardware platforms for RomWBW + including the very popular Zeta. + +- David Giles created support for the Z180 CSIO which is now included + SD Card driver. + +- Phil Summers contributed the Forth and BASIC adaptations in ROM, the + AY-3-8910 sound driver, DMA support, and a long list of general code + and documentation enhancements. + +- Ed Brindley contributed some of the code that supports the RCBus + platform. + +- Spencer Owen created the RC2014 series of hobbyist kit computers + which has exponentially increased RomWBW usage. Some of his kits + include RomWBW. + +- Stephen Cousins has likewise created a series of hobbyist kit + computers at Small Computer Central and is distributing RomWBW with + many of them. + +- Alan Cox has contributed some driver code and has provided a great + deal of advice. + +- The CP/NET client files were developed by Douglas Miller. + +- Phillip Stevens contributed support for FreeRTOS. + +- Curt Mayer contributed the original Linux / MacOS build process. + +- UNA BIOS and FDISK80 are the products of John Coffman. + +- FLASH4 is a product of Will Sowerbutts. + +- CLRDIR is a product of Max Scane. + +- Tasty Basic is a product of Dimitri Theulings. + +- Dean Netherton contributed eZ80 CPU support, the sound driver + interface, and the SN76489 sound driver. + +- The RomWBW Disk Catalog document was produced by Mykl Orders. + +- Rob Prouse has created many of the supplemental disk images + including Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft + BASIC Compiler, Microsoft Fortran Compiler, and a Games compendium. + +- Martin R has provided substantial help reviewing and improving the + User Guide and Applications documents. + +- Mark Pruden has also contributed a great deal of content to the User + Guide as well as the COPYSL utility. + +- Jacques Pelletier has contributed the DS1501 RTC driver code. + +- Jose Collado has contributed enhancements to the TMS driver + including compatibility with standard TMS register configuration. + +- Kevin Boone has contributed a generic HBIOS date/time utility + (WDATE). + +- Matt Carroll has contributed a fix to XM.COM that corrects the port + specification when doing a send. + +- Dean Jenkins enhanced the build process to accommodate the Raspberry + Pi 4. + +- Tom Plano has contributed a new utility (HTALK) to allow talking + directly to HBIOS COM ports. + +- Lars Nelson has contributed several generic utilities such as a + universal (OS agnostic) UNARC application. + +- Dylan Hall added support for specifying a secondary console. + +- Bill Shen has contributed boot loaders for several of his systems. + +- Laszlo Szolnoki has contributed an EF9345 video display controller + driver. + +- Ladislau Szilagyi has contributed an enhanced version of CP/M Cowgol + that leverages RomWBW memory banking. + +- Les Bird has contributed support for the NABU w/ Option Board + +Contributions of all kinds to RomWBW are very welcome. + + + +LICENSING + + +RomWBW is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your +option) any later version. + +RomWBW is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +more details. + +You should have received a copy of the GNU General Public License along +with RomWBW. If not, see https://www.gnu.org/licenses/. + +Portions of RomWBW were created by, contributed by, or derived from the +work of others. It is believed that these works are being used in +accordance with the intentions and/or licensing of their creators. + +If anyone feels their work is being used outside of its intended +licensing, please notify: + + Wayne Warthen + wwarthen@gmail.com + +RomWBW is an aggregate work. It is composed of many individual, +standalone programs that are distributed as a whole to function as a +cohesive system. Each program may have its own licensing which may be +different from other programs within the aggregate. + +In some cases, a single program (e.g., CP/M Operating System) is +composed of multiple components with different licenses. It is believed +that in all such cases the licenses are compatible with GPL version 3. + +RomWBW encourages code contributions from others. Contributors may +assert their own copyright in their contributions by annotating the +contributed source code appropriately. Contributors are further +encouraged to submit their contributions via the RomWBW source code +control system to ensure their contributions are clearly documented. + +All contributions to RomWBW are subject to this license. + + + +GETTING ASSISTANCE + + +The best way to get assistance with RomWBW or any aspect of the +RetroBrew Computers projects is via one of the community forums: + +- RetroBrew Computers Forum +- RC2014 Google Group +- retro-comp Google Group + +Submission of issues and bugs are welcome at the RomWBW GitHub +Repository. + +Also feel free to email Wayne Warthen at wwarthen@gmail.com. diff --git a/Source/Doc/SystemGuide.md b/Source/Doc/SystemGuide.md index 9d89b544..523c259f 100644 --- a/Source/Doc/SystemGuide.md +++ b/Source/Doc/SystemGuide.md @@ -1076,8 +1076,10 @@ there is no media in device, function will return an error status. **NOTE**: This function will always return MID_HD512 for hard disk devices. MID_HD1K is provided for use internally by operating systems that provide different filsystem formats depending on the partition -table. This function cannot be used to determine if an HD1K formatted -partition exists on the hard disk. +table. To determine if an HD1K formatted partition exists on the hard disk +please see the following function. + +[SYSGET Subfunction 0x12 -- Get Extended Disk Media (DIOMED)] ### Function 0x19 -- Disk Define Media (DIODEFMED) @@ -2459,6 +2461,36 @@ the caller can use interbank calls directly to the function in the driver which bypasses the overhead of the normal function invocation lookup. +#### SYSGET Subfunction 0x12 -- Get Extended Disk Media (DIOMED) + +| **Entry Parameters** | **Returned Values** | +|----------------------------------------|---------------------------------------| +| B: 0xF8 | A: Status | +| C: 0x12 | C: Media ID | +| D: Disk Unit | DEHL: Sector Address | +| E: Slice | | + +Report the Media ID (C) for the for media in the specified Disk Unit (D), +and for hard disks the absolute Sector offset to the start of the Slice (E). +The Status (A) is a standard HBIOS result code. + +This function extends upon [Function 0x18 -- Disk Media (DIOMEDIA)] for hard +disk media by scanning for a partition to determine if the disk uses HD512 +or HD1K, correctly reporting MID_HD or MID_HDNEW respectively. + +It will also return the sector number of the first sector in the +slice if the slice number is valid. If the slice number is invalid +(it wont fix on the media) an error will be returned. + +The slice calculation is performed by considering the partition start +(if it exists), the size of a slice for the given format type, and ensuring +that the slice fits within the media or partition size, taking into +consideration other partitions that may exist. + +If the Unit specified is not a hard disk the Media ID will be returned and +the slice parameter ignored. If there is no media in device, or the slice +number is invaid (Parameter Out Of Range) the function will return an error status. + #### SYSGET Subfunction 0x20 -- Get RTC Device Unit Count (RTCCNT) | **Entry Parameters** | **Returned Values** | @@ -3211,7 +3243,7 @@ The following section outlines the read only data referenced by the | CMDREG | 5 | 1 | IO PORT ADDRESS FOR MODE 1 | | | | | _Below are the register mirror values_ | | | | | _that HBIOS used for initialisation_ | -| REG. 0 | 6 | 1 | $00 - NO EXTERNAL VID +| REG. 0 | 6 | 1 | $00 - NO EXTERNAL VID | | REG. 1 | 7 | 1 | $50 or $70 - SET MODE 1 and interrupt if enabled | | REG. 2 | 8 | 1 | $00 - PATTERN NAME TABLE := 0 | | REG. 3 | 9 | 1 | $00 - NO COLOR TABLE | diff --git a/Source/HBIOS/hbios.asm b/Source/HBIOS/hbios.asm index a2e8fe00..6885dddb 100644 --- a/Source/HBIOS/hbios.asm +++ b/Source/HBIOS/hbios.asm @@ -1766,7 +1766,7 @@ ROMRESUME: EZ80_IO() OUT (MPGSEL_1),A ; PROG SECOND 16K MMU REGISTER #ENDIF -; +; #IF (PLATFORM == PLT_DUO) ; DUO HAS VARIABLE RAM SIZE. RAM ALWAYS STARTS AT 2048K. ; SETUP COMMON RAM FOR HIGHEST 32K OF RAM BASED ON TOTAL RAM. @@ -2036,7 +2036,7 @@ HB_START1: ; BNKCALL ARRIVES HERE, BUT NOW RUNNING IN RAM BANK ; ; NOTIFY THAT WE MADE THE TRANSITION! FPLEDS(DIAG_03) - DIAG(2) + DIAG(2) ; ; RECOVER DATA PASSED PRIOR TO RAM TRANSITION ; (HBX_LOC - 1) = BATCOND @@ -4139,7 +4139,7 @@ CIO_SETCRT: POP AF ; RESTORE AF LD (CB_CRTDEV),A ; SAVE CRT DEV NUM RET ; AND DONE -; +; CIO_SETCRT_Z: POP AF ; RESTORE AF RET ; AND DONE @@ -5146,6 +5146,8 @@ SYS_GET: JP Z,SYS_GETDIOCNT CP BF_SYSGET_DIOFN JP Z,SYS_GETDIOFN + CP BF_SYSGET_DIOMED + JP Z,SYS_GETDIOMED CP BF_SYSGET_RTCCNT JP Z,SYS_GETRTCCNT CP BF_SYSGET_DSKYCNT @@ -5227,6 +5229,256 @@ SYS_GETDIOFN: LD IY,DIO_TBL ; POINT TO UNIT TABLE JP SYS_GETFN ; GO TO COMMON CODE ; +; GET DISK EXTENDED HARD DISK MEDIA INFORMATION +; This function is specificly intended for Hard Drives, where it will scan +; the partition table and return a Media ID, including hd1k (MID_HDNEW). +; It will also return the absolute LBA offset of the first sector in the slice +; If the slice number is invalid (wont fit) the Status will return an error +; If the Unit is not a hard disk the Media ID will be returned and slice ignored. +; +; ENTRY: +; B: FUNCTION 0xF8 SYSGET +; C: SUB FUNCTION 0x12 DIOMED +; D: DISK UNIT, preferably for a hard disk. +; E: SLICE, ignored if media is not a hard disk +; RETURNS: +; A: STATUS, -6 (parameter out of range) - if Slice is invalid +; C: MEDIAID, including MID_HDNEW if hd1k partition is found +; DEHL: LBAOFFSET, of Slice if valid, 0 otherwise. +; +DIOMED_SLICE .DB 0 ; SLICE ARGUMENT (E) +DIOMED_UNIT .DB 0 ; UNIT ARGUMENT (D) +; +DIOMED_WRKSTA .EQU $ +DIOMED_LBAOFF .FILL 4,0 ; START OF PARTITION / SLICE (SECTORS) +DIOMED_LBASIZ .FILL 4,0 ; SIZE OF MEDIA / PARTITION (SECTORS) +DIOMED_MID .DB 0 ; DISCOVERED MEDIAID +DIOMED_SPS .DW 0 ; DISCOVERED SECTORS PER SLICE (16BIT) +DIOMED_FND .DB 0 ; DID WE FIND A NON CPM PARTITION +DIOMED_WRKSIZ .EQU $ - DIOMED_WRKSTA ; SIZE OF WORKING DATA +; +SYS_GETDIOMED: + ; SAVE CALL ARGUMENTS + LD (DIOMED_SLICE),DE ; STORES DE -> SLICE/UNIT PARAMETERS +; + ; DETERMINE MEDIA IN DRIVE USING DIOMEDIA FUNCTION + LD A,(DIOMED_UNIT) + LD C,A ; UNIT ID PARAMETER INTO C + LD E,1 ; ENABLE MEDIA CHECK/DISCOVERY + LD B,BF_DIOMEDIA ; DRIVER FUNCTION = DISK MEDIA + CALL DIO_DISPATCH ; CALL DIO TO GET MEDIAID (RESULT IN E) + RET NZ ; ABORT ON ERROR +; + ; CHECK MEDIA TYPE, ONLY HD IS APPLICABLE + LD A,E ; RESULTANT MEDIA ID TO ACCUM + OR A ; SET FLAGS + JR Z, SYS_GETDIOMED1A ; BAIL IF NO MEDIA + CP MID_HD ; IS IT A HARD DISK + JR NZ, SYS_GETDIOMED1A ; BAIL IF NOT HARD DISK + JR SYS_GETDIOMED1B ; CONTINUE TO PROCESS HD +; +SYS_GETDIOMED1A: + ; RETURN MEDIA ID (NOT HD) WITH SUCCESS + LD DE,0 + LD HL,0 + LD C,A ; RETURN MEDIA ID IN C + XOR A ; SIGNAL SUCCESS + RET ; NOT HD JUST RETURN +; +SYS_GETDIOMED1B: + ; FOUND HD, NEED TO PROCESS MBR / PART TABLE + ; CLEAR WORKING STORAGE + LD HL,DIOMED_WRKSTA ; HL SET TO FIRST BYTE + LD (HL),0 ; CLEAR FIRST BYTE + LD D,H + LD E,L + INC DE ; DE SET TO SECOND BYTE + LD BC,DIOMED_WRKSIZ - 1 ; NUMBER OF LDIR COPIES + LDIR ; BLOCK COPY TO CLEAR WORKING STORAGE +; + ; SEEK TO SECTOR ZERO (MBR TABLE) + LD B,BF_DIOSEEK ; SEEK FUNCTION + LD A,(DIOMED_UNIT) ; GET UNIT + LD C,A ; PUT IN C + LD DE,$8000 ; LBA SECTOR ZERO + LD HL,0 ; ASSUME LBA ACCESS FOR NOW + CALL DIO_DISPATCH ; DO IT + RET NZ ; ABORT ON ERROR +; + ; READ SECTOR ZERO (MBR TABLE) + LD B,BF_DIOREAD ; READ FUNCTION + LD A,(DIOMED_UNIT) ; GET UNIT + LD C,A ; PUT IN C + LD A,(HB_CURBNK) ; GET CURRENT BANK ID + LD D,A ; PUT IN D + LD E,1 ; SECTOR COUNT + LD HL,HB_WRKBUF ; IO BUFFER TO USE + CALL DIO_DISPATCH ; DO IT + RET NZ ; ABORT ON ERROR +; + ; CHECK MBR OF DISK TO SEE IF IT HAS A PARTITION TABLE. + LD HL,HB_WRKBUF ; DSKBUF ADR + LD DE,$1FE ; OFFSET TO SIGNATURE + ADD HL,DE ; POINT TO SIGNATURE + LD A,(HL) ; GET FIRST BYTE + CP $55 ; CHECK FIRST BYTE + JR NZ,SYS_GETDIOMED3C ; NO MATCH, NO PART TABLE + INC HL ; NEXT BYTE + LD A,(HL) ; GET SECOND BYTE + CP $AA ; CHECK SECOND BYTE + JR NZ,SYS_GETDIOMED3C ; NO MATCH, NO PART TABLE +; + ; FOUND PARTITION TABLE - LOOP AND PROCESS PARTITION TABLE + LD HL,HB_WRKBUF ; DSKBUF ADR + LD DE,$1BE+4 ; OFFSET OF FIRST ENTRY PART TYPE + ADD HL,DE ; POINT TO IT + LD B,4 ; FOUR ENTRIES IN PART TABLE LOOP +SYS_GETDIOMED2A: + LD A,(HL) ; GET PART TYPE + LD DE,4 + ADD HL,DE ; MOVE HL FWD TO GET TO LBA OFFSET + CP $2E ; CP/M PARTITION? + JR Z,SYS_GETDIOMED3B ; HD1K, GRAB THE LBA OFFSET + CP $00 ; IS ANOTHER PARTITION TYPE, NOT CPM + JR NZ,SYS_GETDIOMED3A ; OTHER VALID PART TYPE +SYS_GETDIOMED2B: + LD DE,12 ; REMAINING SIZE TO GET TO NEXT PARTITION +SYS_GETDIOMED2C: + ADD HL,DE ; BUMP TO NEXT PARTITION ENTRY - TYPE + DJNZ SYS_GETDIOMED2A ; LOOP THRU TABLE + JR SYS_GETDIOMED3C ; READ ALL - NO CP/M PARTITION FOUND +; +SYS_GETDIOMED3A + ; FOUND OTHER (NOT CPM) PARTITION + LD A,(DIOMED_FND) ; HAVE WE ALREADY FOUND PROCESSED NON CPM + OR A ; PARTITION, AND CAPTURED ITS START SECTOR, SO + JR NZ,SYS_GETDIOMED2B ; IGNORE AND CONTINUTE TO NEXT PARTITION ENTRY +; +; NOTE THERE SLIGHT ISSUE HERE THAT WE ONLY CONSIDER THE FIRST NON-CPM PARTITION +; TO GET THE UPPER SIZE OF MEDIA, IDEALLY WE WOULD CONSIDER ALL, AND TAKE THE LOWEWST +; STARTING SECTOR - THIS IS A COMPRIMISE - OUT OF SEQUENCE PARTITIONS ARE UNLIKELY. +; + PUSH BC ; SAVE IT, BEING USED IN PARTITION LOOP + LD BC, 4 ; IF NOT ALREADY SET - COPY 4 BYTES + LD DE, DIOMED_LBASIZ ; FROM PARTION LBA OFFSET (HL) - TO WORKING LBA SIZE (DE) + LDIR ; COPY 4 BYTES + POP BC ; RESTORE +; + LD A,$FF + LD (DIOMED_FND),A ; SET FOUND FLAG, SO DONT PROCESS ANY OTHERS + LD DE,8 ; AND INC HL BY 8 TO GET TO NEXT PARITION + JR SYS_GETDIOMED2C ; CONTINUE TO NEXT PARTITION +; +SYS_GETDIOMED3B: + ; FOUND CP/M (HD1K) PARTITION - RECORD THIS + LD A, MID_HDNEW ; DISCOVERED HD1K MEDIA + LD (DIOMED_MID), A ; STORE IT + LD BC, SPS_HD1K ; DISCOVERED HD1K MEDIA + LD (DIOMED_SPS), BC ; STORE IT +; + ; CAPTURE THE LBA OFFSET AND SECTOR COUNT FROM PARTITION + ; HL POINTS TO PART LBA OFFSET FIELD OF PART ENTRY + LD DE,DIOMED_LBAOFF ; LOC TO STORE OFFSET AND SIZE + LD BC,8 ; 8 BYTES - LBA OFFSET AND SIZE + LDIR ; COPY IT +; + JR SYS_GETDIOMED4A ; CONTINUE AND COMPUTE THE SLICE +; +SYS_GETDIOMED3C: + ; NO PARTITION TABLE FOUND / NO CPM PARTITION FOUND -> HD512 + LD A, MID_HD ; HD512 MEDIA + LD (DIOMED_MID), A ; STORE IT + LD BC, SPS_HD512 ; WITH HD512 SECTORS PER SLICE + LD (DIOMED_SPS), BC ; STORE IT + + ; DID WE FIND AN OTHER (NOT CPM) PARTITION + LD A,(DIOMED_FND) ; HAVE WE ALREADY FOUND PROCESSED NON CPM + OR A ; PARTITION, AND CAPTURED ITS START SECTOR, SO + JR NZ,SYS_GETDIOMED4A ; MEDIA SIZE IS KNOWN BASED ON START OF PARTITION + + ; FIND THE PHYSICAL CAPCITY OF THE MEDIA CALL (DIOCAP) + LD B, BF_DIOCAP ; HBIOS FUNC: TO GET DISK LBA CAPACITY + LD A, (DIOMED_UNIT) + LD C, A ; PUT DISK UNIT IN C FOR FUNC CALL + CALL DIO_DISPATCH ; DO IT - RETURNS SIZE in DE:HL + RET NZ ; ABORT ON ERROR + + ; UPDATE LBA SIZE FROM MEDIA SIZE + LD (DIOMED_LBASIZ), HL ; LOWER ORDER BYTES - HL + EX DE,HL + LD (DIOMED_LBASIZ+2), HL ; HIGHER ORDER BYTES - DE +; +SYS_GETDIOMED4A: + ; COMPUTE THE START SECTOR (RELATIVE) FOR SLICE -> DE:HL + LD HL,0 ; STARTING SECTOR NUMBER + LD DE,0 ; ASSUMING A 0 OFFSET, SO CAN COMPARE TO SIZE + LD BC,(DIOMED_SPS) ; + LD A,(DIOMED_SLICE) + OR A ; SLICE NUMBER - SET FLAGS TO CHECK LOOP CTR + JR Z,SYS_GETDIOMED5A ; NOTHING TO COUNT +SYS_GETDIOMED4B: + ADD HL,BC ; ADD ONE SLICE (SPS) TO LOW WORD + JR NC,SYS_GETDIOMED4C ; CHECK FOR CARRY + INC DE ; IF SO, BUMP HIGH WORD +SYS_GETDIOMED4C: + DEC A ; DEC LOOP (SLICE) COUNTER + JR NZ,SYS_GETDIOMED4B ; AND LOOP +; +SYS_GETDIOMED5A: + ; DE:HL NOW CONTAINS THE STARTING SECTOR FOR SLICE + PUSH HL ; SAVE THE SECTOR OFFSET (SPS * SLICE NUMBER) + PUSH DE +; + ADD HL, BC ; ADD SPS, GET REQUIRED CAPCITY (UPPER SECTOR) + JR NC, SYS_GETDIOMED5B + INC DE +SYS_GETDIOMED5B: + ; DEHL HAS THE REQUIRED NUMBER OF SECTORS (ON MEDIA) FOR THE SLICE + PUSH DE ; SAVE DSK_REQ (MSW) + PUSH HL ; SAVE DSK_REQ (LSW) +; + ; CHECK DSK_CAPACITY >= CAP_REQUIRED, CF SET ON OVERFLOW + ; NO NEED SAVE ACTUAL RESULT + OR A ; CLEAR CARRY FOR SBC + LD HL,(DIOMED_LBASIZ+0) ; CAPACITY LSW + POP DE ; REQUIRED LSW + SBC HL,DE ; CAPACITY - REQUIRED (LSW) + LD HL,(DIOMED_LBASIZ+2) ; CAPAITY MSW + POP DE ; REQUIRED MSW + SBC HL,DE ; CAPACITY - REQUIRED (MSW) +; + ; POP STARTING OFSETT SECTOR + POP DE + POP HL +; + ; REQUIRE - CAPACITY -> GENERATES BORROW IF CAPITY > REQUIREMENT + JR NC,SYS_GETDIOMED6 ; IF WE HAVE ENOUGH CAPACITY +; + ; SLICE WONT FIT - STOP AND RETURN ERROR + LD DE,0 + LD HL,0 ; EMTY OFFSET IN DEHL + LD A,(DIOMED_MID) + LD C,A ; RETURN MEDIA ID IN C + LD A,ERR_RANGE ; OTHERWISE SIGNAL NOT ENOUGH CAPACITY + OR A + RET +; +SYS_GETDIOMED6: + ; FINAL CALC AND RETURN SUCCESS + ; ADD PARTITION OFFSET (START) TO DEHL TO GET ABSOLUTE SLICE OFFSET + LD BC,(DIOMED_LBAOFF+0) ; LSB OF LBA OFFSET + ADD HL,BC ; ADD LSB OFFSET + EX DE,HL ; FLIP DE INTO HL + LD BC,(DIOMED_LBAOFF+2) ; MSB OF LBA OFFSET + ADC HL,BC ; ADD MSB + EX DE, HL ; FLIP BACK DE:HL AS SLICE OFFSET +; + ; SLICE FITS - RETURN CORRECTLY + LD A,(DIOMED_MID) + LD C,A ; RETURN MEDIA ID IN C + XOR A ; CLEAR FLAGS + RET ; RETUNING DE:HL AND C +; ; GET RTC UNIT COUNT ; SYS_GETRTCCNT: @@ -7414,7 +7666,7 @@ FP_SETLEDS: #ENDIF EZ80_IO - OUT (FPLED_IO),A ; WRITE + OUT (FPLED_IO),A ; WRITE FP_SETLEDS1: POP HL ; RESTORE HL RET ; DONE diff --git a/Source/HBIOS/hbios.inc b/Source/HBIOS/hbios.inc index aa24dd4a..f1329ec9 100644 --- a/Source/HBIOS/hbios.inc +++ b/Source/HBIOS/hbios.inc @@ -109,6 +109,7 @@ BF_SYSGET_CIOCNT .EQU $00 ; GET CHAR UNIT COUNT BF_SYSGET_CIOFN .EQU $01 ; GET CIO UNIT FN/DATA ADR BF_SYSGET_DIOCNT .EQU $10 ; GET DISK UNIT COUNT BF_SYSGET_DIOFN .EQU $11 ; GET DIO UNIT FN/DATA ADR +BF_SYSGET_DIOMED .EQU $12 ; GET DISK MEDIA EXTENDED INFO BF_SYSGET_RTCCNT .EQU $20 ; GET RTC UNIT COUNT BF_SYSGET_DSKYCNT .EQU $30 ; GET DSKY UNIT COUNT BF_SYSGET_VDACNT .EQU $40 ; GET VDA UNIT COUNT @@ -168,7 +169,7 @@ PLT_RCEZ80 .EQU 24 ; RCBUS W/ eZ80 ; HBIOS GLOBAL ERROR RETURN VALUES ; ERR_NONE .EQU 0 ; SUCCESS -; +; ERR_UNDEF .EQU -1 ; UNDEFINED ERROR ERR_NOTIMPL .EQU -2 ; FUNCTION NOT IMPLEMENTED ERR_NOFUNC .EQU -3 ; INVALID FUNCTION @@ -196,46 +197,46 @@ DIAG_TRIG .EQU 6 ; TRIGGER DIAG_DISP .EQU DIAG_PROG ; DEFAULT ; #IF (DIAG_DISP == DIAG_PROG) -DIAG_00 .EQU 00000000B -DIAG_01 .EQU 00000001B -DIAG_02 .EQU 00000011B -DIAG_03 .EQU 00000111B -DIAG_04 .EQU 00001111B -DIAG_05 .EQU 00011111B -DIAG_06 .EQU 00111111B -DIAG_07 .EQU 01111111B -DIAG_08 .EQU 11111111B -DIAG_09 .EQU 11111111B +DIAG_00 .EQU 00000000B +DIAG_01 .EQU 00000001B +DIAG_02 .EQU 00000011B +DIAG_03 .EQU 00000111B +DIAG_04 .EQU 00001111B +DIAG_05 .EQU 00011111B +DIAG_06 .EQU 00111111B +DIAG_07 .EQU 01111111B +DIAG_08 .EQU 11111111B +DIAG_09 .EQU 11111111B #ENDIF ; #IF (DIAG_DISP == DIAG_STEP) -DIAG_00 .EQU 00000000B -DIAG_01 .EQU 00000001B -DIAG_02 .EQU 00000010B -DIAG_03 .EQU 00000100B -DIAG_04 .EQU 00001000B -DIAG_05 .EQU 00010000B -DIAG_06 .EQU 00100000B -DIAG_07 .EQU 01000000B +DIAG_00 .EQU 00000000B +DIAG_01 .EQU 00000001B +DIAG_02 .EQU 00000010B +DIAG_03 .EQU 00000100B +DIAG_04 .EQU 00001000B +DIAG_05 .EQU 00010000B +DIAG_06 .EQU 00100000B +DIAG_07 .EQU 01000000B DIAG_08 .EQU 10000000B DIAG_09 .EQU 11111111B #ENDIF ; #IF (DIAG_DISP == DIAG_ASCII) -DIAG_00 .EQU '0' +DIAG_00 .EQU '0' DIAG_01 .EQU '1' -DIAG_02 .EQU '2' -DIAG_03 .EQU '3' +DIAG_02 .EQU '2' +DIAG_03 .EQU '3' DIAG_04 .EQU '4' DIAG_05 .EQU '5' -DIAG_06 .EQU '6' +DIAG_06 .EQU '6' DIAG_07 .EQU '7' -DIAG_08 .EQU '8' -DIAG_09 .EQU '9' +DIAG_08 .EQU '8' +DIAG_09 .EQU '9' #ENDIF ; #IF (DIAG_DISP == DIAG_BINARY) -DIAG_00 .EQU 0 +DIAG_00 .EQU 0 DIAG_01 .EQU 1 DIAG_02 .EQU 2 DIAG_03 .EQU 3 @@ -244,7 +245,7 @@ DIAG_05 .EQU 5 DIAG_06 .EQU 6 DIAG_07 .EQU 7 DIAG_08 .EQU 8 -DIAG_09 .EQU 9 +DIAG_09 .EQU 9 #ENDIF ; #IF (DIAG_DISP == DIAG_7SEG) @@ -253,30 +254,30 @@ DIAG_00 .EQU 00000000B ; BLANK DIAG_01 .EQU 01111110B ; 0 DIAG_02 .EQU 00110000B ; 1 DIAG_03 .EQU 01101101B ; 2 -DIAG_04 .EQU 01111001B ; 3 +DIAG_04 .EQU 01111001B ; 3 DIAG_05 .EQU 00110011B ; 4 DIAG_06 .EQU 01011011B ; 5 -DIAG_07 .EQU 00011111B ; 6 +DIAG_07 .EQU 00011111B ; 6 DIAG_08 .EQU 01110000B ; 7 DIAG_09 .EQU 01111111B ; 8 DIAG_10 .EQU 01110011B ; 9 #ENDIF ; #IF (DIAG_DISP == DIAG_FLASH) -DIAG_00 .EQU 00000000B ; OFF +DIAG_00 .EQU 00000000B ; OFF DIAG_01 .EQU 11111111B ; ON -DIAG_02 .EQU 00000000B ; OFF +DIAG_02 .EQU 00000000B ; OFF DIAG_03 .EQU 11111111B ; ON -DIAG_04 .EQU 00000000B ; OFF +DIAG_04 .EQU 00000000B ; OFF DIAG_05 .EQU 11111111B ; ON -DIAG_06 .EQU 00000000B ; OFF +DIAG_06 .EQU 00000000B ; OFF DIAG_07 .EQU 11111111B ; ON -DIAG_08 .EQU 00000000B ; OFF -DIAG_09 .EQU 11111111B ; ON +DIAG_08 .EQU 00000000B ; OFF +DIAG_09 .EQU 11111111B ; ON #ENDIF ; #IF (DIAG_DISP == DIAG_TRIG) -DIAG_00 .EQU 11111111B ; ON +DIAG_00 .EQU 11111111B ; ON DIAG_01 .EQU 11111111B ; ON DIAG_02 .EQU 11111111B ; ON DIAG_03 .EQU 11111111B ; ON @@ -285,7 +286,7 @@ DIAG_05 .EQU 11111111B ; ON DIAG_06 .EQU 11111111B ; ON DIAG_07 .EQU 11111111B ; ON DIAG_08 .EQU 11111111B ; ON -DIAG_09 .EQU 11111111B ; ON +DIAG_09 .EQU 11111111B ; ON #ENDIF ; ; FRONT PANEL SWITCHES @@ -311,6 +312,11 @@ MID_FD120 .EQU 8 MID_FD111 .EQU 9 MID_HDNEW .EQU 10 ; +; SECTORS PER SLICE +; +SPS_HD512 .EQU $4100 +SPS_HD1K .EQU $4000 +; ; CHAR DEVICE IDS ; CIODEV_UART .EQU $00 diff --git a/Source/ver.inc b/Source/ver.inc index 22b08f47..bcc97fd2 100644 --- a/Source/ver.inc +++ b/Source/ver.inc @@ -2,7 +2,7 @@ #DEFINE RMN 5 #DEFINE RUP 0 #DEFINE RTP 0 -#DEFINE BIOSVER "3.5.0-dev.87" +#DEFINE BIOSVER "3.5.0-dev.88" #define rmj RMJ #define rmn RMN #define rup RUP diff --git a/Source/ver.lib b/Source/ver.lib index 8fa0e506..fc44e71e 100644 --- a/Source/ver.lib +++ b/Source/ver.lib @@ -3,5 +3,5 @@ rmn equ 5 rup equ 0 rtp equ 0 biosver macro - db "3.5.0-dev.87" + db "3.5.0-dev.88" endm