Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2018
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. static inline uint8_t inb(uint16_t port)
  2. {
  3. uint8_t ret;
  4. asm volatile ( "inb %1, %0"
  5. : "=a"(ret)
  6. : "Nd"(port) );
  7. return ret;
  8. }
  9. unsigned char kbdus[128] =
  10. {
  11. 0,0,'1','2','3','4','5','6','7','8','9','0','-','=','\b','\t','q','w','e','r','t','y','u','i','o','p','[',']','\n',0,'a','s','d','f','g','h','j','k','l',';','\'','`',0,'\\','z','x','c','v','b','n','m',',','.','/',0,'*',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  12. };
  13. void keyboard_handler(struct regs *r)
  14. {
  15. unsigned char scancode;
  16. scancode = inb(0x60);
  17. if (scancode & 0x80)
  18. {
  19.  
  20. }
  21. else
  22. {
  23. if (terminal)
  24. terminal_putchar(kbdus[scancode]);
  25. }
  26. cmdchar(kbdus[scancode]);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement