void kmain(s64 magic, s64 info) { //vga_clear(COLOR_BLACK); idt_init(); isr_init(); serial_init(); set_debug_traps(); BREAKPOINT(); cpuid_print(); multiboot(magic, info); kmem_map(); page_init(); kmalloc_init(); //vesa_init(); root_init(); pci_init(); vm_init(); syscall_init(); timer_init(); kbd_init(); //mouse_init(); console_init(); create_kthread(NULL, idle_thread, THREAD_PRI_LOW, NULL, NULL); create_kthread(NULL, init_thread, THREAD_PRI_NORMAL, NULL, NULL); thread_schedule(); }
static void init(void) { /* Enable all the interrupts */ IRQ_ENABLE; /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); /* Initialize system timer */ timer_init(); /* Initialize UART1 */ ser_init(&out, SER_UART1); /* Configure UART1 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); /* Initialize LED driver */ LED_INIT(); /* Initialize the OLED display (RIT128x96) */ rit128x96_init(); /* Draw an empty Bitmap on the screen */ gfx_bitmapInit(&lcd_bitmap, raster, LCD_WIDTH, LCD_HEIGHT); /* Refresh the display */ rit128x96_blitBitmap(&lcd_bitmap); /* Initialize the keypad driver */ kbd_init(); /* Initialize the internal flash memory */ flash_init(&flash, 0); /* * Kernel initialization: processes (allow to create and dispatch * processes using proc_new()). */ proc_init(); }
static void init(void) { /* Enable all the interrupts */ IRQ_ENABLE; /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); /* Initialize LED driver */ LED_INIT(); /* Initialize system timer */ timer_init(); /* * Kernel initialization: processes (allow to create and dispatch * processes using proc_new()). */ proc_init(); /* Init spi on dma to drive lcd */ spi_dma_init(&spi); spi_dma_setclock(LCD_SPICLOCK); /* Initialize the dispaly */ lcd_ili9225_init(&spi.fd); /* Init the backligth display leds */ LCD_BACKLIGHT_INIT(); lcd_setBacklight(LCD_BACKLIGHT_MAX); /* Draw an empty Bitmap on the screen */ gfx_bitmapInit(&lcd_bitmap, raster, LCD_WIDTH, LCD_HEIGHT); /* Refresh the display */ lcd_ili9225_blitBitmap(&lcd_bitmap); /* Initialize the keypad driver */ kbd_init(); }
//main function, execution starts here main() { int i = 0; vid_init();//initialize video printf("MTX starts in main()\n"); init(); // initialize and create P0 as running set_vector(80, int80h); kfork("/bin/u1"); // P0 kfork() P1 set_vector(9, kbinth); kbd_init(); //timer init lock(); set_vector(8,tinth); timer_init(); while(1) { unlock(); if(readyQueue) tswitch(); else halt(); } }
int cbm2_kbd_init(void) { kbd_default_keymap(&CBM2keys); kbd_init_keymap(2); kbd_add_keymap(&CBM2keys, 0); kbd_add_keymap(&CBM2keys, 1); kbd_load_keymap(NULL, 0); return kbd_init(); }
int main(void) { vga_init(); kbd_init(); cls(); run_shell(); return (0); }
/* cons_init - initializes the console devices */ void cons_init(void) { serial_init(); if (!serial_exists) { cprintf("serial port does not exist!!\n"); } kbd_init(); }
// initialize the console devices void cons_init(void) { cga_init(); kbd_init(); // cons.rpos = 0; // cons.wpos = 0; }//cons_init()
/* cons_init - initializes the console devices */ void cons_init(void) { cga_init(); serial_init(); kbd_init(); if (!serial_exists) { kprintf("serial port does not exist!!\n"); } }
// initialize the console devices void console_initialize(void) { cga_init(); kbd_init(); serial_init(); if (!serial_exists) cprintf("Serial port does not exist!\n"); }
int main(int argc, char *argv[]) { //>>>>>>>>>> carregament da codepage <<<<<<<<<< load_char_table(codepage); //>>>>>>>>>> init kbc <<<<<<<<< Bool mouse_detected = kbc_init(0); //>>>>>>>>>> init kbd <<<<<<<<<< kbd_init(); //>>>>>>>>>> init mouse <<<<<<<<<< if (mouse_detected == true) mouse_init((int) 0); //>>>>>>>>>> init rtc <<<<<<<<<< rtc_init(); drawDate(); drawTime(); drawCounter(); //>>>>>>>>>> init timer <<<<<<<<<< timer0_init(); timer_init(TIMER_2, LSBMSB | MODE3); //################# menu_start(); //################# //>>>>>>>>>> restore kbd isr <<<<<<<<<< restore_keyboard_isr(); //>>>>>>>>>> restore mouse isr <<<<<<<<<< if (mouse_detected == true) restore_mouse_isr(); //>>>>>>>>>> restore rtc isr <<<<<<<<<< restore_rtc_isr(); //>>>>>>>>>> init timer isr <<<<<<<<<< restore_timer0(); return 0; }
static void init(void) { IRQ_ENABLE; kdbg_init(); timer_init(); kbd_init(); proc_init(); PIOA_CODR = LEDR | LEDG | BUZZER_BIT | CUTOFF_PIN | LAND_PIN; PIOA_OER = LEDR | LEDG | BUZZER_BIT | CUTOFF_PIN | LAND_PIN; }
// initialize the console devices void cons_init(void) { if (!cpu_onboot()) // only do once, on the boot CPU return; video_init(); kbd_init(); serial_init(); if (!serial_exists) warn("Serial port does not exist!\n"); }
int init() { int i, j; kbd_init(); for (i = 0; i < 8; i++) for (j = 0; j < 8; j++) { if (mat[i][j] = rand() % 2) ++dots; } tube_show(0); dot_show(mat); return 0; }
/******************************************************************** * Arduino風: 初期化処理 ******************************************************************** */ static inline void setup() { DDPCONbits.JTAGEN=0; // PORTA is used as digital instead of JTAG io_setDigital(); // Analog から Digital I/Oに切り替えます. io_setRemap(); // RA4/RB4 をUARTに割り当てます. mInitAllLEDs(); kbd_init(); // : 初期化 NTSC_init(); // NTSC 表示初期化. // UART1 初期化 (NTSC_initのあと) SerialConfigure(UART1, UART_ENABLE, UART_RX_TX_ENABLED, BAUDRATE); Eint(); // 割り込み許可. gr_test(); // グラフィックテスト. }
/*---------------------------------------------------------------------------*/ usys pc_kbd_init (void) { if (kbd_init () != GOOD) { printf ("ERR: kbd_init() Failed !!!\n") ; return BAD ; } /* Set-up the Keyboard ISR */ int_config (0x21, ENABLE, pc_kbd_isr) ; return GOOD ; } /* End of Function pc_kbd_init () */
void adb_init( void ) { kbd_init(); mouse_init(); /* Export mouse/keyboard interface */ if( !gPE.adb_key_event ) gPE.adb_key_event = adb_key; if( !gPE.mouse_event ) gPE.mouse_event = adb_mouse_event; session_save_proc( NULL, prepare_save, kDynamicChunk ); }
/******************************************************************** * 初期化関数 ******************************************************************** */ static void InitializeSystem(void) { #if RAM_SERIAL extern void set_serial_number(void); set_serial_number(); #endif #if defined(__18F14K50) // 入力ピンをデジタルモードにする. ANSEL=0; ANSELH=0; #endif ADCON1 = 0x0F; //Need to make sure RB4 can be used as a digital input pin #if 1 // HIDaspx , PICwriter用 portb,portcを全入力にする. TRISB = 0xFF; TRISC = 0xFF; #endif #if defined(USE_USB_BUS_SENSE_IO) tris_usb_bus_sense = INPUT_PIN; #endif #if defined(USE_SELF_POWER_SENSE_IO) tris_self_power = INPUT_PIN; #endif mInitializeUSBDriver(); UserInit(); #if USE_PS2KEYBOARD // PS/2キーボードI/F を使用する. kbd_init(); #endif #if TIMER2_INTERRUPT // timer2_init(0x80 |(15<<3)| 2,255); // 割り込みON,postscale 1/16,prescale 1/16,1/256 = 183.10 H // timer2_init(0x80 |(14<<3)| 2,249); // 割り込みON,postscale 1/15,prescale 1/16,1/250 = 200Hz // timer2_init(0x80 |(14<<3)| 2, 49); // 割り込みON,postscale 1/15,prescale 1/16,1/50 = 1000Hz timer2_init(0x80 |(14<<3)| 2, 4); // 割り込みON,postscale 1/15,prescale 1/16,1/5 = 10kHz // 割り込み許可. InitTimer2InterruptLow(); // Timer2割り込みを low Priorityに設定する. #else INTCONbits.GIEL = 0; // Low Priority 割り込みを禁止. INTCONbits.GIEH = 0; // High Priority 割り込みを禁止. #endif }
void main() { char c; kbd_init(); //inizializo drivers teclado PORT_B_PULLUPS(TRUE); //Activan resistencias de pull-up while(true) { c = kbd_getc(); if(c != 0 )//si se ha pulsado una tecla { putc(c);//Envía el caracter vía serie por la USART del PIC delay_us(100); //Pausa de 1 s. } } }
static void init(void) { /* Enable all the interrupts */ IRQ_ENABLE; /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); /* Initialize system timer */ timer_init(); /* Initialize LED driver */ LED_INIT(); /* Enable the WAKE_UP button */ kbd_init(); /* Initialize the USB mouse device */ usbmouse_init(0); }
int main() { unsigned char c; kbd_init(); lcd_init(LCD_DISP_ON); while(1) { while(c = kbd_getchar()) lcd_putc(c); } return 0; }
// initialize the console devices void cons_init(void) { if (!cpu_onboot()) // only do once, on the boot CPU return; spinlock_init(&cons_lock); video_init(); kbd_init(); serial_init(); cons_out_pos = 0; if (!serial_exists) warn("Serial port does not exist!\n"); }
static void kbd_exercise(cyg_addrword_t p) { cyg_uint8 ch; diag_printf("KBD test here!\n"); // Initialize keyboard driver kbd_init(); while (TRUE) { ch = kbd_getc(); diag_printf("CH = 0x%x:'%c'\n", ch, ch); } diag_printf("All done!\n"); cyg_test_exit(); }
void ps2_main(void){ m_state = STA_WAIT_RESET; kbd_init(); keymap_init(); clear(); //set key repeat speed; uint8_t gSpeed = eeprom_read_byte((uint8_t *)EEPROM_PS2_REPEAT_SPEED); if(gSpeed == 0xFF) gSpeed = 1; if(ps2_repeat_speed == PS2_REPEAT_SPEED_NONE){ ps2_repeat_speed = gSpeed; }else if(ps2_repeat_speed != gSpeed){ eeprom_write_byte((uint8_t *)EEPROM_PS2_REPEAT_SPEED, ps2_repeat_speed); } // init setKeyScanDriver(&driverKeyScanPs2); setUpdateDriver(&updatePs2); clearMatrix(); // DEBUG_PRINT(("STARTING PS/2 KEYBOARD\n")); sei(); // DBG1(0x90, 0, 0); for(;;){ // 카운트 이내에 신호가 잡히지 않으면 이동; // 특별한 경우에만 발생하는 현상이다. if(INTERFACE == INTERFACE_PS2 && interfaceReady == false && interfaceCount++ > 1000){ // move to usb INTERFACE = INTERFACE_USB; DBG1(0x99, 0, 0); break; } processRxPs2(); processTxPs2(); } // DBG1(0x9F, 0, 0); }
void initstuff(void) { win_openwindow("Map Editor V1.26", NULL); win_setmousemode(MOUSE_ALWAYS_HIDDEN); win_fullscreen = 1; setscreenmode(); kbd_init(); mou_init(); if (!gfx_loadsprites(SPR_FONTS, "fonts.spr")) { win_messagebox("Sprite load error (FONTS.SPR)"); exit(1); } if (!gfx_loadsprites(SPR_EDITOR, "editor.spr")) { win_messagebox("Sprite load error (FONTS.SPR)"); exit(1); } io_setfilemode(0); /* Rest of file access happens without datafile */ }
int _GrEventInit(void) { char *s; kbd_init(); if (GrMouseDetect()) { mou_buttons = 0; } s = getenv("LANG"); if (strstr(s,"UTF-8")) kbsysencoding = GRENC_UTF_8; else { s = getenv("MGRXKBSYSENCODING"); if (s != NULL) kbsysencoding = GrFindEncoding(s); if (kbsysencoding < 0) kbsysencoding = GRENC_ISO_8859_1; } return 1; }
main() { char m; vid_init(); printf("MTX starts in main()\n"); init(); // initialize and create P0 as running set_vector(80, int80h); set_vector(12, s0inth); // vector 12 for COM1 set_vector(11, s1inth); // vector 11 for COM2 sinit(); set_vector(9, kbinth); kbd_init(); lock(); set_vector(8, tinth); timer_init(); mode = LIVE; //used for demoing the time working, set to DEMO to see four procs switch by themselves kfork("/bin/u1"); // P0 kfork() P1 if(mode == DEMO) { kfork("/bin/u1"); kfork("/bin/u1"); kfork("/bin/u1"); } while(1){ //printf("P0 running\n"); while(!readyQueue); //printf("P0 switch process\n"); running->status = READY; tswitch(); // P0 switch to run P1 } }
static int _ReadCharFromKeyboard(void) { int key = EOF; if (!kbd_initted) { kbd_init(); } if (!kbd_isatty) { return (getc(stdin)); } do { if (_lnxfb_waiting_to_switch_console) _LnxfbSwitchConsoleAndWait(); if (kbd_lastchr != EOF) { key = kbd_lastchr; kbd_lastchr = EOF; break; } if (kbd_mode == test) { /* we're in test mode. Look for key without mode switch ... */ _CheckKeyboardHit(); if (kbd_lastchr != EOF) { key = kbd_lastchr; kbd_lastchr = EOF; break; } } /* no key till now. Wait of it ... */ if (kbd_mode != wait) { kbd_setup.c_cc[VMIN] = 0; kbd_setup.c_cc[VTIME] = 1; if (ioctl(kbd_filedsc, TCSETAW, &kbd_setup) == EOF) return (EOF); kbd_mode = wait; } if ((key = inkey()) != EOF) break; } while (1); return validKey(key, GrKey_OutsideValidRange); }
void initstuff(void) { FILE *handle; win_openwindow("Block-info Editor V1.26", NULL); win_fullscreen = 1; win_setmousemode(MOUSE_ALWAYS_HIDDEN); setscreenmode(); kbd_init(); mou_init(); if (!gfx_loadsprites(SPR_FONTS, "fonts.spr")) { win_messagebox("Sprite load error (FONTS.SPR)"); exit(1); } if (!gfx_loadsprites(SPR_EDITOR, "editor.spr")) { win_messagebox("Sprite load error (EDITOR.SPR)"); exit(1); } blkinfdata = malloc((MAXBLOCKS+1)*16); if (!blkinfdata) { win_messagebox("No memory for blockinfotable!"); exit(1); } memset(blkinfdata, 0, (MAXBLOCKS+1)*16); io_setfilemode(0); // Rest of file access happens without datafile gfx_loadblocks(blkname); gfx_loadpalette(palname); gfx_calcpalette(64,0,0,0); gfx_setpalette(); handle = fopen(infname, "rb"); if (!handle) return; fread(&blkinfdata[0], (gfx_nblocks+1) * 16, 1, handle); fclose(handle); }
void interface_init(void) { // Running at new code address - do code relocation fixups malloc_init(); // Setup romfile items. qemu_cfg_init(); coreboot_cbfs_init(); // Setup ivt/bda/ebda ivt_init(); bda_init(); // Other interfaces boot_init(); bios32_init(); pmm_init(); pnp_init(); kbd_init(); mouse_init(); }