From: "Johnny Chan" To: "'Eli Zaretskii'" Cc: Subject: RE: Q: Want to know the starting address and size of my program Date: Tue, 12 Oct 1999 11:02:43 -0700 Message-ID: <000001bf14db$fc42e8e0$ae3d7a86@phoenix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Eli, >>-----Original Message----- >>Please define ``starting address'' and ``size''. >>A program consists of several sections: >>there's code, there's data, there's the >>heap, and a few others. >>What exactly do you want to know, and for what purpose? Actually, I am trying to do a FULL system memory scan and read/write test. I want to know where the code starts and where the data stays so that I can add some protection based on these information and my program will not over write any code or data or heap or others accidentially. >>If you want to reach the loader from within a running DJGPP >>program, then you can't: its space is reused for the transfer >>buffer, after the loader has done its job. What will happen if my program does some memory read/write test on the memory area where is the loader located originally? >>You can read this memory with dosmemget, but since it is used for the >>transfer buffer, you will get garbage: the startup code >>begins using the transfer buffer quite early, so by the time you get >>there, it's overwritten many times. >>Nothing will happen. But why do you need something like that? >>It might help if you explain some more. The above sounds as >>if you have already settled on some solution(s) to your problems, >>but you based the solution on incorrect assumptions. >>It might be a good idea to post a description of your original >>problems. Then someone might come up with ideas about how to >>solve them.