Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!ptsfa!well!ewhac From: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Newsgroups: comp.sys.amiga Subject: Re: Help with CreateProc() Message-ID: <4416@well.UUCP> Date: Mon, 9-Nov-87 19:09:13 EST Article-I.D.: well.4416 Posted: Mon Nov 9 19:09:13 1987 Date-Received: Thu, 12-Nov-87 06:22:59 EST References: <8711090253.AA25686@cory.Berkeley.EDU> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: Daily-Changing Organization Name, Inc. Lines: 54 Summary: It's easier than Matt describes it. In article <8711090253.AA25686@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes: >>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. > >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. > It's easier than that. Just do the following to your code: Change: >test.c: > main() > { To: >test.c: > _main() > { This trick only works with Manx. Some further comments: -------- 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"); /* * No, you're not. You should hang around and wait for * your created process to finish executing, and then * UnloadSeg() it. Otherwise, you'll have a memory leak. */ }