Closed durgadas311 closed 4 years ago
If a solution to issue #6 is found, then this issue becomes unnecessary.
The difficulty with making a generic CP/NET 1.2 utility is that there is no public access to the SNIOS. There is no way to discover the starting address of the SNIOS, without making assumptions about the size of the NDOS, or hacking through the NDOS code at runtime (assumptions about the NDOS code paths).
One other method is to assume that the SNIOS jump entries are immediately before the network config table. This is currently the case for all existing SNIOS implementations (in this repo), but we have no mechanism to enforce. This would allow retrieving the network config table address (NDOS function 69) and then backing up to the SNIOS JMPs (only if CP/NET 1.2, though).
Added a generic NETDOWN utility to call SNIOS NTWKDN and wait for user to power-off or RESET.
There is currently no way to close all (CP/NET) sockets on a CP/NET 1.2 W5500-based system (CP/NET3 already shuts down cleanly when the RSX is removed).
The JMP table in the SNIOS has been extended to include a shutdown entry:
However, after calling that routine the program must not warmboot (or otherwise return to the OS) or else sockets will get re-opened. In the absence of a way to unload CP/NET entirely, this routine could be followed by a prompt like "Ready for RESET or Power off", and then just wait for console input. If the user types a character, then return to CP/NET (possibly announcing that the network is back up).