[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] kernel 1.15.10b fragmentation



Hi,

On Tue, Jan 02, 2001 at 11:23:44AM +0100, Thomas Binder wrote:
> Hi!
> 
> On Tue, Jan 02, 2001 at 01:13:20AM +0100, Guido Flohr wrote:
> > Proposal for new kernel function:
> > 
> > 	long MAccess (unsigned long address, unsigned long size,
> > 		      short int mode);
> > 
> > This function should allow "innocent" applications to check a pointer
> > of foreign or otherwise dubious origin before it is being used.  The
> > "mode" argument should hold a bit vector with the desired access method
> > (read, write or both).
> 
> Mhmm. That sounds nice, and offers an easy way for non-C-programmers to
> do such a check, as other languages usually don't have the possibility
> to install signal handlers and/or some setjmp()/longjmp() functionality.
> 
> The main problem with that call is of course that it would not help at
> all when the user doesn't run a MiNT kernel that already supports it.

Non-MiNT systems don't have memory privacy politics and for systems
that don't support the new call but do support signal handlers I could
write an emulation in the libc.  Even for large blocks that is not that
expansive because you only have to test one byte per requested page.

> > Such a call would probably be a little more performant than installing a
> > signal handler for SIGSEGV.
> 
> It's SIGBUS, but anyway: I don't think that performance is actually
> critical for such checks.

Oops, why is it SIGBUS?  For historical reasons?

Ciao

Guido