Message board for the users of flat assembler.
> OS Construction > Segments in PMode
BOTOKILLER 01 Jun 2011, 10:13
I read Intel docs and thing that im not getting - Priviligies Level in segment registers, what do I have to put there? current priviligies level, priviligies of segment, that im going to access or something else?
;15______________________3_________________2________0 ;|the num of record in gdt|table GDT or LDT |PRIVL | ;|________________________|_________________|________| ; this one ; is what i'm ; asking ; about
|01 Jun 2011, 10:13||
ouadji 01 Jun 2011, 10:51
the privilege of segment that i'm going to access
(greater than or equal)
|01 Jun 2011, 10:51||
BOTOKILLER 01 Jun 2011, 11:35
so, if i have gdt table
then if i want DS to point at RECORD2 i will have to put privl level of RECORD2 into ds???
|01 Jun 2011, 11:35||
edfed 01 Jun 2011, 12:58
privilege levels is a different part of segmentation, something you don't have to manage for the moment.
lets go for every PL=0 for the moment, the rings feature is really complex, it is a lot of security, and will not help you to code the gdt and the kernel.
after, when you will have a kernel, you will have to play with rings to protect the kernel from applications.
|01 Jun 2011, 12:58||
ouadji 01 Jun 2011, 13:05
I was wrong, sorry.
It's not "the privilege of the descriptor that i'm going to access (DPL)",
but the "current privilege level" (CPL)
RPL <--- CPL (intel doc 3A/5.5)
|01 Jun 2011, 13:05||
BOTOKILLER 01 Jun 2011, 13:23
but what if i make far jump to segment with another DPL, and then trying to access data through segment register which contains old CPL. what will happen?
|01 Jun 2011, 13:23||
edfed 01 Jun 2011, 13:38
CPL is from 0 to 3
0 is high level (say skylab zone)
3 is low level (say green hill zone)
level means the power, permissions, etc...
the more the level is, the more permission you have, and for this, you need a lower CPL.
this is the first ambiguity in PL (RPL, CPL, IOPL) feature.
after, if a code from high level calls a code from low level, error, because the caller is what set the CPU PL.
if the CPU PL is high than target PL, error, because cpu protection is not activated for high levels.
and RTFM please.
|01 Jun 2011, 13:38||
ouadji 01 Jun 2011, 15:15
PRIVILEGE LEVEL CHECKING WHEN ACCESSING DATA SEGMENTS
The processor loads the segment selector into the segment register if the DPL is numerically greater than or equal to both the CPL and the RPL.
Otherwise, a general-protection fault is generated and the segment register is not loaded.
Interrupt 13—General Protection Exception (#GP)---> BSOD
You should read the intel doc, really, all is Within.
"... cpu protection is not activated for high levels" (???)
Je ne comprends réellement pas ce que tu veux dire par là.
Que ce soit en ring0 ou en ring3, le mode protégé est activé.
désolé de pointer ce petit morceau de phrase.
et CPU PL, kesako ? ... le niveau de privilège du processeur ?
Ooups, le raccourci me semble fort risqué.
|01 Jun 2011, 15:15||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.