diff --git a/tools/src/librw11/Rw11UnitDiskBase.ipp b/tools/src/librw11/Rw11UnitDiskBase.ipp index c4c68794..96eef57c 100644 --- a/tools/src/librw11/Rw11UnitDiskBase.ipp +++ b/tools/src/librw11/Rw11UnitDiskBase.ipp @@ -1,6 +1,6 @@ -// $Id: Rw11UnitDiskBase.ipp 983 2018-01-02 20:35:59Z mueller $ +// $Id: Rw11UnitDiskBase.ipp 1061 2018-10-27 17:39:11Z mueller $ // -// Copyright 2013-2017 by Walter F.J. Mueller +// Copyright 2013-2018 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2018-10-27 1061 1.1.2 adapt to new Rw11VirtDisk::Setup interface // 2017-04-07 868 1.1.1 Dump(): add detail arg // 2013-05-03 515 1.1 use AttachDone(),DetachCleanup(),DetachDone() // 2013-04-14 506 1.0 Initial version @@ -79,7 +80,7 @@ void Rw11UnitDiskBase::Dump(std::ostream& os, int ind, const char* text, template void Rw11UnitDiskBase::AttachDone() { - Virt()->Setup(BlockSize(), NBlock()); + Virt()->Setup(BlockSize(), NBlock(), NCylinder(), NHead(), NSector()); Cntl().UnitSetup(Index()); return; } diff --git a/tools/src/librw11/Rw11VirtDisk.cpp b/tools/src/librw11/Rw11VirtDisk.cpp index bcac4409..d293fc23 100644 --- a/tools/src/librw11/Rw11VirtDisk.cpp +++ b/tools/src/librw11/Rw11VirtDisk.cpp @@ -1,6 +1,6 @@ -// $Id: Rw11VirtDisk.cpp 983 2018-01-02 20:35:59Z mueller $ +// $Id: Rw11VirtDisk.cpp 1061 2018-10-27 17:39:11Z mueller $ // -// Copyright 2013-2017 by Walter F.J. Mueller +// Copyright 2013-2018 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2018-10-27 1061 1.3 add fNCyl,fNHead,fNSect; add Rw11VirtDiskRam // 2017-04-07 868 1.2.1 Dump(): add detail arg // 2017-04-02 866 1.2 add default scheme handling // 2017-04-02 864 1.1 add Rw11VirtDiskOver @@ -31,6 +32,7 @@ #include "librtools/Rexception.hpp" #include "Rw11VirtDiskFile.hpp" #include "Rw11VirtDiskOver.hpp" +#include "Rw11VirtDiskRam.hpp" #include "Rw11VirtDisk.hpp" @@ -80,6 +82,9 @@ void Rw11VirtDisk::Dump(std::ostream& os, int ind, const char* text, os << bl << " fBlkSize: " << fBlkSize << endl; os << bl << " fNBlock: " << fNBlock << endl; + os << bl << " fNCyl: " << fNCyl << endl; + os << bl << " fNHead: " << fNHead << endl; + os << bl << " fNSect: " << fNSect << endl; Rw11Virt::Dump(os, ind, " ^", detail); return; } @@ -101,6 +106,10 @@ Rw11VirtDisk* Rw11VirtDisk::New(const std::string& url, Rw11Unit* punit, p.reset(new Rw11VirtDiskOver(punit)); if (p->Open(url, emsg)) return p.release(); + } else if (scheme == "ram") { // scheme -> ram: + p.reset(new Rw11VirtDiskRam(punit)); + if (p->Open(url, emsg)) return p.release(); + } else { // scheme -> no match emsg.Init("Rw11VirtDisk::New", string("Scheme '") + scheme + "' is not supported"); diff --git a/tools/src/librw11/Rw11VirtDisk.hpp b/tools/src/librw11/Rw11VirtDisk.hpp index 80432b04..251d9776 100644 --- a/tools/src/librw11/Rw11VirtDisk.hpp +++ b/tools/src/librw11/Rw11VirtDisk.hpp @@ -1,6 +1,6 @@ -// $Id: Rw11VirtDisk.hpp 1052 2018-09-30 08:10:52Z mueller $ +// $Id: Rw11VirtDisk.hpp 1061 2018-10-27 17:39:11Z mueller $ // -// Copyright 2013-2017 by Walter F.J. Mueller +// Copyright 2013-2018 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2018-10-27 1061 1.2 add fNCyl,fNHead,fNSect,NCylinder(),... // 2017-04-07 868 1.1.1 Dump(): add detail arg // 2017-04-02 866 1.1 add default scheme handling // 2013-03-03 494 1.0 Initial version @@ -39,9 +40,13 @@ namespace Retro { explicit Rw11VirtDisk(Rw11Unit* punit); ~Rw11VirtDisk(); - void Setup(size_t blksize, size_t nblock); + void Setup(size_t blksize, size_t nblock, + size_t ncyl, size_t nhead, size_t nsect); size_t BlockSize() const; size_t NBlock() const; + size_t NCylinder() const; + size_t NHead() const; + size_t NSector() const; virtual bool Read(size_t lba, size_t nblk, uint8_t* data, RerrMsg& emsg) = 0; @@ -69,7 +74,10 @@ namespace Retro { protected: size_t fBlkSize; //!< block size in byte size_t fNBlock; //!< disk size in blocks - + size_t fNCyl; //!< # cylinder + size_t fNHead; //!< # heads (aka surfaces) + size_t fNSect; //!< # sectors + protected: static std::string sDefaultScheme; //!< default scheme }; diff --git a/tools/src/librw11/Rw11VirtDisk.ipp b/tools/src/librw11/Rw11VirtDisk.ipp index 4b3483be..6772e118 100644 --- a/tools/src/librw11/Rw11VirtDisk.ipp +++ b/tools/src/librw11/Rw11VirtDisk.ipp @@ -1,6 +1,6 @@ -// $Id: Rw11VirtDisk.ipp 983 2018-01-02 20:35:59Z mueller $ +// $Id: Rw11VirtDisk.ipp 1061 2018-10-27 17:39:11Z mueller $ // -// Copyright 2013- by Walter F.J. Mueller +// Copyright 2013-2018 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2018-10-27 1061 1.1 add NCylinder(),NHead(),NSector() // 2013-03-03 494 1.0 Initial version // 2013-02-19 490 0.1 First draft // --------------------------------------------------------------------------- @@ -28,10 +29,14 @@ namespace Retro { //------------------------------------------+----------------------------------- //! FIXME_docs -inline void Rw11VirtDisk::Setup(size_t blksize, size_t nblock) +inline void Rw11VirtDisk::Setup(size_t blksize, size_t nblock, + size_t ncyl, size_t nhead, size_t nsect) { fBlkSize = blksize; fNBlock = nblock; + fNCyl = ncyl; + fNHead = nhead; + fNSect = nsect; return; } @@ -51,4 +56,28 @@ inline size_t Rw11VirtDisk::NBlock() const return fNBlock; } +//------------------------------------------+----------------------------------- +//! FIXME_docs + +inline size_t Rw11VirtDisk::NCylinder() const +{ + return fNCyl; +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + +inline size_t Rw11VirtDisk::NHead() const +{ + return fNHead; +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + +inline size_t Rw11VirtDisk::NSector() const +{ + return fNSect; +} + } // end namespace Retro