Click here to Skip to main content
15,878,048 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Updated 17-Jan-23 2:34am
Member 15627495 17-Jan-23 7:58am    
Hello !

read about 'Thread' , you'll better understand all process and their dedicated memory.

1 solution

"yes" or "no" :laugh:

It has to do with the microprocessor architecture: Memory Segmentation in 8086 Microprocessor - GeeksforGeeks[^] it was a way to extend addressing (and thus the ram available to an application) beyond the 16 bit address space of the 8086 processor, by adding another 16 bits to each fetch operation. So the structure of an app reflected that: Data segment, program segment, and so forth - and that influenced the design of EXE files.

x64 based processors have a much larger address space available to them, and don't need segmentation as a result.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900