Welcome, Guest. Please login or register.

Author Topic: Fake seglist in C...  (Read 7158 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show all replies
Fake seglist in C...
« on: August 07, 2007, 04:33:14 PM »
From the CreateProc() autodoc:
...

If you wish to fake a seglist (that will never
    have DOS UnLoadSeg() called on it), use this code:

                DS.L    0   ;Align to longword
                DC.L    16  ;Segment "length" (faked)
                DC.L    0   ;Pointer to next segment
                ...start of code...


Anyone knows how to do this in C without having an array of LONGs with a jmp instruction in start of code (wich would be kind of unecessary and less performant) ?
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show all replies
Re: Fake seglist in C...
« Reply #1 on: August 07, 2007, 05:24:47 PM »
[EDIT]
Wanted to mean "jmp instruction in start of code" not goto int or something... :roll:
You guys are getting tired of this {bleep} arent' you ? 8-)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show all replies
Re: Fake seglist in C...
« Reply #2 on: August 08, 2007, 02:43:27 PM »
@golem

Just wanting to make a piece of code 1.3 compatible:)

@Thomas

That will do :) I know I should use CreateNewProc, it's just that that was the only function call preventing 1.3 compatibility, I'll probably make two versions of the final file...

:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show all replies
Re: Fake seglist in C...
« Reply #3 on: August 08, 2007, 02:49:03 PM »
BTW, doesn't the main process port need to be in the public list for the subtask to be able to find it with FindPort ?
I prefer to send an ini messsage directly to the child's process MsgPort, no need to search for the parents port:)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show all replies
Re: Fake seglist in C...
« Reply #4 on: August 09, 2007, 07:53:58 PM »
"It does, and it is. amiga.lib CreatePort() routine does it, if you give it the port name."

Yap, I was just wanted to mean that if one uses the subprocess message port to send the ini message the main process port doesn't need to public.

Anyway, I think I just wanted to know how I could do it, now that I know I don't have the patience to support 1.3:)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show all replies
Re: Fake seglist in C...
« Reply #5 on: August 09, 2007, 07:55:26 PM »
@mgeric
In no particular order, Thomas, Piru and Karlos are the biggest contributers to this place. Haven't seen karlos here lately though...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show all replies
Re: Fake seglist in C...
« Reply #6 on: August 09, 2007, 08:31:49 PM »
@Piru

Why does it need to clear the cache ? It's not using selfmodified code and the code is already in memory so the cache data should be valid. (?)
\\"We made Amiga, they {bleep}ed it up\\"