3

I am writing my own OS on i386, then it comes to Global Descriptor Table setting, I am puzzling at NULL descriptor.

In INTEL 80386 PROGRAMMER'S REFERENCE MANUAL 1986 ,

NULL_DES DESC <> ; NULL descriptor

is the only mention about NULL descriptor.

Is there anybody tell me why x86 processor need a NULL descriptor in GDT?

Kirill Dmitrenko
  • 3,474
  • 23
  • 31
  • 3
    Selector 0 is generally only used to invalidate unused segment registers. if you place 0 in a a segment like _GS_ an an example and try to access memory through _GS_, a general protection fault will be raised. – Michael Petch Jun 16 '16 at 15:38
  • [AMD's architecture manual](http://developer.amd.com/wordpress/media/2012/10/24593_APM_v21.pdf) discusses the NULL Descriptor around page 70. Look for "Null Selector" . Selector 0 happens to have other uses in 64-bit long mode like nested control transfers which is also described. – Michael Petch Jun 16 '16 at 15:44
  • @MichaelPetch, thanks. it's usefull. – Gimcuan Hui Jun 20 '16 at 15:56

0 Answers0