blob: 90167993a61cac80ffaa7cb4cfaf528b28c6cb89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* Defenitions:
* Segment:
* A logically contiguous chunk of memory with consistent properties from the cpus perspective
* - Just a bunch of memory dedicated for a specific purpose
* Segment Register:
* A register of the CPU that refers to a segment for a particular purpose (CS, DS, SS, ES)
* or for general use. (FS, GS)
* - Code segment, Data segment, ...
* Segment Selector:
* A reference to a descriptor, which you can load into a segment register; the selector is an offset
* into a descriptor table pointing to one of its entries.
* These entries are typically 8 bytes long, therefore
* bits 3 and up only declare the descriptor table entry offset
* bit 2 specifies GDT or LDT
* bits 0-1 declare ring level that needs to correspond to the descriptor table entry's DPL field.
* GENERAL PROTECTION FAULT if it doesn't
* If it does correspond then the CPL level of the selector used is changed accordingly
* - A pointer to an entry in the DT
* Segment Descriptor:
* An entry in a descriptor table.
* These are a binary data structure that tells the CPU the attributes of a given segment
* - A binary number that describes a segment
*/
|