working DC11
This commit is contained in:
parent
135a111bbf
commit
f7816df7d9
15 changed files with 79 additions and 7 deletions
|
@ -230,6 +230,7 @@ void start_network(console *const c)
|
|||
}
|
||||
|
||||
dc11 *dc11_ = new dc11(b, comm_interfaces);
|
||||
dc11_->begin();
|
||||
b->add_DC11(dc11_);
|
||||
|
||||
cs->println("* Starting (NTP-) clock");
|
||||
|
|
|
@ -224,13 +224,18 @@ void comm_tcp_socket_server::operator()()
|
|||
|
||||
cfd = accept(fd, nullptr, nullptr);
|
||||
|
||||
if (cfd != INVALID_SOCKET) {
|
||||
set_nodelay(cfd);
|
||||
|
||||
DOLOG(info, false, "Connected with %s", get_endpoint_name(cfd).c_str());
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (setup_telnet_session(cfd) == false) {
|
||||
close(cfd);
|
||||
cfd = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
if (cfd != INVALID_SOCKET)
|
||||
set_nodelay(cfd);
|
||||
#endif
|
||||
}
|
||||
|
||||
DOLOG(info, true, "comm_tcp_socket_server thread terminating");
|
||||
|
|
14
dc11.cpp
14
dc11.cpp
|
@ -31,10 +31,7 @@ dc11::dc11(bus *const b, const std::vector<comm *> & comm_interfaces):
|
|||
b(b),
|
||||
comm_interfaces(comm_interfaces)
|
||||
{
|
||||
connected.resize(comm_interfaces.size());
|
||||
|
||||
// TODO move to begin()
|
||||
th = new std::thread(std::ref(*this));
|
||||
connected.resize(4); // FIXME keep same size as comm_interfaces
|
||||
}
|
||||
|
||||
dc11::~dc11()
|
||||
|
@ -78,6 +75,13 @@ void dc11::show_state(console *const cnsl) const
|
|||
}
|
||||
}
|
||||
|
||||
bool dc11::begin()
|
||||
{
|
||||
th = new std::thread(std::ref(*this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void dc11::test_port(const size_t nr, const std::string & txt) const
|
||||
{
|
||||
DOLOG(info, false, "DC11 test line %zu", nr);
|
||||
|
@ -115,6 +119,7 @@ void dc11::operator()()
|
|||
|
||||
if (is_connected != connected[line_nr]) {
|
||||
DOLOG(debug, false, "DC11 line %d state changed to %d", line_nr, is_connected);
|
||||
Serial.printf("DC11 line %d state changed to %d\r\n", line_nr, is_connected);
|
||||
|
||||
connected[line_nr] = is_connected;
|
||||
|
||||
|
@ -306,6 +311,7 @@ dc11 *dc11::deserialize(const JsonVariantConst j, bus *const b)
|
|||
interfaces.push_back(comm::deserialize(v, b));
|
||||
|
||||
dc11 *r = new dc11(b, interfaces);
|
||||
r->begin();
|
||||
|
||||
for(int regnr=0; regnr<4; regnr++)
|
||||
r->registers[regnr] = j[format("register-%d", regnr)];
|
||||
|
|
2
dc11.h
2
dc11.h
|
@ -46,6 +46,8 @@ public:
|
|||
dc11(bus *const b, const std::vector<comm *> & comm_interfaces);
|
||||
virtual ~dc11();
|
||||
|
||||
bool begin();
|
||||
|
||||
JsonDocument serialize() const;
|
||||
static dc11 *deserialize(const JsonVariantConst j, bus *const b);
|
||||
|
||||
|
|
25
dc11.json
Normal file
25
dc11.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"interfaces": [
|
||||
{
|
||||
"comm-backend-type": "tcp-server",
|
||||
"port": 1100
|
||||
},
|
||||
{
|
||||
"comm-backend-type": "tcp-server",
|
||||
"port": 1101
|
||||
},
|
||||
{
|
||||
"comm-backend-type": "tcp-server",
|
||||
"port": 1102
|
||||
},
|
||||
{
|
||||
"comm-backend-type": "posix",
|
||||
"device": "/tmp/virtualcom0",
|
||||
"bitrate": 38400
|
||||
}
|
||||
],
|
||||
"register-0": 0,
|
||||
"register-1": 0,
|
||||
"register-2": 0,
|
||||
"register-3": 0
|
||||
}
|
1
main.cpp
1
main.cpp
|
@ -609,6 +609,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
dc11 *dc11_ = new dc11(b, comm_interfaces);
|
||||
dc11_->begin();
|
||||
b->add_DC11(dc11_);
|
||||
//
|
||||
|
||||
|
|
BIN
work/werkend-mu/base/unix_v7m_rl0.dsk.xz
Normal file
BIN
work/werkend-mu/base/unix_v7m_rl0.dsk.xz
Normal file
Binary file not shown.
BIN
work/werkend-mu/base/unix_v7m_rl1.dsk.xz
Normal file
BIN
work/werkend-mu/base/unix_v7m_rl1.dsk.xz
Normal file
Binary file not shown.
12
work/werkend-mu/run-term.sh
Executable file
12
work/werkend-mu/run-term.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#! /bin/sh
|
||||
|
||||
echo boot
|
||||
echo 'rl(0,0)munix'
|
||||
|
||||
rm ~/temp/ramdisk/test2.log
|
||||
|
||||
RS=128
|
||||
|
||||
echo 'socat TCP-LISTEN:2334,reuseaddr pty,link=/tmp/virtualcom0,raw'
|
||||
|
||||
./build/kek -r work/werkend-mu/unix_v7m_rl0.dsk -r work/werkend-mu/unix_v7m_rl1.dsk -b -S $RS -L info,debug -l ~/temp/ramdisk/test2.log -P -1 /tmp/virtualcom0 -d # -t
|
14
work/werkend-mu/run.sh
Executable file
14
work/werkend-mu/run.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#! /bin/sh
|
||||
|
||||
echo boot
|
||||
echo 'rl(0,0)unix'
|
||||
|
||||
rm ~/temp/ramdisk/test2.log
|
||||
|
||||
if [ "$1" = "fast" ] ; then
|
||||
./build/kek -r work/werkend-mu/unix_v7m_rl0.dsk -r work/werkend-mu/unix_v7m_rl1.dsk -b -S 256 -L error,info -l ~/temp/ramdisk/test2.log -P
|
||||
elif [ "$1" = "medium" ] ; then
|
||||
./build/kek -r work/werkend-mu/unix_v7m_rl0.dsk -r work/werkend-mu/unix_v7m_rl1.dsk -b -L error,info -l ~/temp/ramdisk/test2.log -d -S 256 -P
|
||||
else
|
||||
./build/kek -r work/werkend-mu/unix_v7m_rl0.dsk -r work/werkend-mu/unix_v7m_rl1.dsk -b -L error,debug -l ~/temp/ramdisk/test2.log -d -t -X -S 256 -P
|
||||
fi
|
BIN
work/werkend-mu/unix_v7m_rl0.dsk
Normal file
BIN
work/werkend-mu/unix_v7m_rl0.dsk
Normal file
Binary file not shown.
BIN
work/werkend-mu/unix_v7m_rl0.dsk.xz
Normal file
BIN
work/werkend-mu/unix_v7m_rl0.dsk.xz
Normal file
Binary file not shown.
BIN
work/werkend-mu/unix_v7m_rl1.dsk
Normal file
BIN
work/werkend-mu/unix_v7m_rl1.dsk
Normal file
Binary file not shown.
BIN
work/werkend-mu/unix_v7m_rl1.dsk.xz
Normal file
BIN
work/werkend-mu/unix_v7m_rl1.dsk.xz
Normal file
Binary file not shown.
6
work/werkend-mu/unpack-replace.sh
Executable file
6
work/werkend-mu/unpack-replace.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#! /bin/sh
|
||||
|
||||
cd /home/folkert/Projects/PDP-11/work/werkend-mu
|
||||
|
||||
xzcat unix_v7m_rl0.dsk.xz > unix_v7m_rl0.dsk
|
||||
xzcat unix_v7m_rl1.dsk.xz > unix_v7m_rl1.dsk
|
Loading…
Add table
Reference in a new issue