0

I've been learning more about operating systems, and I'm wondering how Kernel mode and user mode work. I read about the GDT in 32 bit protected mode. Is this used for setting up what is user and Kernal space?

  • No, modern OSes use paging, not segmentation, for memory protection. Related: [How does the OS ensure that one process cannot access the base, limit of another process in the global descriptor table in x86 architecture?](https://stackoverflow.com/q/69432020) / [OS & Assembly: What prevents user mode from setting selector to arbitrary value?](https://stackoverflow.com/q/58705618) / [What is the use of defining a Global Descriptor Table?](https://stackoverflow.com/q/37554399) – Peter Cordes Nov 14 '22 at 06:43
  • Almost a duplicate of [How is the x86 data segment used in real operating systems and processes?](https://stackoverflow.com/q/12760109) and/or [general protection in a custom OS](https://stackoverflow.com/q/7836835) . Also somewhat [Why does x86 paging have no concept of privilege rings?](https://stackoverflow.com/q/66053495) describing how you still have to set up the GDT and use segment selectors in a few places to keep the CPU happy even with the normal flat memory model, one that x86-64 long mode enforces (CS, DS, ES, SS bases are 0, limit=unlmited) – Peter Cordes Nov 14 '22 at 07:01
  • Or [Do modern OS's use paging and segmentation?](https://stackoverflow.com/q/24358105) does correctly say that "Modern OSes "do not use" segmentation", after explaining the possible ways that could be combined with paging. – Peter Cordes Nov 14 '22 at 07:01

0 Answers0