for (i = 0; i < size; i++) {
- if (copy_from_user(&(event.scan_code), buf + i, 1)) {
+ if (copy_from_user(&(event.scan_code), buf++, 1)) {
printk("Console Write fault\n");
return -EFAULT;
}
return -1;
}
- cons_fd = anon_inode_getfd("v3-cons", &cons_fops, cons, O_RDWR);
+ cons_fd = anon_inode_getfd("v3-cons", &cons_fops, cons, 0);
if (cons_fd < 0) {
printk("Error creating console inode\n");
#if KEYBOARD_DEBUG_80H
-static int keyboard_write_delay(ushort_t port, void * src, uint_t length, void * priv_data) {
+static int keyboard_write_delay(struct guest_info *core, ushort_t port, void * src, uint_t length, void * priv_data) {
if (length == 1) {
PrintDebug("keyboard: write of 0x%x to 80h\n", *((uint8_t*)src));