durgadas311 / cpnet-z80

27 stars 6 forks source link

SHOW is displaying wrong data under CP/NET if server(s) are down #3

Open durgadas311 opened 4 years ago

durgadas311 commented 4 years ago

Looks like some sort of memory corruption when using submit while ndos3 is loaded:

A>type test.sub
dir b:
show
A>submit test

A>dir b:
B: DAA      COM : CPUTEST  COM : ZEXALL   COM : ZEXDOC   COM 
A>show

A: RO, Space:     7,500k
B: RO, Space:     8,136k
C: RO, Space:     8,168k
D: RO, Space:     8,168k
E: RO, Space:     8,168k
F: RO, Space:     8,168k
G: RO, Space:     8,168k
H: RO, Space:     8,168k
CP/M Error On I: Disk I/O
BDOS Function = 14 
A>

Only drives A:, B:, and (networked) O: had been accessed (logged in), so not other drives should have been shown. Also, drives are marked RO.

durgadas311 commented 4 years ago

The problems I'm seeing on the H8xSPI appear as soon as ndos3 is started. submit is not required.

durgadas311 commented 4 years ago

It turns out this behavior is the result of one of the servers being down, but (at least) one drive is still mapped to that server. It would seem that the network functions for GET READ-ONLY VECTOR and RETURN LOGIN VECTOR are returning erroneous results when one (or more) servers are down.

This may be a day-one CP/NET bug, or design flaw.

durgadas311 commented 4 years ago

The bug here is a design flaw in both CP/NET 1.2 and CP/NET 3. The RETURN LOGIN VECTOR and GET READ-ONLY VECTOR functions both iterate over all 16 possible drives, and either check the local BDOS or the remote server for the status of each drive. If a send message fails (as is the case when a server is not reachable), the result is to abort and return 0xffff. Therefor, all drives appear to be logged in and R/O.