Mail Archives: djgpp/1999/04/22/23:20:44
From: | "Randy Sorensen" <randy AT idcomm DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Locking DJGPP Code and Data (repost)
|
Date: | Thu, 22 Apr 1999 20:59:26 -0600
|
Lines: | 58
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2314.1300
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2314.1300
|
NNTP-Posting-Host: | psychosis.idcomm.com
|
X-NNTP-Posting-Host: | psychosis.idcomm.com
|
Message-ID: | <371fd2f7.0@mindmeld.idcomm.com>
|
X-Trace: | 22 Apr 1999 19:55:03 -0700, psychosis.idcomm.com
|
X-NNTP-Posting-Host: | superego.idcomm.com
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Reposting this with a correct address in the FROM: header. Sorry Eli :)
The only method that I've seen for locking code and data when writing an
interrupt handler is to use _go32_dpmi_lock_code() and
_go32_dpmi_lock_data(). Now, I noticed a function called
__dpmi_lock_linear_region() which allows you to lock a whole block of
memory at a given address. So, take this code for example:
// dummy function
start_code()
{
}
// global variables
.
.
.
install_handler()
{
__dpmi_memoinfo info;
info.address = start_code;
info.size = end_code - start_code;
__dpmi_lock_linear_region(&info);
// install the handler
.
.
.
}
// handler functions and data
.
.
.
// dummy function
end_code()
{
}
Will it lock all of the functions and data between the two dummy functions?
The only other method I've seen is to put dummy functions at the end of
every function in the file, calculate the size of each function, lock each
of them individually, and lock all of my global variables individually.
Using the method shown above, will it lock all of the code in the file as
well as the global variables? This would assume that gcc puts everything in
a file in the same block of memory, including the global variables.
Thanks
-Randy
- Raw text -