First post, by superfury
I've been working on adapting the lsppp driver for the EtherDFS protocol.
The orignal post is found here: Re: EtherDFS - a network drive for DOS
I'm continuing the information I discover on it (trying to get it running with my newly implemented EDFS PPP protocol routing from the client's connected Ethernet II drivers and programs to either another client running the same EDFSPPP driver or UniPCemu's packet server to run it through to real Ethernet) here.
One nice thing I've also added is functionality to perform a direct PPP connection with another device listening on the serial port (which is another copy of it's own driver, running in Hayes modem answer mode). So it can be dialed to to setup a 2-computer network of sorts. Although, it cannot handle PAP/CHAP when in answer mode (it isn't supported in it's source code), so it will force those disabled (not used) for the caller.
The call to DecodePacketByte at TSR.ASM (line 178) will receive the entire packet from the PPP datastream of the serial port.
After that, for some reason, it won't be parsed any more while the connect function is running for some reason?
It should reach 'ciend' with the packet fully queued.
From line 340 it will check if it's already dispatched. If not (it shouldn't usually), it reaches rcvlp, which enables interrupts during the dispatch, loads the length, protocol and buffer into cx, ax and si, calls the logging function and finally calls lcp_handler to make it handle the incoming packets.
So lcp_handler is where the whole incoming protocol packets etc. starts for when they're fully received and decoded. The code that executes doesn't seem to have any blocks, so incoming packets should be properly parsed.
The question of course is is the same counts for outgoing packets, which might be the issue. Or even more basic in this case: the raising of the open state of the EDFSCP layer (which might not actually be happening properly, seeing as the client doesn't seem to respond to the configure-requests from the packet server that's running on the other end (it's trying to open the EDFSCP layer when both incoming and outgoing connections are made). For some reason, the incoming connection (from server to client) is made, but outgoing isn't capable of being made, as the EDFSPPP client isn't reponding to the server's configure-req packets with a ACK/NAK/REJECT packet to make the connection, for some reason? The EDFSPPP client waits for the connection to come up (or a ESC keypress to force continue it, although not displayed on the screen). It mainly waits for the EDFSCP's layer to come up (through the LCP_handler function in LCP.ASM, which should eventually cause the state machine to trigger an ipcpup event once the connection is properly made). But for some reason, I see on the packet server that's connected that both ACKs have been made (the packet server's configure-request only gets ACKed/NAKed/REJected after the driver goes resident, not before the edfs-up.bat file is created, which is an issue, as it requires the EDFSCP layer to be properly up to get it's required information about the connected addresses to write to the file).
Edit: Yay! Managed to find the bug! It was a simple hexadecimal notation that was misinterpreted:
"or byte ptr [ipaddr_up],Ch".... When you remember that tasm actually interprets Ch not as hexadecimal 0xC, but as register CH (which is zero in this case!). So at best, an invalid number gets stored, at worst, the required operation (setting a flag that the layer has come up to serve the packets) does nothing (because the ch register (and CX for that matter) is zeroed in this case.
It's finally running now! 😁
Edit: Fixed a bug that was causing the CX register to be corrupted when returning from the sendparams function when sending a packet.
Edit: It's properly sending packets now, as I see UniPCemu's packet server receiving the packets and relaying them to the Ethernet II network without issues while sending.
Although I don't have any Ethersrv server ready to verify it's receiving functionality as well, that's for a later time to test.
The driver source code: https://bitbucket.org/superfury/etherdfs-ppp/
For now, the driver is working properly! 😁
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io