📄 gdt.h
字号:
/* * OSV * Copyright (C) 2002 Ciprian DOSOFTEI <rocksoul@mail.com> * All rights reserved. * * http://backster.free.fr/osv * * This file is part of the OSV project. OSV is free software, also known as * "open source"; you can redistribute it and/or modify it under the terms * of the GNU General Public License (GPL), version 2, as published by the Free * Software Foundation (FSF). To explore alternate licensing terms, contact * the author at rocksoul@mail.com or +40740649907. * * OSV is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GPL for more details. You should have * received a copy of the GPL along with OSV; see the file COPYING. If * not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA. */#ifndef INCGDT#define INCGDT#include <sys/params.h>#include <types.h>#include <string.h>typedef struct descriptor{ /* segment limit 15:00 */ word limit0_15; /* base address 15:00 */ word base0_15; /* base address 23:16 */ byte base16_23; /* segment type */ byte type : 4; /* descriptor type */ byte s : 1; /* descriptor privilege level - aka Ring */ byte dpl : 2; /* segment present */ byte p : 1; /* segment limit 19:16 */ byte limit16_19 : 4; /* available for use by system software */ byte avl : 1; /* always 0 */ byte zero : 1; /* default operation size */ byte db : 1; /* granularity */ byte g : 1; /* base address 31:24 */ byte base24_31;} __attribute__ ((packed)) descriptor;extern descriptor *GDT;extern void setupGDT(void);extern void setupDescriptor(descriptor *d, dword base, dword limit, byte type, byte dpl, byte s, byte db);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -