As I know all the segment registers or selectors are set to point to the same starting address of the 4gb segment in 32 bit protected mode flat model. So how the stack segment functionality is implemented which is it starts at one of the top address and grows downwards or heap segment functionality which grows upward.
Also how some portion of the memory is owned by the OS in the 4gb address space, is implemented?