[Oberon] File transfer; was, "all in one git tree"

peter at easthope.ca peter at easthope.ca
Thu Dec 31 21:20:54 CET 2020


From:	=?utf-8?Q?J=C3=B6rg_Straube?= <joerg.straube at iaeth.ch>
Date:	Thu, 31 Dec 2020 12:52:51 +0100
> I transfer file to and from Oberon with tftp (RFC1350, tftp client 
> on OberonOS, tftp server on other side).

TFTP client and server were also implemented in A2 by "be".
Modules TFTP.Mod (373 lines) and Oberon.TFTPTool.Mod (51 lines) are 

TFTP.Mod has "IMPORT IP, UDP, Files, Random, KernelLog;"

Random is used to find a vacant port.
	generator: Random.Generator;
				INC(retries); lport := 1024 + generator.Integer() MOD 64512;
				NEW(socket, lport, res)
			UNTIL (res # UDP.PortInUse) OR (retries > MaxSocketRetries);
According to 
port 69 is assigned to TFTP.  Why not use it?

An incremental search might be acceptable.

			(* Find a vacant ephemeral port. *)
			lport := 60000;
			topPort := lport + MaxSocketTries;
			(* Top ephemeral port is 64738.  I don't understand the origin of 64512. *)
			IF topPort > 64738 THEN topPort := 64738 END;
			NEW(socket, lport, res);
			WHILE(res = UDP.PortInUse) & (lport < topPort) DO
				NEW(socket, lport, res)

A FPGA board connects to the server by a serial crossover cable.
Analogously for an emulated V5 machine.

In linux at least, a server is readily available.

Regards,                                   ... P. L.

Tel: +1 604 670 0140            Bcc: peter at easthope. ca

More information about the Oberon mailing list