From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <6c529a9785a1131ce815f5fa79593321@proxima.alt.za> To: 9fans@9fans.net Date: Thu, 2 Apr 2009 11:13:18 +0200 From: lucio@proxima.alt.za MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] segfree() - more details? Topicbox-Message-UUID: d07cd8de-ead4-11e9-9d60-3106f5b1d025 The rather tantalising: Segfree tells the system that it may free any physical mem- ory within the span [va, va+len), but leaves that portion of the process's address space valid. The system will not free any memory outside that span, and may not free all or even any of the specified memory. If free'd memory is later ref- erenced, it will be initialized as appropriate for the seg- ment type. For example data and text segments will be read from the executable file, and bss segments will be filled with zero bytes. in segattach(2) suggests that there is some mechanism to associate disk file portions with memory segments (that being what Unix's MMAP does, roughly), but falls short of explaining how this association is established. I presume there is documentation for this elsewhere that ought to be mentioned in the above. Also, I'm too dense to grasp the exact intent of segfree(2) as implied in the above description, but I'm sure once I understand it I'll be able to make use of it in my efforts to make Plan 9 understand ELF directly. So if anyone can point me to the right place, I'd greatly appreciate it. I have Nemo's "commentary" that has proved invaluable to my understanding of the Plan 9 kernel, but I always have to find it by inspection because its filename is not very self-explanatory. I guess I ought to change that, but I'm the conservative type: does anyone remember its name? ++L