MattHacker
New Member
- Joined
- Aug 1, 2008
- Messages
- 5
According to the Packet Driver Specification (available at http://www.crynwr.com/packet_driver.html), there is no function to receive packets. Instead, when you call the access_type function, you provide a segment and offset of a subroutine (in ES:DI) that is executed every time a packet is received.
This is in contrast to Trumpet TCP, which I have been using. I got fed up with its instability, so I want to write my own TCP/IP implementation.
With Trumpet TCP, you provide the segment and offset of a buffer (which is easy in QuickBASIC: use VARSEG() and VARPTR() on a fixed-length string) as well as some other stuff, then call a function to move data into that buffer.
I'm pretty sure I'll have to put some code into a string and provide the segment and offset of that string to the packet driver in ES:DI when I call the access_type function.
This assembler program is the main thing I'm asking for help with... I'm not sure what to do or where to start, and I don't really have much (any?) x86 assembler programming experience...
If anyone is willing to help me out with this, I would appreciate it.
(PS: I'm not asking about the practicality of implementing a TCP/IP stack in QB or how I should really use <insert other language here> instead. I know it will be a quite a challenge and a tight fit. I'm here to ask for help with this one issue so I can get started on the rest of the stuff.)
(PSS: I'm not asking about whether I am capable of implementing a TCP/IP stack, either. I know it's tough, TCP in particular is a real pain. IIRC, Mike Brutman (mbbrutman) took two and a half years to finally get his implementation just right. Don't tell me it's hard. I already know what I'm getting into with this.)
This is in contrast to Trumpet TCP, which I have been using. I got fed up with its instability, so I want to write my own TCP/IP implementation.
With Trumpet TCP, you provide the segment and offset of a buffer (which is easy in QuickBASIC: use VARSEG() and VARPTR() on a fixed-length string) as well as some other stuff, then call a function to move data into that buffer.
I'm pretty sure I'll have to put some code into a string and provide the segment and offset of that string to the packet driver in ES:DI when I call the access_type function.
This assembler program is the main thing I'm asking for help with... I'm not sure what to do or where to start, and I don't really have much (any?) x86 assembler programming experience...
If anyone is willing to help me out with this, I would appreciate it.
(PS: I'm not asking about the practicality of implementing a TCP/IP stack in QB or how I should really use <insert other language here> instead. I know it will be a quite a challenge and a tight fit. I'm here to ask for help with this one issue so I can get started on the rest of the stuff.)
(PSS: I'm not asking about whether I am capable of implementing a TCP/IP stack, either. I know it's tough, TCP in particular is a real pain. IIRC, Mike Brutman (mbbrutman) took two and a half years to finally get his implementation just right. Don't tell me it's hard. I already know what I'm getting into with this.)