sharing my MiniTCP TCP/IP library for C...

Programming, for all ages and all languages.
Post Reply
User avatar
miker00lz
Member
Member
Posts: 144
Joined: Wed Dec 08, 2010 3:16 am
Location: St. Louis, MO USA

sharing my MiniTCP TCP/IP library for C...

Post by miker00lz »

i've been working on writing my own lightweight TCP/IP library in C for a while, which i was planning to use in my OS as well as some plain old DOS apps. my OS is 16-bit, so this code is designed for the same but it shouldn't take a lot of work to make it work as the TCP stack in a 32-bit OS. you would just have to tweak a little bit of the inline assembly, get rid of a few instances of "far" on some functions and a couple structures, and write replacements for the static void far interrupt callback and void pkt_send functions. those are the two that deal with packet drivers.

you can download the code in this link below. this web server you can get it from is actually a 4.77 MHz 8088. it's an original IBM 5150 PC, and the httpd software i wrote myself. it actually uses my MiniTCP library. so, you can see that it works and is light enough to work on the slowest PC ever made. :)

http://irc.rubbermallet.org:8088/index.htm

here is the preliminary PDF reference manual for the library functions: http://rubbermallet.org/MiniTCP_program ... erence.pdf

it's written for Borland Turbo C++ and TASM. Borland released TC++ 1.01 and TASM as public domain some years ago, so if you need it here is all you need in a ZIP:

http://rubbermallet.org/tcpp101.zip

i wouldn't be surprised if there are some bugs, and if you use it and run into problems please let me know. for what it's worth, i've run the httpd program on that computer for 2 and 3 weeks at a time before, it never stopped working. that even included about an hour of some jackass trying to LOIC it. it kept working.

if you need some help, just post here and i'll help.

P.S. here's a couple screenshots of the "rawterm" example program connecting to a telnet BBS:

http://rubbermallet.org/minitcp-bbs1.png
http://rubbermallet.org/minitcp-bbs2.png
User avatar
Thomas
Member
Member
Posts: 281
Joined: Thu Jun 04, 2009 11:12 pm

Re: sharing my MiniTCP TCP/IP library for C...

Post by Thomas »

Mike,
That is seriously cool ! 8)

--Thomas
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Re: sharing my MiniTCP TCP/IP library for C...

Post by Jezze »

Holy crap. An 8088? I haven't used one of those for ages =)
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
User avatar
miker00lz
Member
Member
Posts: 144
Joined: Wed Dec 08, 2010 3:16 am
Location: St. Louis, MO USA

Re: sharing my MiniTCP TCP/IP library for C...

Post by miker00lz »

and with good reason, those things are unbelievably slow. i can't believe how far we've come in like just 30 years.
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: sharing my MiniTCP TCP/IP library for C...

Post by Ready4Dis »

Tried to download, link isn't working :).
User avatar
miker00lz
Member
Member
Posts: 144
Joined: Wed Dec 08, 2010 3:16 am
Location: St. Louis, MO USA

Re: sharing my MiniTCP TCP/IP library for C...

Post by miker00lz »

really? it's working for me. anybody else having a problem getting to it?
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: sharing my MiniTCP TCP/IP library for C...

Post by Ready4Dis »

Network Error


The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.

A communication error occurred: "Connection refused"


That's what I click the link. Will try from home if i remember, might just be my work blocking stuff.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: sharing my MiniTCP TCP/IP library for C...

Post by piranha »

Works for me.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
miker00lz
Member
Member
Posts: 144
Joined: Wed Dec 08, 2010 3:16 am
Location: St. Louis, MO USA

Re: sharing my MiniTCP TCP/IP library for C...

Post by miker00lz »

Ready4Dis wrote:Network Error


The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.

A communication error occurred: "Connection refused"


That's what I click the link. Will try from home if i remember, might just be my work blocking stuff.
out of curiosity, are you still having problems connecting to the 8088 server from your computer at work? if you are, could you give me a little basic info on your system? (like OS version, web browser, proxy software and version if you're behind one, etc)

another thing that would be good to try if you still can't connect is trying to get to http://irc.rubbermallet.org which is my regular server machine.

it's the same hostname, but this would try to use port 80 instead of port 8088. maybe your work blocks it for being a non-standard port number.

i'd just like to find out if it's a bug in my TCP stack or something unrelated. thanks! :)
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: sharing my MiniTCP TCP/IP library for C...

Post by Ready4Dis »

Yes, normal link works fine. I assume my proxy server only allows certain (standard) ports.
Post Reply