Path: utzoo!news-server.csri.toronto.edu!torsqnt!hybrid!scifi!bywater!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.programmer Subject: Re: Help! (AmigaDOS CreateProc/LoadSeg) Message-ID: Date: 14 Mar 91 17:18:25 GMT References: <63329@eerie.acsu.Buffalo.EDU> <19578@cbmvax.commodore.com> <06417.AA06417@babylon.rmt.sub.org> <06533.AA06533@babylon.rmt.sub.org> Organization: Not an Organization Lines: 40 In article <06533.AA06533@babylon.rmt.sub.org> rbabel@babylon.rmt.sub.org (Ralph Babel) writes: >In article , >rosenber@ra.abo.fi (Robin Rosenberg INF) writes: > >> I have a slightly different version, that does not contain >> self-modifying code. Instead of patching the jump >> instrction, I patch data for the instruction. This code is >> of course not reentrant. > >Not being reentrant is kind of ugly, of course, but I see >two more potential problems: Static structures are not >necessarily longword-aligned (at least with SAS/C 5.10a), >and - structures usually being located in a data hunk - a >future version of LoadSeg() _could_ selectively clear the >code cache only for the address ranges of the code hunks >just loaded, not data and bss - a useful optimization for >very big caches. This is purely fictitious, of course. > >Ralph Well, actually, the very first declaration in an object module is going to be longword aligned so even if you do not have __aligned it isn't much of a problem. Also, it's easy to throw in a little assembly code to fake the seglist. Frankly, I don't see what the fuss is. You just make the program RESIDENT and RUN it twice. Under 2.0 you don't even have to use Execute() or System() -- you can use RunCommand(), and get *exactly* what you want! Also, under 2.0, you can specify a starting PC instead of a seglist when you create a new process so you don't have to deal with these dummy segments anyway! -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA