Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!ucbcad!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Help with CreateProc() Message-ID: <8711090253.AA25686@cory.Berkeley.EDU> Date: Sun, 8-Nov-87 21:53:30 EST Article-I.D.: cory.8711090253.AA25686 Posted: Sun Nov 8 21:53:30 1987 Date-Received: Wed, 11-Nov-87 03:42:12 EST Sender: daemon@ucbvax.BERKELEY.EDU Lines: 50 >Can anyone tell me what I am doing that is wrong? >Also, what is it that a Process has that a Task doesn't that allows it to >access AmigaDos. Yah, this is an easy one. There are two problems. (A) no arguments are passed to test, (B) there is no CLI attached to test (look in the process structure). The result is that the startup code for TEST thinks it's being executed from the workbench, and thus Wait()'s for the workbench packet. You can get around both problems by creating a custom startup. With Aztec C, execution starts at the .begin label, so you simply write a little assembly module to overide the link library's .begin label. I believe the source to the standard Aztec C startup module is on your Aztec C master disks somewhere. It is called crt0.asm or something like that. >Can anyone tell me what I am doing that is wrong? >Also, what is it that a Process has that a Task doesn't that allows it to >access AmigaDos. Take a look at a Task structure. Now take a look at the Process structure. DOS uses most of the fields in the Process structure, but most importantly it uses the message port in the Process structure to talk to the packet oriented DOS device drivers. You don't need a CLI entry to use DOS, just a Process. test.c: main() { Delay(100L); kprintf("Testing\n"); } ldr.c: #include main() { ULONG seg,LoadSeg(); seg = LoadSeg("test"); if (seg == 0) { printf ("Can't Load 'seg'\n"); exit(1); } if (CreateProc("TEST",0L,seg,500L) == 0) { printf ("Can't CreateProc()\n"); exit(1); } printf("done\n"); }