mini-os: sbrk() doesn't allocate pages?
Hi,
I'm wondering how the mini-os heap allocater work. The sbrk() function in mm.c seems to *not* allocate pages for the heap. Instead it uses the zero page and maps it into the heap space when a new page is needed ...
I can't believe is is supposed to work that way. Is that a bug? Did I miss some logic somewhere in the code?
wondering,
Gerd
Signature · 1 line
http://kraxel.fedorapeople.org/xenner/
Quoted 8 lines · Gerd Hoffmann
Hi,
I'm wondering how the mini-os heap allocater work. The
sbrk()function inmm.cseems to *not* allocate pages for the heap. Instead it uses the zero page and maps it into the heap space when a new page is needed ...I can't believe is is supposed to work that way. Is that a bug? Did I miss some logic somewhere in the code?
Oh, cow in the pagefault handler, that is the missing bit ...
cheers,
Gerd
Signature · 1 line
http://kraxel.fedorapeople.org/xenner/
Quoted 1 line · Gerd Hoffmann, le Thu 14 Aug 2008 10:04:31 +0200, a écrit :
I can't believe is is supposed to work that way.
That's how it usually works in unix environments :)
Samuel