Changeset 192 for trunk/hal/x86_64
- Timestamp:
- Jul 13, 2017, 9:27:38 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r168 r192 86 86 /* -------------------------------------------------------------------------- */ 87 87 88 static void init_bootinfo_icu(boot_device_t *dev)89 {90 extern uint32_t hwi_baseidx;91 extern uint32_t wti_baseidx;92 extern uint32_t pti_baseidx;93 extern size_t ioapic_pins;94 95 memset(dev, 0, sizeof(boot_device_t));96 97 dev->base = 0;98 dev->type = (DEV_FUNC_ICU << 16) | IMPL_ICU_XCU;99 dev->channels = 1;100 101 #if NOTYET102 /*103 * Give 20% of the pins to HWI, 80% to WTI.104 */105 dev->param0 = (ioapic_pins * 20) / 100; /* hwi_nr */106 dev->param1 = ioapic_pins - dev->param0; /* wti_nr */107 #else108 dev->param0 = 1; /* hwi_nr */109 dev->param1 = 1; /* wti_nr */110 #endif111 112 /*113 * We always set 1 for pti_nr. On x86, timer interrupts are handled by114 * LAPIC, which is per-cpu and not global. Therefore, we always have one115 * timer for each CPU, and its IRQ number is faked to 0.116 */117 dev->param2 = 1; /* pti_nr */118 119 dev->param3 = 0;120 121 /* Set the base idx for the XCU driver */122 hwi_baseidx = 0;123 wti_baseidx = dev->param0;124 pti_baseidx = 0xFFFFFFFF;125 126 #ifdef NOTYET127 uint32_t irqs; /*! number of input IRQs */128 boot_irq_t irq[32]; /*! array of input IRQS (PIC and ICU only) */129 #endif130 }131 132 88 static size_t init_bootinfo_pages_nr() 133 89 { … … 195 151 } 196 152 197 static void init_bootinfo_ txt(boot_device_t *dev)153 static void init_bootinfo_pic(boot_device_t *dev) 198 154 { 199 155 memset(dev, 0, sizeof(boot_device_t)); 200 156 201 dev->base = 0 xB8000;202 dev->type = (DEV_FUNC_ TXT << 16) | IMPL_TXT_X86;157 dev->base = 0; 158 dev->type = (DEV_FUNC_PIC << 16) | IMPL_PIC_SCL; 203 159 dev->channels = 1; 204 160 dev->param0 = 0; … … 207 163 dev->param3 = 0; 208 164 209 #ifdef NOTYET 210 uint32_t irqs; /*! number of input IRQs */ 211 boot_irq_t irq[32]; /*! array of input IRQS (PIC and ICU only) */ 212 #endif 165 dev->irqs = 5; 166 167 /* COM1 */ 168 dev->irq[4].dev_type = (DEV_FUNC_TXT << 16) | IMPL_TXT_TTY; 169 dev->irq[4].channel = 0; 170 dev->irq[4].is_rx = 0; 171 dev->irq[4].valid = 1; 172 } 173 174 static void init_bootinfo_txt(boot_device_t *dev) 175 { 176 memset(dev, 0, sizeof(boot_device_t)); 177 178 dev->base = 0; 179 dev->type = (DEV_FUNC_TXT << 16) | IMPL_TXT_TTY; 180 dev->channels = 1; 181 dev->param0 = 0; 182 dev->param1 = 0; 183 dev->param2 = 0; 184 dev->param3 = 0; 213 185 } 214 186 … … 231 203 info->io_cxy = 0; 232 204 233 info->ext_dev_nr = 1;205 info->ext_dev_nr = 2; 234 206 init_bootinfo_txt(&info->ext_dev[0]); 207 init_bootinfo_pic(&info->ext_dev[1]); 235 208 236 209 info->cxy = 0; … … 240 213 info->rsvd_nr = init_bootinfo_rsvd((boot_rsvd_t *)&info->rsvd); 241 214 242 init_bootinfo_icu(&info->dev_icu);215 /* TODO: dev_icu */ 243 216 /* TODO: dev_mmc */ 244 217 /* TODO: dev_dma */ … … 308 281 hal_enable_irq(&dummy); 309 282 310 while (1);311 312 283 kernel_init(&btinfo); 313 284 314 285 x86_printf("[+] kernel_init called\n"); 315 286 /* 287 void *ptr; 288 289 khm_t *khm = &LOCAL_CLUSTER->khm; 290 ptr = khm_alloc(khm, 10); 291 memset(ptr, 0, 10); 292 khm_free(ptr); 293 294 295 kcm_t *kcm = &LOCAL_CLUSTER->kcm; 296 ptr = kcm_alloc(kcm); 297 memset(ptr, 0, 1); 298 kcm_free(ptr); 299 300 ptr = ppm_alloc_pages(1); 301 ppm_free_pages(ptr); 302 */ 316 303 while (1); 317 304
Note: See TracChangeset
for help on using the changeset viewer.