[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] Patch for PaulOS + crash fixes
From: |
psheer |
Subject: |
[lwip-users] Re: [lwip] Patch for PaulOS + crash fixes |
Date: |
Wed, 08 Jan 2003 22:57:37 -0000 |
>
> All of the above already is true for lwIP (this has been discussed a few
> times the last months), but perhaps I have been bad at pointing this out.
> Anyway, this is basically how it works:
ok, thanks
this clears things up quite a bit
i think my original email and your reply should DEFINATELY
go into the docs! :-)
best
-paul
>
> * To get a simple TCP/IP stack without any thread support, etc., only compile
> the files in the core/ directory.
> * To get a multithreaded TCP/IP stack with a sequential API, also include the
> files in api/ in your project.
> * When running in a single-threaded environment, the sys_arch implementation
> is really simple - look at src/arch/6502/sys_c64.c for an example of this.
> * In a single threaded environment, the functions ip_input(), tcp_fasttmr()
> and tcp_slowtmr() is the interface to lwIP. ip_input() should be called when
> incoming packets arrive, and tcp_fasttmr() and tcp_slowtmr() should be called
> periodically. The periodical TCP timers are taken care of in the api/tcpip.c
> file (for multithreaded systems).
>
> Also, the sample project in proj/unixsim/ should not be taken as the
> definitive model for how to use lwIP; it is mostly meant as one specific
> example of how to build lwIP.
>
> Of course, this does not mean that there is room for improvement: The TCP
> timer interface should be made simpler. I just added a new TCP function,
> tcp_tmr(), which should be called every 100 ms. This function takes care of
> dispatching the actual TCP fast and slow timers. The old tcp_slowtmr() and
> tcp_fasttmr() are also avaliable, since people may depend on them.
>
> Also, your comment about being able to turn of the sys.c layer is very
> relevant. Single threaded environments does not need the sys.c code, so the
> sys_ declarations could be replaced with null #defines and sys.c would not be
> compiled into the project.
>
> I've also cleaned up the makefile stuff for the unixsim example project.
> Perhaps a new example project, a non-os project, should be added as well?
>
> > *- you should be able to plug in your own malloc module
> > so that you can use GNU malloc.c if you have it, or
> > whatever malloc implementation your OS supports.
> > the patch i sent you has #ifdef's around all the
> > memory allocation stuff.
>
> This was something I was thinking about in the early stages of lwIP
> development, before the memp stuff was included. This should be implemented
> by #defining macros for mem_malloc() et al. in mem.h instead of using lots of
> #ifdefs in the code. I've added this to my todo list.
>
> /adam
> --
> Adam Dunkels <address@hidden>
> http://www.sics.se/~adam
> [This message was sent through the lwip discussion list.]
---------------------------------------------
This message was sent using World Mail.
http://www.worldonline.co.za
[This message was sent through the lwip discussion list.]
- [lwip-users] Re: [lwip] Patch for PaulOS + crash fixes, psheer, 2003/01/08
- [lwip-users] RE: [lwip] Patch for PaulOS + crash fixes, liandong, 2003/01/08
- [lwip-users] Re: [lwip] Patch for PaulOS + crash fixes, Adam Dunkels, 2003/01/08
- [lwip-users] Re: [lwip] Patch for PaulOS + crash fixes,
psheer <=
- [lwip-users] Re: [lwip] Patch for PaulOS + crash fixes, psheer, 2003/01/08
- [lwip-users] Re: [lwip] Patch for PaulOS + crash fixes, Adam Dunkels, 2003/01/08
- [lwip-users] Re: [lwip] Patch for PaulOS + crash fixes, Adam Dunkels, 2003/01/09