w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11UnitDisk.hpp
Go to the documentation of this file.
1// $Id: Rw11UnitDisk.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2017-04-07 868 1.0.3 Dump(): add detail arg
8// 2015-03-21 659 1.0.2 add fEnabled, Enabled()
9// 2015-02-18 647 1.0.1 add Nwrd2Nblk()
10// 2013-04-19 507 1.0 Initial version
11// 2013-02-19 490 0.1 First draft
12// ---------------------------------------------------------------------------
13
14
19#ifndef included_Retro_Rw11UnitDisk
20#define included_Retro_Rw11UnitDisk 1
21
22#include "Rw11VirtDisk.hpp"
23
24#include "Rw11UnitVirt.hpp"
25
26namespace Retro {
27
28 class Rw11UnitDisk : public Rw11UnitVirt<Rw11VirtDisk> {
29 public:
30 Rw11UnitDisk(Rw11Cntl* pcntl, size_t index);
32
33 virtual void SetType(const std::string& type);
34
35 const std::string& Type() const;
36 virtual bool Enabled() const;
37 size_t NCylinder() const;
38 size_t NHead() const;
39 size_t NSector() const;
40 size_t BlockSize() const;
41 size_t NBlock() const;
42
43 uint32_t Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se);
44 void Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
45 uint16_t& se);
46 uint32_t Nwrd2Nblk(uint32_t nwrd);
47
48 void SetWProt(bool wprot);
49 bool WProt() const;
50
51 bool VirtRead(size_t lba, size_t nblk, uint8_t* data,
52 RerrMsg& emsg);
53 bool VirtWrite(size_t lba, size_t nblk, const uint8_t* data,
54 RerrMsg& emsg);
55
56 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
57 int detail=0) const;
58
59 protected:
60 std::string fType;
61 bool fEnabled;
62 size_t fNCyl;
63 size_t fNHead;
64 size_t fNSect;
65 size_t fBlksize;
66 size_t fNBlock;
67 bool fWProt;
68 };
69
70} // end namespace Retro
71
72#include "Rw11UnitDisk.ipp"
73
74#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: Rw11Cntl.hpp:42
size_t fBlksize
block size (in bytes)
size_t NCylinder() const
FIXME_docs.
void SetWProt(bool wprot)
FIXME_docs.
bool fEnabled
unit enabled
std::string fType
drive type
bool VirtWrite(size_t lba, size_t nblk, const uint8_t *data, RerrMsg &emsg)
FIXME_docs.
bool WProt() const
FIXME_docs.
size_t NHead() const
FIXME_docs.
const std::string & Type() const
FIXME_docs.
uint32_t Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
FIXME_docs.
size_t NBlock() const
FIXME_docs.
virtual void SetType(const std::string &type)
FIXME_docs.
size_t NSector() const
FIXME_docs.
size_t BlockSize() const
FIXME_docs.
bool fWProt
unit write protected
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
bool VirtRead(size_t lba, size_t nblk, uint8_t *data, RerrMsg &emsg)
FIXME_docs.
virtual bool Enabled() const
FIXME_docs.
~Rw11UnitDisk()
Destructor.
void Lba2Chs(uint32_t lba, uint16_t &cy, uint16_t &hd, uint16_t &se)
FIXME_docs.
uint32_t Nwrd2Nblk(uint32_t nwrd)
FIXME_docs.
Implemenation (inline) of Rw11UnitVirt.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47