当前位置: 首页>>代码示例>>C++>>正文


C++ pic_init函数代码示例

本文整理汇总了C++中pic_init函数的典型用法代码示例。如果您正苦于以下问题:C++ pic_init函数的具体用法?C++ pic_init怎么用?C++ pic_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pic_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
	log_init(1, "emu86.log");

        mem_init();

/*	load_rom("../rom/wdbios.rom", 0xc8000, 8192, "a39b2b1c3e298b3599995c353d16c3ad");*/
	load_rom("../rom/basicc11.f6", 0xf6000, 8192, "69e2bd1d08c893cbf841607c8749d5bd");
	load_rom("../rom/basicc11.f8", 0xf8000, 8192, "5f85ff5ea352c1ec11b084043fbb549e");
	load_rom("../rom/basicc11.fa", 0xfa000, 8192, "04a285d5dc8d86c60679e8f3c779dcc4");
	load_rom("../rom/basicc11.fc", 0xfc000, 8192, "b086a6980fc5736098269e62b59726ef");
	load_rom("../rom/pc081682.bin", 0xfe000, 8192, "1584aeaadebba4bc95783f1fa0fa3db8");

        cpu_init();
        pit_init();
        pic_init();
        dma_init();
        ppi_init();
        fdc_init();

        initscr();
        cbreak();
        noecho();
        nodelay(stdscr, TRUE);
        keypad(stdscr, TRUE);
	

	mainloop();
	endwin();
	return 0;
}
开发者ID:BackupTheBerlios,项目名称:emu86,代码行数:31,代码来源:emu86.c

示例2: interrupt_init

void interrupt_init() {
    int i;
    pic_init(32, 40);
    for (i = 32; i < 48; i++) {
        interrupt_disable(i);
        interrupt_acknowledge(i);
    }
    for (i = 0; i < 32; i++) {
        interrupt_handler_table[i] = unknown_exception;
        interrupt_spurious[i] = 0;
        interrupt_count[i] = 0;
    }
    for (i = 32; i < 48; i++) {
        interrupt_handler_table[i] = unknown_hardware;
        interrupt_spurious[i] = 0;
        interrupt_count[i] = 0;
    }

    // Wire vector index 14 to pagefault handler
    interrupt_handler_table[14] = exception_handle_pagefault;

    interrupt_unblock();

    console_printf("interrupt: ready\n");
}
开发者ID:Digmaster,项目名称:Nunya,代码行数:25,代码来源:interrupt.c

示例3: kernel_early

void kernel_early(multiboot_info_t* mbd, unsigned int magic)
{
	terminal_initialize();

	printf("Starting jOS Kernel\n");
	printf("===================\n\n");
	
	if (magic != MULTIBOOT_BOOTLOADER_MAGIC)
		panic("Bootloader is not Multiboot Compliant");
	
	memory_init(mbd);

	printf("[x] Memory Initialized\n");
	
	gdt_init();
	
	printf("GDT Initialized, entering Protected Mode\n");
	
	printf("Enabling IDT:\n");

	pic_init();

	printf("\t[x] PIC IRQs remapped\n");
	
	idt_init();

	printf("\t[x] IDT Initialized\n");
	if (are_interrupts_enabled())
		printf("\t[x] Hardware Interrupts enabled\n");
	else
		printf("\t[ ] Error enabling Hardware Interrupts\n");
	
	phys_mem_management_init();
	
}
开发者ID:JoepDriesen,项目名称:jOS,代码行数:35,代码来源:kernel.c

示例4: lapic_init

int lapic_init() {
  uint32_t edx = 0;
  cpu_t *cpu = cpu_this;

  pic_init();

  cpu_id(1,NULL,NULL,NULL,&edx);
  if (edx&(1<<9) && 0) {
    isr_uselapic = 1;
    cpu->uselapic = 1;

    lapic = memkernel_findvirt(1)+PAGEOFF(LAPIC_PHYS_ADDRESS);
    if (paging_map(PAGEDOWN(lapic),PAGEDOWN(LAPIC_PHYS_ADDRESS),0,1)<0) panic("Cannot map LAPIC\n");

    lapic->tpr = 0x20;
    lapic->lvt_timer   = 0x20030;
    lapic->lvt_thermal = 0x20031;
    lapic->lvt_pmc     = 0x20032;
    lapic->lvt_lint0   = 0x08700;
    lapic->lvt_lint1   = 0x08700;
    lapic->lvt_error   = 0x20035;
    lapic->spurious    = 0x0010F;

    pic_pit_setinterval(0,LAPIC_PIT_CALIBRATE_INTERVAL);

    return 0;
  }
  else {
    isr_uselapic = 0;
    cpu->uselapic = 0;
    cpu->interval = 10; // IRQ0 all 10 ms
    pic_pit_setinterval(0,cpu->interval);
    return -1;
  }
}
开发者ID:jgraef,项目名称:meinOS,代码行数:35,代码来源:lapic.c

示例5: i386_init

void
i386_init(void)
{
	extern char edata[], end[];

	// Before doing anything else, complete the ELF loading process.
	// Clear the uninitialized global data (BSS) section of our program.
	// This ensures that all static/global variables start out zero.
	memset(edata, 0, end - edata);

	// Initialize the console.
	// Can't call cprintf until after we do this!
	cons_init();

	cprintf("6828 decimal is %o octal!\n", 6828);

	// Lab 2 memory management initialization functions
	i386_detect_memory();
	i386_vm_init();
	page_init();
	page_check();

	// Lab 3 user environment initialization functions
	env_init();
	idt_init();

	// Lab 4 multitasking initialization functions
	pic_init();
	kclock_init();

	// Should always have an idle process as first one.
	ENV_CREATE(user_idle);

	// Start fs.
	ENV_CREATE(fs_fs);
	ENV_CREATE(user_icode);

#if defined(TEST)
	// Don't touch -- used by grading script!
	ENV_CREATE2(TEST, TESTSIZE)
#else
	// Touch all you want.
	// ENV_CREATE(user_icode);
	// ENV_CREATE(user_pipereadeof);
	// ENV_CREATE(user_pipewriteeof);
	// ENV_CREATE(user_testpipe);
	// ENV_CREATE(user_primespipe);
	// ENV_CREATE(user_testpiperace);
	// ENV_CREATE(user_testpiperace2);
	// ENV_CREATE(user_testfdsharing);
#endif // TEST*

	// Should not be necessary - drain keyboard because interrupt has given up.
	kbd_intr();

	// Schedule and run the first user environment!
	sched_yield();


}
开发者ID:sunrenjie,项目名称:jos,代码行数:60,代码来源:init.c

示例6: arch_int_init

status_t
arch_int_init(kernel_args* args)
{
	// setup the standard programmable interrupt controller
	pic_init();
	return B_OK;
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:7,代码来源:arch_int.cpp

示例7: ALLOC

Pic *pic_open_stream (char *dev, FILE *stream, char *name, char *mode)
{
    int i;
    char *data;
    Pic *p, *q;

    if (pic_npic<0) pic_init();
    if (!dev) {			/* probably comes from pic_file_dev */
	fprintf(stderr, "unknown pic device on %s\n", name);
	return 0;
    }
    for (i=0; i<pic_npic && !str_eq(dev, pic_list[i]->dev); i++);
    if (i>=pic_npic) {
	fprintf(stderr, "unknown pic device: %s\n", dev);
	return 0;
    }
    q = pic_list[i];
    data = (*q->procs->open_stream)(stream, name, mode);
    if (!data) return 0;

    /* copy the Pic structure before modifying it */
    ALLOC(p, Pic, 1);
    *p = *q;
    p->data = data;
    return p;
}
开发者ID:uw-loci,项目名称:ome-server,代码行数:26,代码来源:pic.c

示例8: kern_init

int
kern_init(void) {
    extern char edata[], end[];
    memset(edata, 0, end - edata);
	
    cons_init();                // init the console

    const char *message = "(THU.CST) os is loading ...";
    kprintf ("%s\n\n", message);

	/* Only to initialize lcpu_count. */
	mp_init ();

	pmm_init();                 // init physical memory management
	pmm_init_ap ();

    pic_init();                 // init interrupt controller

	vmm_init();                 // init virtual memory management
    sched_init();               // init scheduler
	proc_init();                // init process table
    sync_init();                // init sync struct
	
	ide_init();                 // init ide devices
    swap_init();                // init swap
    fs_init();                  // init fs

    clock_init();               // init clock interrupt
    intr_enable();              // enable irq interrupt    

    cpu_idle();                 // run idle process
}
开发者ID:PungiZhang,项目名称:ucore_plus-next,代码行数:32,代码来源:init.c

示例9: main

int main()
{
    pic_init();
    logging_init();
    button_init();
    bumper_init();
    pwm_init();
    motor_timer_init();
    button_timer_init();
    sound_config_timer_init();

    //put_str_ln("Initialising DMA...");
    //init_DMA();

    //put_str_ln("Initialising ADC...");
    init_ADC();

    // setup des interrupts
    INTCONSET = _INTCON_MVEC_MASK;
    __builtin_enable_interrupts();

    if (VERBOSE_PIC_STATUS)
        put_str_ln("Ready.");

    while (1)
    {
        WDTCONbits.WDTCLR = 1;  // ecrire un 1 dans ce bit force la reinitialisation du watchdog
    }
}
开发者ID:Justkog,项目名称:Autobot,代码行数:29,代码来源:main.c

示例10: kern_init

int
kern_init(void) {
    extern char edata[], end[];
    memset(edata, 0, end - edata);

    cons_init();                // init the console

    const char *message = "(THU.CST) os is loading ...";
    cprintf("%s\n\n", message);

    print_kerninfo();

    grade_backtrace();

    pic_init();                 // init interrupt controller
    idt_init();                 // init interrupt descriptor table

    pmm_init();                 // init physical memory management

    vmm_init();                 // init virtual memory management
    sched_init();               // init scheduler
    proc_init();                // init process table
    
    swap_init();                // init swap
    fs_init();                  // init fs
    
    clock_init();               // init clock interrupt
    intr_enable();              // enable irq interrupt

    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    //lab1_switch_test();
    
    cpu_idle();                 // run idle process
}
开发者ID:wwffcc,项目名称:ThuMips32,代码行数:35,代码来源:init.c

示例11: kmain

void kmain(void)
{
    //bsod();

    intr_disable();
    
    idt_init();
    pic_init();

    console_init();
    if (keyboard_init())
        goto error;

    kprintf("kernel86\n");

    intr_enable();

    shell_do();

error:
    kprintf("error");
    while (1)
        ;
    
}
开发者ID:m-rinaldi,项目名称:kboot86,代码行数:25,代码来源:kmain.c

示例12: kern_init

int __noreturn
kern_init(void) {
    extern char edata[], end[];
    memset(edata, 0, end - edata);

    cons_init();                // init the console

    const char *message = "(THU.CST) os is loading ...";
    cprintf("%s\n\n", message);

    print_kerninfo();

    pmm_init();                 // init physical memory management

    pic_init();                 // init interrupt controller
    idt_init();                 // init interrupt descriptor table

    vmm_init();                 // init virtual memory management
    sched_init();               // init scheduler
    proc_init();                // init process table
    sync_init();                // init sync struct

    ide_init();                 // init ide devices
    swap_init();                // init swap
    fs_init();                  // init fs

    clock_init();               // init clock interrupt
    intr_enable();              // enable irq interrupt

    cpu_idle();                 // run idle process
}
开发者ID:spinlock,项目名称:ucore,代码行数:31,代码来源:init.c

示例13: kernel_main

int kernel_main()
{
    /*
     * Tell the kernel memory allocator which memory it can't use.
     * It already knows not to touch kernel image.
     */
    lmm_remove_free( &malloc_lmm, (void*)USER_MEM_START, USER_MEM_SIZE );
    lmm_remove_free( &malloc_lmm, (void*)0, 0x100000 );

    /*
     * Initialize drivers here.
     */
    driver_init();
    
    /*
     * initialize the PIC so that IRQs and
     * exception handlers don't overlap in the IDT.
     */
    pic_init( BASE_IRQ_MASTER_BASE, BASE_IRQ_SLAVE_BASE );


    /* This is all up to you... */

    return -1;
}
开发者ID:shalinipriya,项目名称:Device-Drivers,代码行数:25,代码来源:kernel.c

示例14: idt_init

void idt_init() {
    memset(idt_entries, 0, sizeof(idt_entries));
    idt_ptr.base = (uint32_t)idt_entries;
    idt_ptr.limit = sizeof(idt_entries) - 1;
    pic_init();

    idt_set_entry( 0, (uint32_t)exception0 , 0x08, 0x8E);
    idt_set_entry( 1, (uint32_t)exception1 , 0x08, 0x8E);
    idt_set_entry( 2, (uint32_t)exception2 , 0x08, 0x8E);
    idt_set_entry( 3, (uint32_t)exception3 , 0x08, 0x8E);
    idt_set_entry( 4, (uint32_t)exception4 , 0x08, 0x8E);
    idt_set_entry( 5, (uint32_t)exception5 , 0x08, 0x8E);
    idt_set_entry( 6, (uint32_t)exception6 , 0x08, 0x8E);
    idt_set_entry( 7, (uint32_t)exception7 , 0x08, 0x8E);
    idt_set_entry( 8, (uint32_t)exception8 , 0x08, 0x8E);
    idt_set_entry( 9, (uint32_t)exception9 , 0x08, 0x8E);
    idt_set_entry(10, (uint32_t)exception10, 0x08, 0x8E);
    idt_set_entry(11, (uint32_t)exception11, 0x08, 0x8E);
    idt_set_entry(12, (uint32_t)exception12, 0x08, 0x8E);
    idt_set_entry(13, (uint32_t)exception13, 0x08, 0x8E);
    idt_set_entry(14, (uint32_t)exception14, 0x08, 0x8E);
    idt_set_entry(15, (uint32_t)exception15, 0x08, 0x8E);
    idt_set_entry(16, (uint32_t)exception16, 0x08, 0x8E);
    idt_set_entry(17, (uint32_t)exception17, 0x08, 0x8E);
    idt_set_entry(18, (uint32_t)exception18, 0x08, 0x8E);
    idt_set_entry(19, (uint32_t)exception19, 0x08, 0x8E);
    idt_set_entry(20, (uint32_t)exception20, 0x08, 0x8E);
    idt_set_entry(21, (uint32_t)exception21, 0x08, 0x8E);
    idt_set_entry(22, (uint32_t)exception22, 0x08, 0x8E);
    idt_set_entry(23, (uint32_t)exception23, 0x08, 0x8E);
    idt_set_entry(24, (uint32_t)exception24, 0x08, 0x8E);
    idt_set_entry(25, (uint32_t)exception25, 0x08, 0x8E);
    idt_set_entry(26, (uint32_t)exception26, 0x08, 0x8E);
    idt_set_entry(27, (uint32_t)exception27, 0x08, 0x8E);
    idt_set_entry(28, (uint32_t)exception28, 0x08, 0x8E);
    idt_set_entry(29, (uint32_t)exception29, 0x08, 0x8E);
    idt_set_entry(30, (uint32_t)exception30, 0x08, 0x8E);
    idt_set_entry(31, (uint32_t)exception31, 0x08, 0x8E);
    idt_set_entry(32, (uint32_t)irq0, 0x08, 0x8E);
    idt_set_entry(33, (uint32_t)irq1, 0x08, 0x8E);
    idt_set_entry(34, (uint32_t)irq2, 0x08, 0x8E);
    idt_set_entry(35, (uint32_t)irq3, 0x08, 0x8E);
    idt_set_entry(36, (uint32_t)irq4, 0x08, 0x8E);
    idt_set_entry(37, (uint32_t)irq5, 0x08, 0x8E);
    idt_set_entry(38, (uint32_t)irq6, 0x08, 0x8E);
    idt_set_entry(39, (uint32_t)irq7, 0x08, 0x8E);
    idt_set_entry(40, (uint32_t)irq8, 0x08, 0x8E);
    idt_set_entry(41, (uint32_t)irq9, 0x08, 0x8E);
    idt_set_entry(42, (uint32_t)irq10, 0x08, 0x8E);
    idt_set_entry(43, (uint32_t)irq11, 0x08, 0x8E);
    idt_set_entry(44, (uint32_t)irq12, 0x08, 0x8E);
    idt_set_entry(45, (uint32_t)irq13, 0x08, 0x8E);
    idt_set_entry(46, (uint32_t)irq14, 0x08, 0x8E);
    idt_set_entry(47, (uint32_t)irq15, 0x08, 0x8E);
    idt_set_entry(128, (uint32_t)exception128, 0x08, 0x8E);

    idt_flush((uint32_t)&(idt_ptr));
    asm volatile("sti");
}
开发者ID:szhou42,项目名称:osdev,代码行数:59,代码来源:idt.c

示例15: i386_init

void
i386_init(void)
{
	extern char edata[], end[];

	// Before doing anything else, complete the ELF loading process.
	// Clear the uninitialized global data (BSS) section of our program.
	// This ensures that all static/global variables start out zero.
	memset(edata, 0, end - edata);

	// Initialize the console.
	// Can't call cprintf until after we do this!
	cons_init();

	cprintf("6828 decimal is %o octal!\n", 6828);

	// Lab 2 memory management initialization functions
	i386_detect_memory();
	i386_vm_init();

	// Lab 3 user environment initialization functions
	env_init();
	idt_init();

	// Lab 4 multitasking initialization functions
	pic_init();
	kclock_init();

	time_init();
	pci_init();

	// Should always have an idle process as first one.
	ENV_CREATE(user_idle);

	// Start fs.
	ENV_CREATE(fs_fs);

#if !defined(TEST_NO_NS)
	// Start ns.
	ENV_CREATE(net_ns);
#endif

#if defined(TEST)
	// Don't touch -- used by grading script!
	ENV_CREATE2(TEST, TESTSIZE);
#else
	// Touch all you want.
	// ENV_CREATE(net_testoutput);
	// ENV_CREATE(user_echosrv);
	// ENV_CREATE(user_httpd);
  // ENV_CREATE(user_writemotd);
	// ENV_CREATE(user_testfile);
	ENV_CREATE(user_icode);
	// ENV_CREATE(user_primes);
#endif // TEST*

	// Schedule and run the first user environment!
	sched_yield();
}
开发者ID:mcorley,项目名称:jos,代码行数:59,代码来源:init.c


注:本文中的pic_init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。