MS DOS overlay programming
Michael B. Brutman
mbbrutman-cctalk at brutman.com
Thu Dec 21 19:48:00 CST 2006
> You're writing a TCP/IP stack for the PCjr in C++?
Don't be alarmed. I said C++. I'm not using polymorphism, inheritance,
etc. It looks very much like C code, except instead of structs I've got
classes and methods to operate on the classes. I'm not a purist about
C++ .. it's just a better C.
My test app is netcat. Right now, the EXE is is close to 54KB. That
includes all of the C runtime functions that I used and quite a bit of
tracing code that I can remove with a #define. I can keep piling in
code until I'm out of memory, but the fanatic in me says that the init
code should be removed because it only runs once. The init code includes:
-Reading env variables for IP addr, packet int #, netmask, gateway, MTU,
and a few options.
-Initializing the packet driver, getting the ethernet address, etc.
-Initializing ARP, UDP and TCP global data structures.
It's not a horrible amount of code; I just hate leaving it resident.
I'm using heap storage too, so my real storage requirements are a bit
higher. Still not enough to lose sleep over, but remember the fanatic part?
It's fairly easy to do a small IP implementation. UDP isn't bad either.
Doing a good TCP implementation (for both performance and required
function) has been a lot more difficult.
(If you need a Jr I can hook you up.)
More information about the cctalk