2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include <sys/types.h>
25 #define GDT_CODESEG 0x0A
26 #define GDT_DATASEG 0x02
28 #define GDT_PRESENT 0x80
29 #define GDT_SEGMENT 0x10
33 #define GDT_MAXDESC 64
35 #define IDX2SEL(idx,priv) (((idx)<<3)|(priv))
43 unsigned limit0_15:16;
65 unsigned limit16_19:4;
67 } __attribute__ ((packed)) gdtdesc_t;*/
75 } __attribute__ ((packed
)) gdtdesc_t
;
80 } __attribute__ ((packed
)) gdtsel_t
;
86 } __attribute__ ((packed
)) selector_t
;
88 typedef gdtdesc_t
* gdt_t
;
91 gdtdesc_t gdt
[GDT_MAXDESC
];
94 void gdt_set_descriptor(int segment
,size_t size
,void *base
,int access
,priv_t priv
);