October 31, 2022

BSD TCP/IP for Kyu - Warnings and missing pieces

I am still seeing a handful of warnings:

One is from tcp_timer.c where a loop iterates through TCPT_NTIMERS and calls the function tcp_usrreq() with an argument of (struct mbuf *)i. I can't imagine how this would have worked or been useful, but I will ignore the warning for now and check on all this later when I deal with the timers. (Actually, I "fix" this after a peek at the NetBSD code by making the variable "i" a long rather than an int.

The next is from tcp_usrreq.c (interestingly enough) and in 4 places I get warnings about casting things to integer. The first is exactly related to the warning just mentioned above -- the mbuf * argument being cast back to an integer to indicate which timer is being triggered. All of these can be "fixed" by casting to (long) rather than (int) as per the NetBSD code.

Now all of the TCP codes compiles and links without any errors or warnings!!

Missing functions

This gives me tcp_bsd.o, but what happens when we try to link this into Kyu?
aarch64-linux-gnu-ld.bfd: (.text+0x5180): undefined reference to `m_freem'
aarch64-linux-gnu-ld.bfd: (.text+0x5194): undefined reference to `m_freem'
aarch64-linux-gnu-ld.bfd: (.text+0x51a0): undefined reference to `splnet'
aarch64-linux-gnu-ld.bfd: (.text+0x51c8): undefined reference to `splx'
aarch64-linux-gnu-ld.bfd: (.text+0x52b8): undefined reference to `in_pcbbind'
aarch64-linux-gnu-ld.bfd: (.text+0x52e0): undefined reference to `in_pcbbind'
aarch64-linux-gnu-ld.bfd: (.text+0x5314): undefined reference to `in_pcbbind'
We get a myriad of warnings. The above are just a small sample. This is not unexpected. The BSD code makes many calls to things that simply don't exist in Kyu. the game now will be figuring out how to supply them and what changes to make to the BSD code to work in the Kyu environment.


Have any comments? Questions? Drop me a line!

Kyu / [email protected]