Q68 QoE Ethernet Driver

Anything QL Software or Programming Related.
Post Reply
User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Q68 QoE Ethernet Driver

Post by janbredenbeek »

Martin_Head wrote:
janbredenbeek wrote:I was able to successfully run QBOX as Telnet server on the Q68. Couldn't get QLTerm to work as Telnet client though,
Hi Jan, Did you try to investigate why QLTerm would not work? Is it a missing feature, or bug I need to find.
QLTerm itself isn't TCP aware, but a Basic procedure opens an outgoing TCP connection (using OPEN_IN) and passes the channel to QLTerm.
I will download the new version and test it asap.


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Q68 QoE Ethernet Driver

Post by janbredenbeek »

Martin_Head wrote:Here is Version 0.25 of the driver. I have been trying to fix the random bad packet problems, And yesterday I threw my test programs at it, and saw no problems. So I thought I would post it.
I noticed that the ETH_PING command hangs the machine (it worked with 0.22). Also ETH_INIT breaks the ethernet link and returns 'not complete' (like 0.22).
Apart from that, running QBOX as server works and I have the impression file transfers have less errors (but still not error-free).


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Q68 QoE Ethernet Driver

Post by Martin_Head »

janbredenbeek wrote:
Martin_Head wrote:Here is Version 0.25 of the driver. I have been trying to fix the random bad packet problems, And yesterday I threw my test programs at it, and saw no problems. So I thought I would post it.
I noticed that the ETH_PING command hangs the machine (it worked with 0.22). Also ETH_INIT breaks the ethernet link and returns 'not complete' (like 0.22).
Apart from that, running QBOX as server works and I have the impression file transfers have less errors (but still not error-free).
Thanks for the update, I will look into these issues. I would expect the ETH_INIT command to break the Ethernet link as it resets the CP2200 controller. Don't know why it comes back 'not complete'. Does the Ethernet connection link get remade, or does it break things completely.

Do you know what kind of errors you see? Can you capture the packets with Wireshark so I can get an idea of where things go wrong.

At the moment I am trying to take a bit of a break from the program.


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Q68 QoE Ethernet Driver

Post by Martin_Head »

I am still chasing the elusive disappearing packets problem. But I have been thinking about adding a new IP device driver system call to my Q68 Ethernet driver. Which returns various information about the current state of the IP driver.

Code: Select all

IP_XINF		TRAP#3		D0=7D

Call parameters			Return parameters

D1					D1.W  length of block returned
D2.W  length of buffer	D2.W  preserved
D3.W  timeout			D3.L   preserved

A0	channel ID			A0	preserved
A1	base of buffer		A1	preserved
A2					A2	preserved
A3					A3	preserved

Error returns

	NC	not complete
	NO	not open
	BO	buffer overflow



Proposed layout of returned data block

Keys for the system data
inf_ddbase		$00     ;long     base of driver definition block
inf_driverID		$04     ;long     driver ID as a 4 byte string e.g. 'Q68E'
inf_driverVer		$08     ;long     driver version as a 4 byte string e.g. '0.78'
inf_compID		$0C     ;long     computer ID as a 4 byte string e.g. 'Q68 ', 'QPC2', 'SMSQ', 'QEMU'
inf_mac			$10     ;6 bytes  system MAC address
inf_IPadd			$16     ;long     system IP address
inf_subnet 		$1A     ;long     system subnet mask
inf_gateway 		$1E     ;long     system gateway/router address
inf_compName		$22     ;word + up to 26 bytes    system network name
inf_txpackets		$3E     ;long     number of packets sent by the CP2200
inf_txbytes 		$42     ;long     number of bytes sent by the CP2200
inf_rxpackets 		$46     ;long     number of packets received by the CP2200
inf_rxbytes 		$4A     ;long     number of bytes received by the CP2200

Keys for channel data
inf_peerMac 		$4E     ;6 bytes  peer MAC address
inf_peerIP 		$54     ;long     peer IP address
inf_peerPort		$58     ;word    peer port number 
inf_sysPort 		$5A     ;word    system port allocated to channel
inf_sckType 		$5C     ;byte     socket type  1 = TCP, 0= UDP, -1=SCK
inf_protocol 		$5D     ;byte     channel protocol e.g 17 = UDP
inf_access 		$5E     ;byte     channel access mode (D3 on open call)
inf_sockStat 		$5F     ;byte     socket status

inf_end 			$60     ;end of extended info block
Sorry it's a bit wonky, But that's the best it came out as.

Is there any extra information that is wanted, or is some information not wanted, or in a different format?

Are there any other system calls wanted?

I have tried to allow for other systems and emulators to use this system trap. So should the driverID, driverVer, and compID be longer than 4 bytes to accommodate them.

Is there a limit to the values of D0 for Trap calls? I don't ever remember seeing Trap values above $7F.

If $7F is the upper limit, then there is not much room left in the IP device drivers, so should I use a D0 value outside the usual IP driver range, like $4F


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Q68 QoE Ethernet Driver

Post by NormanDunbar »

martin_head wrote:so should I use a D0 value outside the usual IP driver range, like $4F
For a Trap #3, $4F is IOF_XINF, get extended information. Or am I missing the obvious again?

As far as I know, the full list of trap 3 calls are all listed at http://qdosmsq.dunbar-it.co.uk/doku.php ... ap_3:start -- but I'm happy to be corrected.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Q68 QoE Ethernet Driver

Post by janbredenbeek »

NormanDunbar wrote:
martin_head wrote:so should I use a D0 value outside the usual IP driver range, like $4F
For a Trap #3, $4F is IOF_XINF, get extended information. Or am I missing the obvious again?

As far as I know, the full list of trap 3 calls are all listed at http://qdosmsq.dunbar-it.co.uk/doku.php ... ap_3:start -- but I'm happy to be corrected.
The Pointer Interface uses TRAP#3 keys with D0=$6c to $7f. Given the fact that the IP driver uses $50 to $7c, there already is a considerable overlap in key values. Unfortunately, values above $7f are not possible since the I/O subsystem strips bits 7-31 from D0 on entry to the TRAP handler before calling the device I/O routine.

That said, it would of course be a bit silly to use the higher D0 keys which usually perform very device-specific functions on devices which obviously are not meant to perform such functions. Nevertheless, it shouldn't be made too easy to call these functions from BASIC. A DIR on a TCP_ device which uses the same key as IOF.XINF but returns very different results (requiring a much larger buffer!) would have disastrous effects so better keep this in a high range.

Jan.


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Q68 QoE Ethernet Driver

Post by Martin_Head »

Here is version 0.30 of the Ethernet driver.

I have been bug hunting, and spent a lot of time chasing a problem of some packets randomly not being sent. Which eventually turned out to be due to the PC's network controller setting itself to half duplex, when the Q68 was in full duplex mode. So the packets were actually sent, But the PC did not see them.

I've also got a problem with the CP2200 controller and it's Autowrite feature. So at the moment I am not using the Autowrite feature.

The initialization of the driver has changed slightly, and I have implemented the IP_XINF system call from the above posts. See the documentation for details.
Attachments
Version030.zip
(259.12 KiB) Downloaded 84 times
Documents030.zip
(371.02 KiB) Downloaded 90 times


User avatar
Peter
QL Wafer Drive
Posts: 1953
Joined: Sat Jan 22, 2011 8:47 am

Re: Q68 QoE Ethernet Driver

Post by Peter »

Many thanks for the update. I have not yet been able the find any useful information about the autowrite issue. It appears that autowrite is not used in any publicly available driver code, which looks suspicious. I would not be surprised if this is actually a hardware bug in the CP2200.


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Q68 QoE Ethernet Driver

Post by Martin_Head »

Here is an update to the Q68 Ethernet driver, Version 0.34

There has been a re-branding of the driver as the 'QoE Ethernet driver for Q68'.

This version adds DHCP support. So it can obtain an IP address from the network. And it also handles the lease renewals of the IP address.

Spanish initialization text messages have also been added, and a couple of bugs have been fixed.

I have also included a SuperBASIC procedure 'ETH_IPconfig' which displays some network information.
Should this command be added into the driver, or kept external? Maybe as an executable?
Are there any other extra commands that you would like to see?
Attachments
Q68Net034.zip
(298.35 KiB) Downloaded 72 times
Q68NetDocs034.zip
(442.36 KiB) Downloaded 79 times


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Q68 QoE Ethernet Driver

Post by Derek_Stewart »

Hi,

I connected a Q68 to my LAN and successfully connected to SMSQmulator on my Linux laptop, using the Q68 as as server, I could transfer files with the Qpac2 Files Thing.

All works very nicely, excellent work.


Regards,

Derek
Post Reply