Page 1 of 1

Theoretical GDT question

Posted: Wed Jul 24, 2013 10:18 am
by TwixEmma
Hi, I don't know if something like this has been discussed before and I hope this is the right place to put this, I was busy designing my GDT to allow for four segment types, 3 for each ring level, and 1 that would overlap it all and allow ring 0 code to read everything everywhere else. My theoretical question was is it possible to have a GDT entry spanning everything, that only allows ring0 data reading, my idea is that any program ran on the OS could be viewed by the OS even though the program is somewhere like ring3. This is useful for debugging and disassembling programs contained with the OS. I'm somewhat new to OS development, although I've done a lot of research. Thanks in advance.

Re: Theoretical GDT question

Posted: Wed Jul 24, 2013 10:24 am
by AJ
Hi,

Anything running in kernel mode can already read user mode pages without a special GDT entry. If you are running a flat memory model, you just need ring 0 code and data segments and ring 3 code and data segments extending across the entire virtual memory space (4 descriptors plus the null descriptor). You then control access to individual pages via the u/s bit in your paging structutres.

Cheers,
Adam