There are a few things in learning operating systems (mainly with Linux as a reference) that I don't find effectively articulated in the literature that I have read.
Even in the context of operating systems like Linux, where virtual memory is primarily based on paging, programs put into memory are frequently characterized as being separated into segments of text, data, stack, and so on. Is it true that only the program and not the memory itself is said to as segmented? If that's the case, the terminology is perplexing to me.
I discovered that malloc can be implemented in Linux by calling'sbrk,' which increases the size of the data segment.
Is this 'data segment,' once again, only an area of RAM utilized for data by convention and not a real' segment like said here
? (Another question:'sbrk' does not appear to be capable of reducing the size of the segment's. Is this to say that a process can never release memory to the operating system other than by quitting?
What I have tried:
I'm also curious as to why newer OS systems don't appear to use (paged) segmentation. Wouldn't having the code in its own protected area prevent some types of assaults, hence boosting security? On the other side, would this make JIT compilation, for example, impossible or difficult?
Aside from "yes" or "no" replies to the above questions, I am interested in any meaningful elaboration on the matter.