Esempio n. 1
0
void nlm_init(void)
{
  /* start NLM grace period */
  gettimeofday(&nlm_grace_tv, NULL);

  /* also use this time to initialize granted_cookie */
  granted_cookie.gc_seconds      = (unsigned long) nlm_grace_tv.tv_sec;
  granted_cookie.gc_microseconds = (unsigned long) nlm_grace_tv.tv_usec;
  granted_cookie.gc_cookie       = 0;
  tcb_new(&nlmtcb, "NLM async thread");
}
Esempio n. 2
0
/* One pool can be used for all FSAL_UP used for exports. */
void nfs_Init_FSAL_UP()
{
  /* DEBUGGING */
  LogFullDebug(COMPONENT_INIT,
               "FSAL_UP: Initializing FSAL UP data pool");
  /* Allocation of the FSAL UP pool */
  fsal_up_event_pool = pool_init("FSAL UP Data Pool",
                                 sizeof(fsal_up_event_t),
                                 pool_basic_substrate,
                                 NULL,
                                 NULL,
                                 NULL);
  if(fsal_up_event_pool == NULL)
    {
      LogFatal(COMPONENT_INIT,
               "Error while allocating FSAL UP event pool");
    }

  init_glist(&fsal_up_process_queue);
  tcb_new(&fsal_up_process_tcb, "FSAL_UP Process Thread");

  return;
}
Esempio n. 3
0
void init(uint64_t loader, struct unfold64_objl *object_list, struct unfold64_mmap *memory_map) {

	// parse configuration
	for (size_t i = 0; i < object_list->count; i++) {
		if (!strcmp(object_list->entry[i].name, "/boot/pconf")) {
			config_parse((char*) object_list->entry[i].base);
			break;
		}
	}

	// initialize the physical memory manager
	pmm_init(memory_map);

	// initialize paging
	pcx_init();

	// initialize interrupt handling
	idt_init();

	// allocate the CCB for processor 0
	ccb_new();

	// initialize LAPIC timer
	struct ccb *ccb = ccb_get_self();

	ccb->lapic->destination_format  = 0xFFFFFFFF;
	ccb->lapic->logical_destination = (ccb->lapic->logical_destination & 0xFFFFFF) | 1;
	ccb->lapic->lvt_timer           = 0x10000;
	ccb->lapic->lvt_performance_monitoring_counters = 0x400;
	ccb->lapic->lvt_lint0           = 0x10000;
	ccb->lapic->lvt_lint1           = 0x10000;
	ccb->lapic->task_priority       = 0;

	ccb->lapic->spurious_interrupt_vector  = 33 | 0x100;
	ccb->lapic->timer_initial_count        = 100000; // roughly 1 KHz
	ccb->lapic->lvt_timer                  = 32 | 0x20000;
	ccb->lapic->timer_divide_configuration = 3; // 16

	// initialize interrupt routes

	// pinion (pagefault, zombie, etc.) interrupt vector page
	pinion_vector_page_vtable.on_reset = pinion_on_reset;
	interrupt_add_vector_page(0x0080, &pinion_vector_page_vtable);

	// IRQ interrupt vector page
	irq_vector_page_vtable.on_fire = irq_on_fire;
	irq_vector_page_vtable.on_reset = irq_on_reset;
	interrupt_add_vector_page(0x0100, &irq_vector_page_vtable);

	// initialize ACPI (for IRQ routing info)
	init_acpi();

	// allocate initial thread TCB and add to scheduler
	scheduler_add_tcb(tcb_new());

	// schedule first thread
	scheduler_schedule();

	// load kernel image
	load_kernel(object_list);
}