Omnimaga

Omnimaga => Our Projects => Ndless => Topic started by: gudenau on September 26, 2013, 07:05:50 pm

Title: Access Resident Program Variables
Post by: gudenau on September 26, 2013, 07:05:50 pm
So, I have two programs, one that needs to be resident and is very small. The other is going to be larger and will unload when not needed. So, how could I access variables from the resident program from the normal one? Unfortunately I can not do this differently.
Title: Re: Access Resident Program Variables
Post by: Legimet on September 26, 2013, 07:21:19 pm
You could create a file to store necessary variables in.
Title: Re: Access Resident Program Variables
Post by: gudenau on September 26, 2013, 07:33:45 pm
That is way to slow, as they can change many times a second, and I do not want to kill the flash.
Title: Re: Access Resident Program Variables
Post by: lkj on September 26, 2013, 07:48:38 pm
Maybe store a pointer instead of the value in a file?
Title: Re: Access Resident Program Variables
Post by: gudenau on September 26, 2013, 08:01:41 pm
I did consider that, but I was hoping ndless would have a function for that. Sigh.
Title: Re: Access Resident Program Variables
Post by: Legimet on September 26, 2013, 08:09:21 pm
You could get ExtendeD to add such a function to libndls.
Title: Re: Access Resident Program Variables
Post by: gudenau on September 27, 2013, 12:28:31 pm
How should I contact him/her for this?
Title: Re: Access Resident Program Variables
Post by: Streetwalrus on September 27, 2013, 03:02:25 pm
I think passing your sub program a pointer is the best solution (it's actually the proper way to do it).
Title: Re: Access Resident Program Variables
Post by: lkj on September 27, 2013, 03:03:46 pm
How should I contact him/her for this?
Just write him a PM.
Title: Re: Access Resident Program Variables
Post by: Lionel Debroux on September 27, 2013, 03:17:42 pm
If there are shared memory facilities in Nucleus, Ndless could expose them (once they are found); otherwise, libndls would indeed be the place to implement them.

With the impending release of the next OS version, which will certainly be even [EDIT: more] closed-minded than 3.2.4, maybe it won't be done before arbitrary code execution, and the subsequent time-consuming and boring work of finding functions again in the new OS version.
Title: Re: Access Resident Program Variables
Post by: gudenau on September 27, 2013, 03:37:35 pm
I think passing your sub program a pointer is the best solution (it's actually the proper way to do it).
Well, the resident application will not be launching the other application, otherwise I would just pass it, to bag I am not just making an operating system for this, would be so much better as it always runs no mater what is the same instance.

How should I contact him/her for this?
Just write him a PM.
I will try that.

If there are shared memory facilities in Nucleus, Ndless could expose them (once they are found); otherwise, libndls would indeed be the place to implement them.

With the impending release of the next OS version, which will certainly be even closed-minded than 3.2.4, maybe it won't be done before arbitrary code execution, and the subsequent time-consuming and boring work of finding functions again in the new OS version.
I am hoping that this will be a small thing to add.
Title: Re: Access Resident Program Variables
Post by: bsl on September 27, 2013, 11:02:04 pm
Nucleus does have the mailbox form of IPC, nobody has tried to work.
Title: Re: Access Resident Program Variables
Post by: ExtendeD on September 28, 2013, 01:41:38 am
Mailboxes or shared memory would indeed be a good option. I'll try to add these, but as Lionel says this is unfortunately not the priority.
gudenau, you should try the "pointer passed through a shared file" solution in the meantime.
Title: Re: Access Resident Program Variables
Post by: gudenau on September 28, 2013, 11:16:00 am
Mailboxes or shared memory would indeed be a good option. I'll try to add these, but as Lionel says this is unfortunately not the priority.
gudenau, you should try the "pointer passed through a shared file" solution in the meantime.

Will do! Thanks for the help, and possible feature.