MSX-DOS create and execute child process

By MsxKun

Paladin (920)

MsxKun's picture

26-05-2011, 12:35

Heyas!

I've been looking at MSX-DOS2 to see how to make your own program load and execute a child process (without being deleted itself) and, if possible, when the child process ends, returns to the parent one.

This is, the way Multimente does.

Been looking at the MM code and found some clues in CHILDE.MAC sources, but MM code is not easy to understand and all the remarks are in japanese :S

MS-DOS seems to have a function call to do this task, but MSX-DOS doesn't. It has the Fork systemcall, but not the load and execute. I guess just loading the COM file at 0100 could do, but... it would mess my own COM file?

Any clue? Thx!

Login or register to post comments

By MicroTech

Champion (384)

MicroTech's picture

27-05-2011, 11:56

Hi MsxKun,
I'm interested in this topic but I can't find sources of MultiMente... please, could you point out a download link, or could you send me them by e-mail?

BTW: did you try to invoke functions 0x60 (fork) and 0x61 (join) in a your own test program to see what happens?
Thanks

By MicroTech

Champion (384)

MicroTech's picture

27-05-2011, 11:59


MS-DOS seems to have a function call to do this task, but MSX-DOS doesn't. It has the Fork systemcall, but not the load and execute. I guess just loading the COM file at 0100 could do, but... it would mess my own COM file?

About load and execute you could find an interesting function _exec in file PROCESS.C in MSX C 1.20...

By MsxKun

Paladin (920)

MsxKun's picture

27-05-2011, 12:42

Heya!

About sources, i'm almost sure i got them from here. Ah no! Googled and found the notice in Karoshi's Forum Tongue

http://karoshi.auic.es/index.php?topic=1772.0

I thought they would be useful cause i always wanted to use MM with joystick :P Yep, load MM laying on bed with joystick, ready to run sme ROMS ^^
Will check the MSX C thingy, but i'm about to give up and make my stuff in BASIC and use Call System ("whatever.com")
:RNFF:

By MicroTech

Champion (384)

MicroTech's picture

27-05-2011, 15:10

Heya!
About sources, i'm almost sure i got them from here. Ah no! Googled and found the notice in Karoshi's Forum Tongue
http://karoshi.auic.es/index.php?topic=1772.0

... the link is no more available... or I'm not able to reach the real download page... :( would you be so kind to send me sources by e-mail?


I thought they would be useful cause i always wanted to use MM with joystick :P Yep, load MM laying on bed with joystick, ready to run sme ROMS ^^

Absolutely cool B-)
But you should anyway standup to reach the reset button and switch to another game :P


Will check the MSX C thingy, but i'm about to give up and make my stuff in BASIC and use Call System ("whatever.com")
:RNFF:

Well now my curiosity is galvanized, I'd like to discover/know more LOL!

By MsxKun

Paladin (920)

MsxKun's picture

27-05-2011, 17:01

All is related to the bed thingy! Bed, chips, 1 joystick and a SD full of roms Tongue
um.. reset could be reached with foot!!

By msd

Paragon (1372)

msd's picture

27-05-2011, 21:49

I looked a couple of time into this..FORK and JOIN are msxdos2 functions which makes copy of al handles and environment strings. A join cleans them up again. You have to load the file yourself at address 100. The hard part is how to make sure that once that com exits your own program strats again. You have to have some resident code for that. You can't just simply put a return address on the stack. This will only work when a program ends with RET. If will not work it uses _TERM0.

By MsxKun

Paladin (920)

MsxKun's picture

27-05-2011, 22:06

That's what it seems. MSXDOS2 seems prepared for it. Has functions prepared for it (FORK and JOIN), but then.... doesn't have the important one... Then it becomes tricky. Seems like they didn't WANT/KNOW/HAD TIME to port the proper routine that does that automatically in MS-DOS Sad

By fr3nd

Expert (89)

fr3nd's picture

06-08-2018, 15:43

That's a pretty old thread, but it's the only place where I've found info about the _FORK DOS2 call...

I'm trying to do the same (launching another command from my own program) using SDCC and I'm a bit lost on how it can be done. Is it even possible? Is there any guide/documentation/source code I can look at?

The MM source code referred in this thread doesn't look to be available any more.

By Grauw

Ascended (8439)

Grauw's picture

06-08-2018, 16:13

SofaRun does it too... Louthrax may be able to give some advice. He also posted about it in a thread I think (or maybe it was private mail).