Show HN: Use BIOS ram hacks to make an SSH server for MS-DOS, INT 10 13h OS's
github.com
github.com
qemu-system-i386 -fda Dos6.22.img -boot a -vnc :0 -s
QEMU: Terminated via GDBstub
2014/09/06 16:49:59 Starting GDB client
2014/09/06 16:49:59 Starting VNC client
2014/09/06 16:49:59 Starting SSH server
2014/09/06 16:49:59 Waiting for TCP conns on 0.0.0.0:2222
2014/09/06 16:50:00 Sent FB out
2014/09/06 16:50:01 write tcp 127.0.0.1:1234: connection reset by peer qemu-system-i386 --version
QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard
Should i try to compile a current version without qemu-kvm patches?$ qemu-system-i386 --version QEMU emulator version 1.1.2 (Debian 1.1.2+dfsg-6a), Copyright (c) 2003-2008 Fabrice Bellard
- for ptr <= len(FB) {
+ for ptr < len(FB) {Yeah woops. I forgot to commit that fix.
This package simply queries the screen via GDB, sends it off to SSH connections, and sends any keystrokes via VNC to the DOS machine. From the title I thought the SSH server runs directly on the DOS box, but as I understand, no Go code actually runs on the DOS machine.
Not a lot prettier, though...
high := code / 16;
low := code % 16;
switch high {
case 0: template += "40"
case 1: template += "44"
case 2: template += "42"
// ...
case 15: template += "43"
}
switch low {
case 0: template += ";30"
case 1: template += ";34"
// ...
case 15: template += ";33"
}
Or even s := [...]string{"0", "4", "2", ..., "3"}
template := "\x1B[4" + s[code / 16] + ";3" + s[code % 16] + "m"
(I don't know Go, so you will have to adjust to be valid, and I'm sure there's some sort of string formatting or something that makes the last suggestion more efficient.) colors := []string{"0", "4", "2", "6", "1", "5", "3", "7", "0", "4", "2", "6", "1", "5", "3"}
bg := colors[(b & 0xF0) >> 8]
fg := colors[b & 0x0F]
fmt.Sprintf("\x1B[4%d;3%dm", bg, fg)The VNC server is a complete fudge though, however I could not figure out a easy way to hook the keyboard interrupt fromGDB
I believe those are called Terminate and Stay Resident programs (TSRs).
> The VNC server is a complete fudge though, however I could not figure out a easy way to hook the keyboard interrupt fromGDB
How about pushing events into the circular BIOS keyboard queue at 40:1A?