Monday, October 6, 2014

ppp over ssh

Just as reminder to myself, here is an easy ppp over ssh solution with openbsd as server and linux as client.
Openbsd server:
  • Allow IP forwarding for nat: sysctl net.inet.ip.forwarding=1
  • Configure NAT in /etc/pf.conf:
    
    ext_if="xl0"
    int_if="ppp0"
    ext_ip="*.*.*.*" # your's external IP
    int_net="10.0.0.1/24"
    match out on {$ext_if} from {$int_net} to any nat-to {$ext_ip} 
    pass out on {$ext_if} from {$int_net} to any
    
    
  • Create a user ppp, configure linux client and openbsd's server user ppp, [optionally, but highly recommended] set ssh key auth, check that ssh ppp@server linux client reaches openbsd's shell. Add ppp user to /etc/ftpusers. Disable password auth for that user.
  • Create /usr/local/bin/ppplogin and make it executable for user ppp:
    
    #!/bin/sh
    TTY=`tty`
    /usr/sbin/pppd $TTY nodetach proxyarp ms-dns server.dns.IP.addr 10.0.0.1:
    exit
    
    
    [UPD: no need for proxyarp, probably] In /etc/ppp/chap-secrets create an ppp auth entry:
    
    clientusername * clientpassword 10.0.0.12
    
    
  • Add /usr/local/bin/ppplogin to /etc/shells. Also check if you have ppp0 interface; you may need to run ifconfig ppp0 create (and several ppp interfaces if you need it)
  • On linux client side, create callppp script:
    
    pppd debug nodetach defaultroute usepeerdns name clientusername passive pty  \
        "ssh ppp@openbsd.serv.er -o Batchmode=yes"
    
    
    Strange thing, if we say defaultroute - it does not help us to set the default route over the ppp link; we have to do that manually (in ip-up and ip-down scripts)
  • An auth entry in /etc/ppp/chap-secrets:
    clientusername * clientpassword
  • In /etc/ppp/ip-up:
    
    /sbin/route add -host openbsd.serv.er gw yours.ethernet.default.gw
    /sbin/route del default 
    /sbin/route add default gw $5 
    
    
    (also, here you can keed those routes that should not pass via ppp interface)
  • And in /etc/ppp/ip-down we should restore everything back:
    
    /sbin/route del default
    /sbin/route del -host openbsd.serv.er
    /sbin/route add default gw yours.ethernet.default.gw
    
    

Do not forget to run traceroute and check how are you connected to the internet now.
And the last advice: do not listen to my advices [because I do not undestand anything in the things I write, at least for now, even handcrafted that all myself], read all the docs and do it the right way (mostly be aware of some security holes in this installation - but only in OpenBSD NAT rules, I believe).

Sunday, October 5, 2014

Compaq Prosignia 486 VS

For years, I owned Compaq Prosignia VS motherboard and now it is old enough to turn it on.
And, well, it is one of the most tricky 486 computer I've ever touched.
This is the first part of story.

First, yes, it can be run from an AT PSU, but WARNING! - it must not be plugged as in normal PC AT PSU, but with a specific shift. Better read the docs, if you fail - you'll burn it (maybe I'll post photo later). [UPD: see it here (Let me explain: looking from CPU side: left, 5 pin socket: Black HANGING in air covering no pins, next Black, Blue, Light Yellow, Red, Dark Yellow; right: Red Red Red White Black Black Unconnected pin)]
Next, a SCSI drive. I use IBM 4G 68pin drive via SCSI converter.
And a floppy.

As you know, old Compaqs has a system partition instead of BIOS setup program. You have to download Compaq System Configuration Utility and to install it first.
Can you avoid it? Looks like yes. But if you want to see your's SCSI controller settings itself, install it.

Then I've installed FreeDOS from a floppy and tried to find PCNET packet driver. And failed! Because the onboard PCNET32 is EISA. It means it behaves mostly as ISA one, but 32 bit wide and on io 0x8800.
Ok, let's install an old linux - sure, that to be Slackware, saying, 7.1. I've downloaded (via Null Modem and conex.exe (c) 98 Erhard Hilbig -nice small and simple DOS terminal with Zmodem) n_53c7xx.s and color.gz - and it could not find SCSI controller. I boot it via loadlin,exe, btw.
It needs to know the IO and IRQ of SCSI contoller, that is done by
loadlin bzImage root=/dev/ram rw initrd=c:\linux\color.gz sim710=addr:0x8000,irq:14
Guess what? It refuses to see both pcnet32 and lance network! (and it sees only 16M of my 40M of RAM)
[end of first part]

Friday, September 19, 2014

CP/M 68: linking an C and asm file together

I've googled for this stuff for some time, but finished with reading docs. May be that will be usefull for someone else (notibly me when I will look for that once again)
dtzputs.s , implements dtzputs via calling BDOS fn 2

        text
        globl   _dtzputs
_dtzputs:
        move.l  4(sp),a1        *taking argument from stack
dtzputsl:
        move.b  (a1)+,d1        *take next char; should if be ANDed with 0x00FF ? A1 expected to be w
        cmpi.b  #0,d1
        beq     dtzputse
        move.l  a1,-(sp)        *storing string pointer to stack
        move.w  #2,d0           * calling BDOS '2'
        trap    #2
        move.l  (sp)+,a1
        bra     dtzputsl
dtzputse:
        rts

Assemble it with AS68 -L -U -S 0: dtzputs.s , get dtzputs.o
test.c ,calls dtzputs

main()
{
 dtzputs("Fuck a duck");
}

Compile it with C TEST like that:
9C>c test

9C>CP68 -I 0: TEST.C TEST.I

9C>C068 TEST.I TEST.1 TEST.2 TEST.3 -F

9C>ERA TEST.I

9C>C168 TEST.1 TEST.2 TEST.S

9C>ERA TEST.1

9C>ERA TEST.2

9C>AS68 -L -U -S 0: TEST.S

9C>ERA TEST.S

9C>
And link it

9C>clink test dtzputs

9C>LO68 -R -U_NOFLOAT -O TEST.68K 0:S.O TEST.O DTZPUTS.O .O .O .O .O .O .O .O 0:CLIB

9C>test
Fuck a duck

Quack! Quack! Quack!
The next thing to understand is how to get rid of S.O and CLIB, but it is not for today.

Friday, September 5, 2014

Some more news on SGSBCSD

Looks like I have the code working with SDHC. I'll test in in a few days and release 0.00.04/2491.
So my future plans to port it to m68k code and update 68kavr project. UPD: 2491 version of Searle Grant SBC SD interface released. It works!

Wednesday, September 3, 2014

Huge SGSBCSD update - 2490

A lot of bug fixes for my SD interface for Searle Grant's SBC. A loot! If anyone have it installed - update it now

Friday, August 29, 2014

In a few days I plan to release a significant SGSBCSD [SD interface for Z80] code upgrade. At least a lot of bugfixes.
If anyone cares. Or otherwise, I do not care.

Friday, June 27, 2014

QooltermII at version 0.00.02 - first time update scince 1999!

Well
QoolTermII is [partitial] vt52 terminal emulator for Robotron PC 1715 now gets an updated version - 0.00.02. I bet it is the rarest updated software ever!
Now works with IOByte as well (saying, as bad) as with direct SIO.
Get it here