Subject: Re: mmap() and page alignment
To: None <frank@fwi.uva.nl>
From: None <friedl@informatik.uni-kl.de>
List: tech-kern
Date: 07/12/1995 13:07:07
   From: Frank van der Linden <frank@fwi.uva.nl>

   vm_mmap first creates a map with the unrounded size, and then allocates
   in that map with the rounded up size, so it always fails. A rather
   strange behavior I thought, but when I tried a quick fix for it
   I got panics, so I figured I'd better polish up my knowledge of the VM
   system before trying again..

   Rounding up the size before mapping also gave some problems, of which
   I don't remember the details, but I think it had to do with overlapping
   maps of text & data.

The problem is that the last page of the data is not padded with zero.
Therefor the start of the bss segment, which follows the data segment,
is not initialized to zero.

A fix would be to allow mapping of ranges, where the end in not page
aligned.  When the last page of such a range is loaded, the first part
of the page has to be read from file, while the end of the page has to
be cleared.

-- 
Ralf Friedl
friedl@informatik.uni-kl.de