|
|
1.1 root 1: /*
2: * Copyright (c) 1995-1994 The University of Utah and
3: * the Computer Systems Laboratory at the University of Utah (CSL).
4: * All rights reserved.
5: *
6: * Permission to use, copy, modify and distribute this software is hereby
7: * granted provided that (1) source code retains these copyright, permission,
8: * and disclaimer notices, and (2) redistributions including binaries
9: * reproduce the notices in supporting documentation, and (3) all advertising
10: * materials mentioning features or use of this software display the following
11: * acknowledgement: ``This product includes software developed by the
12: * Computer Systems Laboratory at the University of Utah.''
13: *
14: * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
15: * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
16: * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17: *
18: * CSL requests users of this software to return to [email protected] any
19: * improvements that they make and grant CSL redistribution rights.
20: *
21: * Author: Bryan Ford, University of Utah CSL
22: */
23:
24: #include <mach/machine/code16.h>
25: #include <mach/machine/seg.h>
26:
27: #include "vm_param.h"
28: #include "cpu.h"
29:
30:
31: CODE16
32:
33: /* This 16-bit function initializes CPU 0's GDT
34: just enough to get in and out of protected (and possibly paged) mode,
35: with all addresses assuming identity-mapped memory. */
36: void i16_gdt_init_temp()
37: {
38: /* Create temporary kernel code and data segment descriptors.
39: (They'll be reinitialized later after paging is enabled.) */
40: i16_fill_gdt_descriptor(&cpu[0], KERNEL_CS,
41: boot_image_pa, 0xffffffff,
42: ACC_PL_K|ACC_CODE_R, SZ_32);
43: i16_fill_gdt_descriptor(&cpu[0], KERNEL_DS,
44: boot_image_pa, 0xffffffff,
45: ACC_PL_K|ACC_DATA_W, SZ_32);
46: i16_fill_gdt_descriptor(&cpu[0], KERNEL_16_CS,
47: boot_image_pa, 0xffff,
48: ACC_PL_K|ACC_CODE_R, SZ_16);
49: i16_fill_gdt_descriptor(&cpu[0], KERNEL_16_DS,
50: boot_image_pa, 0xffff,
51: ACC_PL_K|ACC_DATA_W, SZ_16);
52: }
53:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.