Mail Archives: djgpp-workers/1998/03/14/22:50:20
> I think it would be a good idea if the text section were read-only.
> ...
> I've looked at it, and it seems the only thing stopping it are some
> variables in crt0.S that are placed in the text section. I think Charles
> once explained why they're there, but I've forgotten. There ought to be some
> other way of doing it. After that, of course, it's just a matter of placing
> an `mprotect' call or equivalent somewhere in the startup code.
Everything you say is correct. I originally had plans for allowing the
text section to be read-only as an option.
The reason the variables are in the text section was to make the keyboard
interrupt handler easier to lock. All the code and variables used need
to be locked - and putting them together allowed a single lock call. It
would not be hard to put the variables in the data section and then add
a second lock call. It would have made some of the DLL stuff easier,
allowed for read-only text, etc.
But the problem is - mprotect and read only pages will only be supported
under CWSDPMI and 386MAX. I'm not even 100% sure read-only pages will
page in/out properly under CWSDPMI. And if it is supported, you just
*KNOW* you will get a whole bunch more messages about page fault errors
under DOS, so CWSDPMI must be broken since it works under Windoze ;-P
Just remember - no good deed goes unpunished! :-)
- Raw text -