Changeset 70 for trunk/hal/x86_64/core/hal_init.c
- Timestamp:
- Jun 27, 2017, 10:39:08 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r61 r70 36 36 #include <core.h> 37 37 #include <cluster.h> 38 #include <chdev.h> 39 40 #include <boot_info.h> 38 41 39 42 static void gdt_create(); … … 73 76 } 74 77 78 static void init_bootinfo_core(boot_core_t *core) 79 { 80 memset(core, 0, sizeof(boot_core_t)); 81 82 core->gid = hal_lapic_gid(); 83 core->lid = 0; 84 core->cxy = 0; 85 } 86 87 static void init_bootinfo_txt(boot_device_t *dev) 88 { 89 memset(dev, 0, sizeof(boot_device_t)); 90 91 dev->base = 0xB8000; 92 dev->type = (DEV_FUNC_TXT << 16) | IMPL_TXT_X86; 93 dev->channels = 1; 94 dev->param0 = 0; 95 dev->param1 = 0; 96 dev->param2 = 0; 97 dev->param3 = 0; 98 99 #ifdef NOTYET 100 uint32_t irqs; /*! number of input IRQs */ 101 boot_irq_t irq[32]; /*! array of input IRQS (PIC and ICU only) */ 102 #endif 103 } 104 105 static void init_bootinfo(boot_info_t *info) 106 { 107 extern uint64_t __kernel_data_start; 108 extern uint64_t __kernel_end; 109 110 memset(info, 0, sizeof(boot_info_t)); 111 112 info->signature = 0; 113 114 info->paddr_width = 0; 115 info->x_width = 1; 116 info->y_width = 1; 117 info->x_size = 1; 118 info->y_size = 1; 119 info->io_cxy = 0; 120 121 info->ext_dev_nr = 1; 122 init_bootinfo_txt(&info->ext_dev[0]); 123 124 info->cxy = 0; 125 info->cores_nr = 1; 126 init_bootinfo_core(&info->core[0]); 127 128 info->rsvd_nr = 0; 129 /* rsvd XXX */ 130 131 /* dev_ XXX */ 132 133 info->pages_offset = 0; 134 info->pages_nr = 0; 135 136 info->kernel_code_start = (intptr_t)(KERNTEXTOFF - KERNBASE); 137 info->kernel_code_end = (intptr_t)(&__kernel_data_start - KERNBASE) - 1; 138 info->kernel_data_start = (intptr_t)(&__kernel_data_start - KERNBASE); 139 info->kernel_code_end = (intptr_t)(&__kernel_end - KERNBASE) - 1; 140 } 141 75 142 void init_x86_64(paddr_t firstpa) 76 143 { 144 boot_info_t btinfo; 145 77 146 x86_printf("[+] init_x86_64 called\n"); 78 147 … … 109 178 *myptr = 1; 110 179 x86_printf("-> mytest = %z\n", mytest); 180 181 init_bootinfo(&btinfo); 182 kernel_init(&btinfo); 183 x86_printf("[+] kernel_init called\n"); 111 184 112 185 int m = 0;
Note: See TracChangeset
for help on using the changeset viewer.