Changeset c4b3e3e in mainline
- Timestamp:
- 2005-09-03T19:33:52Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c835e7c
- Parents:
- 78665c0
- Location:
- arch
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/_link.ld
r78665c0 rc4b3e3e 18 18 *(K_TEXT_START_2); 19 19 unmapped_ktext_end = .; 20 20 21 unmapped_kdata_start = .; 21 22 *(K_DATA_START); … … 23 24 } 24 25 25 .mapped (0xffffffff80 000000+SIZEOF(.unmapped)+0x8000) : AT (0x8000+SIZEOF(.unmapped)) {26 .mapped (0xffffffff80100000+0x8000+SIZEOF(.unmapped)) : AT (0x8000+SIZEOF(.unmapped)) { 26 27 ktext_start = .; 27 28 *(BOOT_DATA); … … 38 39 hardcoded_kdata_size = .; 39 40 QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start)); 41 hardcoded_unmapped_ktext_size = .; 42 LONG(unmapped_ktext_end - unmapped_ktext_start); 43 hardcoded_unmapped_kdata_size = .; 44 LONG(unmapped_kdata_end - unmapped_kdata_start); 40 45 *(COMMON); /* global variables */ 41 46 … … 51 56 kdata_end = .; 52 57 } 53 _map_address = 0xffffffff80000000; 58 _map_address = 0xffffffff80100000; 59 _hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start); 60 54 61 e820table_boot = e820table - _map_address; 55 62 e820counter_boot = e820counter - _map_address; -
arch/amd64/include/boot/boot.h
r78665c0 rc4b3e3e 31 31 32 32 #define BOOTSTRAP_OFFSET 0x8000 33 #define BOOT_OFFSET 0x 033 #define BOOT_OFFSET 0x100000 34 34 35 35 #define MULTIBOOT_HEADER_MAGIC 0x1BADB002 -
arch/amd64/include/cpuid.h
r78665c0 rc4b3e3e 30 30 #define __CPUID_H__ 31 31 32 #include <arch/types.h>33 34 32 #define AMD_CPUID_EXTENDED 0x80000001 35 33 #define AMD_EXT_NOEXECUTE 20 34 35 #ifndef __ASM__ 36 37 #include <arch/types.h> 36 38 37 39 struct cpu_info { … … 49 51 extern __u64 rdtsc(void); 50 52 53 #endif /* __ASM__ */ 51 54 #endif -
arch/amd64/src/boot/boot.S
r78665c0 rc4b3e3e 33 33 #include <arch/pm.h> 34 34 #include <arch/cpu.h> 35 #include <arch/cpuid.h> 36 #include <arch/boot/boot.h> 35 37 36 #define START_STACK 0x7c0037 38 #define START_STACK_64 0xffffffff80007c00 38 39 … … 45 46 # switch to protected mode. 46 47 # 48 49 #define START_STACK (BOOTSTRAP_OFFSET-0x400) 50 47 51 .section K_TEXT_START 48 52 .code16 … … 53 57 movw %ax,%ds 54 58 movw %ax,%ss # initialize stack segment register 55 movl $(START_STACK), %esp # initialize stack pointer59 movl $(START_STACK), %esp # initialize stack pointer 56 60 57 61 call memmap_arch_init … … 61 65 cmp $0x80000000, %eax # any function > 80000000h? 62 66 jbe no_long_mode 63 movl $ 0x80000001, %eax# Extended function code 8000000167 movl $(AMD_CPUID_EXTENDED), %eax # Extended function code 80000001 64 68 cpuid 65 69 bt $29, %edx # Test if long mode is supported. … … 89 93 movw %ax, %ss 90 94 95 movb $0xd1, %al # enable A20 using the keyboard controller 96 outb %al, $0x64 97 movb $0xdf, %al 98 outb %al, $0x60 99 100 91 101 # Enable 64-bit page transaltion entries - CR4.PAE = 1. 92 102 # Paging is not enabled until after long mode is enabled … … 98 108 leal ptl_0, %eax 99 109 movl %eax, %cr3 100 110 101 111 # Enable long mode 102 112 movl $EFER_MSR_NUM, %ecx # EFER MSR number … … 115 125 .code64 116 126 start64: 117 movq $(START_STACK_64), %rsp 127 movq $(PA2KA(START_STACK)), %rsp 128 129 # Copy kernel to higher physical memory 130 movq $BOOTSTRAP_OFFSET, %rsi 131 movq $BOOTSTRAP_OFFSET + BOOT_OFFSET, %rdi 132 movq $_hardcoded_kernel_size, %rcx 133 cld 134 rep movsb 118 135 119 136 call main_bsp # never returns … … 154 171 bsp_bootstrap_gdtr: 155 172 .word gdtselector(GDT_ITEMS) 156 .long KA2PA(gdt) 173 .long KA2PA(gdt)-BOOT_OFFSET 157 174 158 175 .global ap_bootstrap_gdtr 159 176 ap_bootstrap_gdtr: 160 177 .word gdtselector(GDT_ITEMS) 161 .long KA2PA(gdt) 178 .long KA2PA(gdt)-BOOT_OFFSET -
arch/ia32/include/boot/boot.h
r78665c0 rc4b3e3e 31 31 32 32 #define BOOTSTRAP_OFFSET 0x8000 33 #define BOOT_OFFSET 33 #define BOOT_OFFSET 0x100000 34 34 35 35 #define MULTIBOOT_HEADER_MAGIC 0x1BADB002
Note:
See TracChangeset
for help on using the changeset viewer.