예제 #1
0
파일: interrupt.c 프로젝트: frankicia/zeOS
void RSI_KEYBOARD(){
	unsigned char key = inb(0x60);
	unsigned char mask = 0b10000000;
	unsigned char make = key & mask;
	char c = '0';
	if(make == 0) {
		mask = 0b01111111;
		c = char_map[key & mask];
		if(!(c>=0x20 && c<=0x7E))
			c = 'C';

		cbWrite(&keybuffer, &c);

		//MIRAR
		if (!(cbIsFull(&keybuffer) && list_empty(&keyboardqueue))) {
		
			if(!list_empty(&keyboardqueue)) {
				struct list_head * to_unblock;
				struct task_struct * pcb_to_unlock;
				
				to_unblock = list_first(&keyboardqueue);
				pcb_to_unlock = list_head_to_task_struct(to_unblock);
				
				if ((cbIsFull(&keybuffer) || pcb_to_unlock->characters_left <= cbCount(&keybuffer))) {
						list_del(to_unblock);
						list_add_tail(to_unblock, &readyqueue);
				}
			}
		}
	}
	else
		c = ' ';
		
	printc_xy(0x3f, 0x15, c);
}
예제 #2
0
void keyboard_routine(){
  unsigned char key = inb(0x60);
  int mob = key & 0x80;

  if(!mob){
    key = key & 0x7F;	

    key = char_map[key] == '\0' ? 'C' : char_map[key];
    printc_xy(65,3, key);
  }
}
예제 #3
0
파일: interrupt.c 프로젝트: poinu/ZeOS
void keyboard_routine(void) {
  char c = inb(0x60); /* Read from port 0x60 into c */
  char press = !(c & 0x80); /* First bit indicates whether pressed or released */
  if (press) {
    c = char_map[c & 0x7f];
    if (c != '\0')printc_xy(0, 0, c);
    else printc_xy(0, 0, 'C');

    cb_write(&keyboard_buffer, &c, 1);

    if (remaining_characters > 0) {				/* Some process is waiting */
      if (cb_size(&keyboard_buffer) >= remaining_characters)	/* Buffer holds enough characters */
        unblock(&blocked);
      else if (cb_full(&keyboard_buffer))			/* Buffer doesn't hold enough characters but is full */
        unblock(&blocked);
    }
    else if (cb_full(&keyboard_buffer))				/* No process is waiting and buffer is full */
      cb_overwrite(&keyboard_buffer, &c, 1);
  }
}
예제 #4
0
파일: interrupt.c 프로젝트: wwjnc/zeos
void keyboard_routine()
{
	unsigned char key = inb(PORT_PS2_DATA);
	if ((key & 0x80) == 0)
	{
		// Show character on screen
		char c = char_map[key & 0x7f];
		printc_xy(0, 0, (c != '\0' ? c : 'C'));

		// Send keypress to tasks if needed
		keyboard_key_pressed(c);
	}
}
예제 #5
0
void keyboard_routine() {
user_to_system(&(current()->st));
 unsigned char c,d,res;
 c = inb(0x60);
 d=0x80;
 Byte b=24;
 res=d&c;
 if (res == 0){
	c = 0x7F&c;
	c=char_map[c];
	printc_xy(b,b,c);
}
system_to_user(&(current()->st));
}
예제 #6
0
파일: interrupt.c 프로젝트: cvivas/Zeos
void keyboard_routine(){

unsigned char codi = inb(0x60);
  unsigned char caracter;
  int make = (codi&0x80)>>7;
   
if (make == 0)
    {

      caracter=char_map[codi&0x7F];
	if (caracter != '\0') {
	  printk_xy(73,24,"      ");
	  printc_xy(79,24,caracter);
	}	  
 	else {
	
 	  printk_xy(73,24,"control");
	
 	}
}



}
예제 #7
0
파일: interrupt.c 프로젝트: BugMan42/Zeos
// function for printing the key pressed
void print_key(char key) {
  printc_xy(0, 0, key);
}