QDOS TCP/IP programming in Assembler

Anything QL Software or Programming Related.
User avatar
tofro
Font of All Knowledge
Posts: 3112
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QDOS TCP/IP programming in Assembler

Post by tofro »

Yep. And I promise to not mess up the "y" and "i" Martins again in future, sorry ;)

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Martin_Head
Aurora
Posts: 973
Joined: Tue Dec 17, 2013 1:17 pm

Re: QDOS TCP/IP programming in Assembler

Post by Martin_Head »

Thanks for the response's. I suspect the "127.0.0.1" I used for the server is real problem. The "C" program that I converted (C is not a language that I know), used something about INADDRESS_ANY, but did not say what the actual value was, just that it was any address. So I tried the 127..., and It worked OK while I tested the two programs on the same computer, so I left it at that.

I don't really know a lot about Networks, I can just about get PC's talking to each other. So long as nothing goes wrong. In which case I tend to get a bit stuck.

I should also have known better than to do this test on Friday the 13th...


Martin Head


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

Re: QDOS TCP/IP programming in Assembler

Post by Martin_Head »

I finally managed to get a two way chat program in assembler working between two QPC2's , using a TCP connection (After much trial and error, I gave up for the moment on trying to get a UDP connection working in both directions).

There are two programs, a Client, and a Server. See the ReadMe file in the Zip for details, but basically you have each program running in a copy of QPC2 on two computers, or two copies of QPC2 running on the same computer. You type a message into one QPC2, and it appears on the other.

I have only tested the programs on QPC2, but they should work on other emulators that support the IP drivers.

I have also included a small program (IPData), that I put together while playing with the IP drivers. It supplies some basic data about a IP channel ID. It shows the last Linux/C error number that occurred from one of the IP system trap calls, and the IP addresses and Port numbers for the host and peer connections for the IP channel ID.

The document (IPManual), Is a document to aid in programming in assembler, that I have cobbled together as I have been going along, from documents by Richard Zidlicky and Jonathan Hudson, and from 'C' code and information from the internet.

It lists and describes the IP system calls, and data structures used. It also includes a list of 'C' error codes and descriptions to help you when debugging machine code programs.

The document is unfinished, and still very much a work in progress, so it's bit patchy. However I have included it here in case anyone is interested in programming the IP drivers in assembler, or to help if anyone wants to understand the Client/Server program.

The document is intended to be printed as a booklet on A5 paper.

Martin Head
Attachments
IPManual.zip
(191.44 KiB) Downloaded 189 times
IPData.zip
(3.54 KiB) Downloaded 180 times
ClientServer.zip
(6.91 KiB) Downloaded 179 times


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

Re: QDOS TCP/IP programming in Assembler

Post by Martin_Head »

This is an update to my IP manual (see above post). It's been tidied up a bit, and I've tried to make the descriptions of the commander clearer.

I have also included some observations I have made on what IP ports will, and will not open.

I have still not been able to get the UDP, sendto and recvfrom commands to work in QPC2. And UDP ports seem to be unreliable, in that sometime they work as expected, and sometime they don't.

Also on some quick tests with Qemulator, it does not seem to want to open UDP ports at all.
Attachments
QDOS_TCP.zip
(238.16 KiB) Downloaded 205 times


User avatar
QLvsJAGUAR
Gold Card
Posts: 485
Joined: Tue Feb 15, 2011 8:42 am
Location: Lucerne, Switzerland
Contact:

Re: QDOS TCP/IP programming in Assembler

Post by QLvsJAGUAR »

Thanks to the great work of Martin, TCP/IP for QL/E is coming soon...

Teaser:
https://www.youtube.com/watch?v=RFOXECsPXrY


QL forever!
https://www.sinclairql.net/ - Go and get THE DISTRIBUTION & QL/E!
https://www.youtube.com/QLvsJAGUAR/community - Blog
https://www.youtube.com/QLvsJAGUAR - Dedicated QL videos
Sinclair, QL, ATARI, JAGUAR, NUON, APPLE, NeXT, MiST & much more...
Videos, pictures & information
Derek_Stewart
Font of All Knowledge
Posts: 4727
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: QDOS TCP/IP programming in Assembler

Post by Derek_Stewart »

Hi,

The You Tube Video looks good.

Do you think that a web browser could be written for the QPC2.

Just one worry? is the Trap#2 calls being redefined.

IF so is there any problems with the re-definition.


Regards,

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

Re: QDOS TCP/IP programming in Assembler

Post by Martin_Head »

Derek_Stewart wrote:Hi,

The You Tube Video looks good.

Do you think that a web browser could be written for the QPC2.

Just one worry? is the Trap#2 calls being redefined.

IF so is there any problems with the re-definition.
I don't know about a Web browser, But I have written a very simple Web server for QPC2

Not sure what what you mean by Trap#2 calls redefined?

Martin Head


User avatar
Outsoft
Super Gold Card
Posts: 697
Joined: Sat Apr 19, 2014 1:30 pm
Location: Italy
Contact:

Re: QDOS TCP/IP programming in Assembler

Post by Outsoft »

Derek_Stewart wrote:Hi,

The You Tube Video looks good.

Do you think that a web browser could be written for the QPC2.

Just one worry? is the Trap#2 calls being redefined.

IF so is there any problems with the re-definition.
Great job!


Post Reply