Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
107 user(s) are online (70 user(s) are browsing Forums)

Members: 2
Guests: 105

kishigo, kas1e, more...

Headlines

 
  Register To Post  

TCL on OS4 ?
Quite a regular
Quite a regular


See User information
For one of my projects I have to use the TCL library, however this has not been ported to OS4 yet (and the 68k one does not work either).
I tried to recompile it directly but that did not work : TCL rely on some *ix functions that are not available in the currently supported C runtime (most problematic ones beeing fork() and wait()) so to have an OS4 native port of TCL this should be done "cleanly" by adding the support for the Amiga platform.
Did(does) someone work on that is interested in it ? Currently I managed to remove mainly every *ix dependencies, it remains only fork(), wait() and tzset(). I think this can be done relatively easily because the fork() call is immediatly (just a few lines) followed by an execvp()...
I don't think I'll have the time to finish it right now and thought maybe someone else already work on it or would be interested in doing it ?

PS: of course I'll provide my current sources if someone is interested to go on.

Back to a quiet home... At last
Go to top
Re: TCL on OS4 ?
Amigans Defender
Amigans Defender


See User information
@abalaban
Quote:
I think this can be done relatively easily because the fork() call is immediatly (just a few lines) followed by an execvp()...

Post the section of code here and maybe we can help you out. Depending on how the fork()/execvp() is being used I can usually replace it with a single SystemTags() call.

ExecSG Team Lead
Go to top
Re: TCL on OS4 ?
Quite a regular
Quite a regular


See User information
@ssolie

In fact the fork() is followed by an execvp() however it does not waitpid() immediatly (i.e. read the call is asynchronous and checked later).
However as it does not rely on features of the fork() I think it can be replaced by a SystemTags() call or by a CreateNewProc() however I'm new to Amiga processes coding so don't know how I could simulate the wait() call. I don't know however if it's really needed or if it's here only for cleaning the killed process to prevent it from becoming a zombie, I should check that...

Back to a quiet home... At last
Go to top
Re: TCL on OS4 ?
Home away from home
Home away from home


See User information
@abalaban

If you use CreateNewProc() to make parallel threads, the global variables will be global, so you can simply change a global variable when your done.

Just keep in mind that CreateNewProc() is designed to take function pointer as start address, not address in side a function, local variables will be local for ever proc, so you do not need worry about that.

If you need to handle global variables as local, then you most make copy, you can pass the address of the copy as agreement to the CreateNewProc().

This can be done by making a structure that contains all variables, this way you only need pass one pointer to the address, of the copys.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: TCL on OS4 ?
Quite a regular
Quite a regular


See User information
@LiveForIt

Thank you for your answers. After some little more researches I have found that the fork() call is really only used to spawn a child process that will then be used to execute (via execvp()) a specified command asynchronously (after having redirected I/O to a previoulsy opened pipe, was using pipe() call that I replaced by opening a unique file in PIPE: one with read access, one with write access).
However nothing prevents from launching several childs at the same time, so I can't rely on the use of global variables.

Then as I said a wait() call is made to gather alll terminated childs process to prevent them from becoming zombies and also to eventually generate error message in case child terminated abnormaly (signaled, return code). Currently I'm much more looking at the struct DeathMessage that can be sent automatically, someone already used that ? Suggestions ?
The wait() replacement is not strictly needed because under AOS we can make the spawned process terminate itself without interfering with the parent, however if we want to have the return code, we have no choice than to keep track of all spawned childs and to analyse their return code at termination time.

Back to a quiet home... At last
Go to top
Re: TCL on OS4 ?
Just can't stay away
Just can't stay away


See User information
@abalaban

go go go! me wants to see this ported too!
i've tried to port, or rather, want to be able to port some things that use it.

Go to top
Re: TCL on OS4 ?
Quite a regular
Quite a regular


See User information
@spotUP

I'm working on it... Will see what I can do, I think it's possible.

Back to a quiet home... At last
Go to top
Re: TCL on OS4 ?
Just can't stay away
Just can't stay away


See User information
@abalaban

great! that.. is it called tcl-tk? the gui system, does it use tcl and sdl? or.. is it a pain to port?

Go to top
Re: TCL on OS4 ?
Quite a regular
Quite a regular


See User information
@spotUP

No this this "just" TCL, which is in fact a powerful scripting language. Tk is an independant addon to TCL which offers TCL programs a GUI system upon X11. As it was designed by amost the same people they were often associated under the name "Tcl-Tk" but they are really two different things.
I have not looked at it, but I think Tk should be more difficult to port, because you'll have to write many wrappers to replace X11 calls...
I don't think I'll look at it, I don't have time to do it.

Back to a quiet home... At last
Go to top
Re: TCL on OS4 ?
Just can't stay away
Just can't stay away


See User information
@abalaban

ok!...

now i remember one of the things i wanted to compile, eggdrop, the irc bot.

Go to top
Re: TCL on OS4 ?
Just can't stay away
Just can't stay away


See User information
@abalaban

any news?

Go to top
Re: TCL on OS4 ?
Quite a regular
Quite a regular


See User information
@spotUP

Yes : this does not work and I can't find why
In fact I have a compiled tclsh and tcltest but they just fail at startup with an error message I did not understood well. Also fact is I was distracted from that for a couple of days now

EDIT: weel -> well


Edited by abalaban on 2007/6/7 12:44:52
Back to a quiet home... At last
Go to top
Re: TCL on OS4 ?
Home away from home
Home away from home


See User information
@abalaban

Well probably where unable to generate a valid library structure?

There some tools for that in the SDK have a look?

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: TCL on OS4 ?
Quite a regular
Quite a regular


See User information
@LiveForIt

I don't understand very what you mean. the error message is generated by TCL itself, it's not an error by the C runtime or AOS.
Problem is I never used TCL myself, I was trying to compile it in order to be able to run the self test phase of sqlite while I was porting it to AOS4.

Back to a quiet home... At last
Go to top
Re: TCL on OS4 ?
Home away from home
Home away from home


See User information
@abalaban

I don?t know any thing about TCL, so don?t know, but the port TCL library ended up standard Amiga library or some thing else?

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: TCL on OS4 ?
Just can't stay away
Just can't stay away


See User information
@abalaban

you should ask for help in #amigadev at irc.amigaworld.net
or at utilitybase. you can do it man!

Go to top
Re: TCL on OS4 ?
Quite a regular
Quite a regular


See User information
@LiveForIt

the tcl library is not an amiga shared library (yet), it's directly linked into the tclsh and tcltest executables.
Doing an AOS4 shared library was not in my goal but is easily doable using idetool.

@SpotUP

currently I'm working with Steffen on an MUIbase native AOS4 version, and I'm experiencing trouble in an MUI listview display hook which does not want to do string operation on a local static variable without any single clue why
So I must admit that TCL is really behind right now. Also I must confess that the current legal mess has undermined most of my motivation/interest in developping for the platform :-/


Edited by abalaban on 2007/6/7 17:18:38
Back to a quiet home... At last
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project