lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Porting with not threads!


From: Walter ZAMBOTTI
Subject: Re: [lwip-devel] Porting with not threads!
Date: Fri, 12 Mar 2021 13:53:41 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Erik

Thanks for the response.

I have found :

lwip.fandom.com

http://www.nongnu.org/lwip/2_0_x.

https://git.savannah.nongnu.org/cgit/lwip.git/tree

these resources before! Thanks!

The OS I have is Microware OS9, 16 bit which was pre-thread support.  So no semaphores or mailboxes.

It has context (task) switching interrupt driven devices drivers, but no threads.  So I would like to have OS support which requires NO_SYS = 0 and at the same time no thread support which requires NO_SYS = 1.

With No_SYS = 1 I would effectively be running the complete stack in user land and nothing in the kernel.

The more I read I'm getting the impression it's one or the other.

Without knowing the internal requirements of lwip it's hard to determine what compromises I can make in lwip to make some hybrid with OS hooks but without threads.

Looking at the NO_SYS sample code it utilizes a busy poll loop which is antisocial for a real time kernel.

Anyhow I will keep educating myself.  Taking a look through the core code there is no use of threads.  All thread use occurs in the api and one instance in slipif.

So I get the impression I should be able to ignore threads as long as I don't build/use tcpip and netconn but just use the raw call back api.

Regards

Walter

On 11/3/21 5:58 am, Erik Ekman wrote:
I think you are looking for the NO_SYS variable, which controls if an
operating system is used or not.

Maybe this is slightly more up to date:
https://lwip.fandom.com/wiki/LwIP_with_or_without_an_operating_system
There is also 
https://git.savannah.nongnu.org/cgit/lwip.git/tree/doc/NO_SYS_SampleCode.c
and the unix port in contrib/ which is pretty minimal.

/Erik

On Wed, 3 Mar 2021 at 08:09, Walter ZAMBOTTI <zambotti@iinet.net.au> wrote:
I might be using an out of date porting guide referenced here :

https://lwip.fandom.com/wiki/Porting_for_an_OS_1.4.0

Is there is a more up to date porting guide?

Anyway it states for threads:

Threads

Threads are not required for lwIP, although lwIP is written to use them 
efficiently. The following function will be used to instantiate a thread for 
lwIP:

sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, 
int stacksize, int prio): name is the thread name. thread(arg) is the call made 
as the thread's entry point. stacksize is the recommanded stack size for this 
thread. prio is the priority that lwIP asks for. Stack size(s) and 
priority(ies) have to be are defined in lwipopts.h, and so are completely 
customizable for your system

However there is no mention as what is meant to be configured in order to 
either use threads or not to use threads.

I assume there is a define that needs to be changed somewhere!

Walter

_______________________________________________
lwip-devel mailing list
lwip-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]