From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: "Steve Simon" Date: Thu, 9 Jul 2015 09:38:58 +0100 To: 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5f3038d8-ead9-11e9-9d60-3106f5b1d025 Anyone stripped rsc's libtask for use on a bare metal embedded system, I'am about to do it but if somone already has I could steal it. -Steve From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 9 Jul 2015 10:17:22 -0400 Message-ID: From: Joseph Stewart To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=e89a8f83a259fca414051a71e9eb Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5f7e20d4-ead9-11e9-9d60-3106f5b1d025 --e89a8f83a259fca414051a71e9eb Content-Type: text/plain; charset=UTF-8 I really like rsc's libtask and have managed to hide it in a few products. As for your question: What architecture? Any runtime available? Personally, I've used libtask on ARM/x86 under Linux/OSX... hardly "bare metal" though. The current implementation depends mostly on the ucontext API + berkeley sockets for net stuff. There's another project called http://libmill.org/ that is (was?) based on setjmp/etc that might be easier to port. Do keep me posted on your "travels"... I'm interested in this kind of stuff too. ...or maybe we should just all help Charles updating/minimizing Inferno... -joe On Thu, Jul 9, 2015 at 4:38 AM, Steve Simon wrote: > Anyone stripped rsc's libtask for use on a bare metal embedded system, > I'am about to do it but if somone already has I could steal it. > > -Steve > > --e89a8f83a259fca414051a71e9eb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I really like rsc's libt= ask and have managed to hide it in a few products.

As for= your question: What architecture? Any runtime available?

Pers= onally, I've used libtask on ARM/x86 under Linux/OSX... hardly "ba= re metal" though.

The current implementation depends most= ly on the ucontext API + berkeley sockets for net stuff.

There= 's another project called http://libmil= l.org/ that is (was?) based on setjmp/etc that might be easier to port.=

Do keep me posted on your "travels"... I'm inte= rested in this kind of stuff too.

...or maybe we should just a= ll help Charles updating/minimizing Inferno...

-joe
<= div class=3D"gmail_extra">
On Thu, Jul 9, 201= 5 at 4:38 AM, Steve Simon <steve@quintile.net> wrote:
Anyone stripped rsc's libtask for use on a= bare metal embedded system,
I'am about to do it but if somone already has I could steal it.

-Steve


--e89a8f83a259fca414051a71e9eb-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: "Steve Simon" Date: Thu, 9 Jul 2015 15:50:37 +0100 To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5f944288-ead9-11e9-9d60-3106f5b1d025 The system I am trying to add libtask to has no runtime other than libc. Corrently it is an even based system that uses a "min main loop" and a twisty maze of nested state machines that all look the same. Hence my desire to add co-routines + channels (i.e. exactly what libtask is) to it. I have no need for the file or network modules but those are easily removed. I don't have the context calls but I do have setjmp/longjmp so that is what I am trying to use. I will shout if it works out. -Steve From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 9 Jul 2015 17:09:02 +0200 Message-ID: From: David du Colombier <0intro@gmail.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5fad7adc-ead9-11e9-9d60-3106f5b1d025 Russ implemented his own setmcontext and getmcontext functions to work on systems that doesn't properly support ucontext. So I don't think you really need ucontext support in your libc. By the way, I maintain an updated version of libtask: https://github.com/0intro/libtask I've used it on quite a few places over the years, but I only on POSIX systems so far. -- David du Colombier From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bakul Shah Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Message-Id: <79C9DFA9-1814-477D-B2C2-CADE5B2D44B2@bitblocks.com> Date: Thu, 9 Jul 2015 08:51:31 -0700 References: In-Reply-To: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5fca9cac-ead9-11e9-9d60-3106f5b1d025 Sounds like all you want are coroutines (with create, destroy & switch-to ca= lls) and wait queues (with create, destroy, signal & wait calls). With these= you can build channels easily. With a bit more work you can even implement p= re-emption but then you need mutexes. Setjmp/longjmp is fine (that was I did= in my first version ages ago!). > On Jul 9, 2015, at 7:50 AM, Steve Simon wrote: >=20 > The system I am trying to add libtask to has no runtime other than libc. >=20 > Corrently it is an even based system that uses a "min main loop" and > a twisty maze of nested state machines that all look the same. >=20 > Hence my desire to add co-routines + channels (i.e. exactly what libtask i= s) > to it. I have no need for the file or network modules but those are easily= removed. >=20 > I don't have the context calls but I do have setjmp/longjmp so that is wha= t I > am trying to use. >=20 > I will shout if it works out. >=20 > -Steve >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 9 Jul 2015 11:52:52 -0400 Message-ID: From: Joseph Stewart To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a113ffdbc827a40051a733fd3 Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5fce941a-ead9-11e9-9d60-3106f5b1d025 --001a113ffdbc827a40051a733fd3 Content-Type: text/plain; charset=UTF-8 David, it's good to hear you're keeping libtask updated... I'll check it out for sure! On Thu, Jul 9, 2015 at 11:09 AM, David du Colombier <0intro@gmail.com> wrote: > Russ implemented his own setmcontext and getmcontext functions > to work on systems that doesn't properly support ucontext. > So I don't think you really need ucontext support in your libc. > > By the way, I maintain an updated version of libtask: > > https://github.com/0intro/libtask > > I've used it on quite a few places over the years, > but I only on POSIX systems so far. > > -- > David du Colombier > > --001a113ffdbc827a40051a733fd3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
David, it's good to hear you're keeping libtask up= dated... I'll check it out for sure!

On Thu, Jul 9, 2015 at 11:09 AM, David du = Colombier <0intro@gmail.com> wrote:
Russ implemented his own setmcontext and getmcontext functions to work on systems that doesn't properly support ucontext.
So I don't think you really need ucontext support in your libc.

By the way, I maintain an updated version of libtask:

https://github.com/0intro/libtask

I've used it on quite a few places over the years,
but I only on POSIX systems so far.

--
David du Colombier


--001a113ffdbc827a40051a733fd3-- From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 9 Jul 2015 11:55:17 -0400 Message-ID: From: Joseph Stewart To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7bdc14a61f7fcb051a734895 Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5fd3660c-ead9-11e9-9d60-3106f5b1d025 --047d7bdc14a61f7fcb051a734895 Content-Type: text/plain; charset=UTF-8 BTW, somewhere I "wired in" TADNS (http://adns.sourceforge.net/) so libtask's network lookups didn't block. Let me know if you have any interest in me cleaning it up for use. -joe On Thu, Jul 9, 2015 at 11:09 AM, David du Colombier <0intro@gmail.com> wrote: > Russ implemented his own setmcontext and getmcontext functions > to work on systems that doesn't properly support ucontext. > So I don't think you really need ucontext support in your libc. > > By the way, I maintain an updated version of libtask: > > https://github.com/0intro/libtask > > I've used it on quite a few places over the years, > but I only on POSIX systems so far. > > -- > David du Colombier > > --047d7bdc14a61f7fcb051a734895 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
BTW, somewhere I "wired in" TADNS (http://adns.sourceforge.net/) so = libtask's network lookups didn't block.

Let me know if= you have any interest in me cleaning it up for use.

-joe
<= /div>

On Thu, Jul = 9, 2015 at 11:09 AM, David du Colombier <0intro@gmail.com> wr= ote:
Russ implemented his own setmcontext= and getmcontext functions
to work on systems that doesn't properly support ucontext.
So I don't think you really need ucontext support in your libc.

By the way, I maintain an updated version of libtask:

https://github.com/0intro/libtask

I've used it on quite a few places over the years,
but I only on POSIX systems so far.

--
David du Colombier


--047d7bdc14a61f7fcb051a734895-- From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 9 Jul 2015 11:58:32 -0400 Message-ID: From: Joseph Stewart To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a113fee36c4b116051a735335 Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5fdd1f30-ead9-11e9-9d60-3106f5b1d025 --001a113fee36c4b116051a735335 Content-Type: text/plain; charset=UTF-8 One other thing that I've looked at but never used is Adam Dunkels' "protothreads" (http://dunkels.com/adam/pt/) although you'd still need to roll your own channel library. On Thu, Jul 9, 2015 at 10:50 AM, Steve Simon wrote: > The system I am trying to add libtask to has no runtime other than libc. > > Corrently it is an even based system that uses a "min main loop" and > a twisty maze of nested state machines that all look the same. > > Hence my desire to add co-routines + channels (i.e. exactly what libtask > is) > to it. I have no need for the file or network modules but those are easily > removed. > > I don't have the context calls but I do have setjmp/longjmp so that is > what I > am trying to use. > > I will shout if it works out. > > -Steve > > --001a113fee36c4b116051a735335 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
One other thing that I've looked at but never used is = Adam Dunkels' "protothreads" (http://dunkels.com/adam/pt/) although you'd still need to = roll your own channel library.

On Thu, Jul 9, 2015 at 10:50 AM, Steve Simon <stev= e@quintile.net> wrote:
The = system I am trying to add libtask to has no runtime other than libc.

Corrently it is an even based system that uses a "min main loop" = and
a twisty maze of nested state machines that all look the same.

Hence my desire to add co-routines + channels (i.e. exactly what libtask is= )
to it. I have no need for the file or network modules but those are easily = removed.

I don't have the context calls but I do have setjmp/longjmp so that is = what I
am trying to use.

I will shout if it works out.

-Steve


--001a113fee36c4b116051a735335-- From mboxrd@z Thu Jan 1 00:00:00 1970 References: From: "steve@quintile.net" Content-Type: multipart/alternative; boundary=Apple-Mail-0D26B469-A596-49D7-8CE4-3F587776343D In-Reply-To: Message-Id: <05F47572-DCD2-4AF1-9C84-0BFD846492B3@quintile.net> Date: Thu, 9 Jul 2015 17:12:10 +0100 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 5fe8d992-ead9-11e9-9d60-3106f5b1d025 --Apple-Mail-0D26B469-A596-49D7-8CE4-3F587776343D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable I looked at proto, they are just state machines pretending to be threads (im= ho) - not my style. libtask for me, I hope I can slice it a little and put the non-bear-metal bi= ts in seperate files so I can offer the changes back. co routines plus channels is exactly what I want. -Steve > On 9 Jul 2015, at 16:58, Joseph Stewart wrote: >=20 > One other thing that I've looked at but never used is Adam Dunkels' "proto= threads" (http://dunkels.com/adam/pt/) although you'd still need to roll you= r own channel library. >=20 >> On Thu, Jul 9, 2015 at 10:50 AM, Steve Simon wrote: >> The system I am trying to add libtask to has no runtime other than libc. >>=20 >> Corrently it is an even based system that uses a "min main loop" and >> a twisty maze of nested state machines that all look the same. >>=20 >> Hence my desire to add co-routines + channels (i.e. exactly what libtask i= s) >> to it. I have no need for the file or network modules but those are easil= y removed. >>=20 >> I don't have the context calls but I do have setjmp/longjmp so that is wh= at I >> am trying to use. >>=20 >> I will shout if it works out. >>=20 >> -Steve >=20 --Apple-Mail-0D26B469-A596-49D7-8CE4-3F587776343D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
I looked at proto, they are just state machines pretending to be threads (imho) - not my style.

libtask for me, I hope I can slice it a little and put the non-bear-metal bits in seperate files so I can offer the changes back.

co routines plus channels is exactly what I want.

-Steve





On 9 Jul 2015, at 16:58, Joseph Stewart <joseph.stewart@gmail.com> wrote:

One other thing that I've looked at but never used is Adam Dunkels' "protothreads" (http://dunkels.com/adam/pt/) although you'd still need to roll your own channel library.

On Thu, Jul 9, 2015 at 10:50 AM, Steve Simon <steve@quintile.net> wrote:
The system I am trying to add libtask to has no runtime other than libc.

Corrently it is an even based system that uses a "min main loop" and
a twisty maze of nested state machines that all look the same.

Hence my desire to add co-routines + channels (i.e. exactly what libtask is)
to it. I have no need for the file or network modules but those are easily removed.

I don't have the context calls but I do have setjmp/longjmp so that is what I
am trying to use.

I will shout if it works out.

-Steve


--Apple-Mail-0D26B469-A596-49D7-8CE4-3F587776343D-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bakul Shah Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Message-Id: <960EE432-0DA7-45DB-8A35-4A0FF3A3D0DB@bitblocks.com> Date: Thu, 9 Jul 2015 09:31:15 -0700 References: <05F47572-DCD2-4AF1-9C84-0BFD846492B3@quintile.net> In-Reply-To: <05F47572-DCD2-4AF1-9C84-0BFD846492B3@quintile.net> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 6001149e-ead9-11e9-9d60-3106f5b1d025 Your use is different and simple enough that I would suggest doing this from= scratch in pure C. Or start from an existing setjmp based implementation. I= t should really be a couple pages of code at most. > On Jul 9, 2015, at 9:12 AM, "steve@quintile.net" wrot= e: >=20 > co routines plus channels is exactly what I want. From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net Date: Thu, 9 Jul 2015 09:50:53 -0700 From: Skip Tavakkolian <9nut@9netics.com> In-Reply-To: <960EE432-0DA7-45DB-8A35-4A0FF3A3D0DB@bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 600caf0c-ead9-11e9-9d60-3106f5b1d025 i would be interested (purely out of curiosity and for learning) to see a simple test using libtask targeting something like qemu-system-arm emulating a virtual board like VersatilePB[1] or simpler system. i think that would be cool demo. [1] http://infocenter.arm.com/help/topic/com.arm.doc.dui0224i/DUI0224I_realview_platform_baseboard_for_arm926ej_s_ug.pdf From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 9 Jul 2015 19:07:52 -0700 Message-ID: <6d5e1c05-3651-4957-b115-601615e80aff@email.android.com> In-Reply-To: <960EE432-0DA7-45DB-8A35-4A0FF3A3D0DB@bitblocks.com> From: erik quanstrom To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Subject: Re: [9fans] rsc's libtask on embedded Topicbox-Message-UUID: 601cc2de-ead9-11e9-9d60-3106f5b1d025 YWxsIHByb2Nlc3MtbGlrZSBpbXBsZW1lbnRhdGlvbnMgZXhjZXB0IGlmIHRoZXkgZ2l2ZSB1cCBv biBwZXItY3B1IG11bHRpcHJvZ3JhbW1pbmcgYXJlIHNldGptcCBiYXNlZCBhdCBoZWFydC4KCi0g ZXJpawoKCk9uIEp1bCA5LCAyMDE1IDA5OjMxLCBCYWt1bCBTaGFoIDxiYWt1bEBiaXRibG9ja3Mu Y29tPiB3cm90ZToKPgo+IFlvdXIgdXNlIGlzIGRpZmZlcmVudCBhbmQgc2ltcGxlIGVub3VnaCB0 aGF0IEkgd291bGQgc3VnZ2VzdCBkb2luZyB0aGlzIGZyb20gc2NyYXRjaCBpbiBwdXJlIEMuIE9y IHN0YXJ0IGZyb20gYW4gZXhpc3Rpbmcgc2V0am1wIGJhc2VkIGltcGxlbWVudGF0aW9uLiBJdCBz aG91bGQgcmVhbGx5IGJlIGEgY291cGxlIHBhZ2VzIG9mIGNvZGUgYXQgbW9zdC4gCj4KPiA+IE9u IEp1bCA5LCAyMDE1LCBhdCA5OjEyIEFNLCAic3RldmVAcXVpbnRpbGUubmV0IiA8c3RldmVAcXVp bnRpbGUubmV0PiB3cm90ZTogCj4gPiAKPiA+IGNvIHJvdXRpbmVzIHBsdXMgY2hhbm5lbHMgaXMg ZXhhY3RseSB3aGF0IEkgd2FudC4gCj4KPgo=