|
|
1.1 ! root 1: /* ! 2: * Ported to boot 386BSD by Julian Elischer ([email protected]) Sept 1992 ! 3: * ! 4: * Mach Operating System ! 5: * Copyright (c) 1992, 1991 Carnegie Mellon University ! 6: * All Rights Reserved. ! 7: * ! 8: * Permission to use, copy, modify and distribute this software and its ! 9: * documentation is hereby granted, provided that both the copyright ! 10: * notice and this permission notice appear in all copies of the ! 11: * software, derivative works or modified versions, and any portions ! 12: * thereof, and that both notices appear in supporting documentation. ! 13: * ! 14: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 15: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 16: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 17: * ! 18: * Carnegie Mellon requests users of this software to return to ! 19: * ! 20: * Software Distribution Coordinator or [email protected] ! 21: * School of Computer Science ! 22: * Carnegie Mellon University ! 23: * Pittsburgh PA 15213-3890 ! 24: * ! 25: * any improvements or extensions that they make and grant Carnegie Mellon ! 26: * the rights to redistribute these changes. ! 27: */ ! 28: ! 29: /* ! 30: * HISTORY ! 31: * $Log: table.c,v $ ! 32: * Revision 1.1 1993/03/21 18:08:47 cgd ! 33: * after 0.2.2 "stable" patches applied ! 34: * ! 35: * Revision 2.2 92/04/04 11:36:43 rpd ! 36: * Fix Intel Copyright as per B. Davies authorization. ! 37: * [92/04/03 rvb] ! 38: * Taken from 2.5 bootstrap. ! 39: * [92/03/30 rvb] ! 40: * ! 41: * Revision 2.2 91/04/02 14:42:22 mbj ! 42: * Add Intel copyright ! 43: * [90/02/09 rvb] ! 44: * ! 45: */ ! 46: ! 47: /* ! 48: Copyright 1988, 1989, 1990, 1991, 1992 ! 49: by Intel Corporation, Santa Clara, California. ! 50: ! 51: All Rights Reserved ! 52: ! 53: Permission to use, copy, modify, and distribute this software and ! 54: its documentation for any purpose and without fee is hereby ! 55: granted, provided that the above copyright notice appears in all ! 56: copies and that both the copyright notice and this permission notice ! 57: appear in supporting documentation, and that the name of Intel ! 58: not be used in advertising or publicity pertaining to distribution ! 59: of the software without specific, written prior permission. ! 60: ! 61: INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE ! 62: INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, ! 63: IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR ! 64: CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ! 65: LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, ! 66: NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION ! 67: WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ! 68: */ ! 69: ! 70: #define NGDTENT 6 ! 71: #define GDTLIMIT 48 /* NGDTENT * 8 */ ! 72: ! 73: /* Segment Descriptor ! 74: * ! 75: * 31 24 19 16 7 0 ! 76: * ------------------------------------------------------------ ! 77: * | | |B| |A| | | |1|0|E|W|A| | ! 78: * | BASE 31..24 |G|/|0|V| LIMIT |P|DPL| TYPE | BASE 23:16 | ! 79: * | | |D| |L| 19..16| | |1|1|C|R|A| | ! 80: * ------------------------------------------------------------ ! 81: * | | | ! 82: * | BASE 15..0 | LIMIT 15..0 | ! 83: * | | | ! 84: * ------------------------------------------------------------ ! 85: */ ! 86: ! 87: struct seg_desc { ! 88: unsigned short limit_15_0; ! 89: unsigned short base_15_0; ! 90: unsigned char base_23_16; ! 91: unsigned char bit_15_8; ! 92: unsigned char bit_23_16; ! 93: unsigned char base_31_24; ! 94: }; ! 95: ! 96: ! 97: struct seg_desc Gdt[NGDTENT] = { ! 98: {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, /* 0x0 : null */ ! 99: {0xFFFF, 0x0, 0x0, 0x9F, 0xCF, 0x0}, /* 0x08 : kernel code */ ! 100: {0xFFFF, 0x0, 0x0, 0x93, 0xCF, 0x0}, /* 0x10 : kernel data */ ! 101: {0xFFFF, 0x0000, 0x9, 0x9E, 0x40, 0x0}, /* 0x18 : boot code */ ! 102: {0xFFFF, 0x0000, 0x9, 0x92, 0x40, 0x0}, /* 0x20 : boot data */ ! 103: {0xFFFF, 0x0000, 0x9, 0x9E, 0x0, 0x0} /* 0x28 : boot code, 16 bits */ ! 104: }; ! 105: ! 106: ! 107: struct pseudo_desc { ! 108: unsigned short limit; ! 109: unsigned short base_low; ! 110: unsigned short base_high; ! 111: }; ! 112: ! 113: struct pseudo_desc Gdtr = { GDTLIMIT, 0x0400, 9 }; ! 114: struct pseudo_desc Gdtr2 = { GDTLIMIT, 0xfe00, 9 }; ! 115: /* boot is loaded at 0x90000, Gdt is at boot+1024 */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.