Skip to content

Commit

Permalink
Handle a keypress
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jan 20, 2024
1 parent 5d8415c commit a3d029e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,12 @@ int virtio_console_get_write_len(VIRTIODevice *s)

int virtio_console_write_data(VIRTIODevice *s, const uint8_t *buf, int buf_len)
{
//// To handle a keypress, we trigger the UART3 Interrupt.
//// TODO: Pass the keypress to VM Guest
printf("[%c]\n", buf[0]); ////
// s->int_status |= 1;
// set_irq(s->irq, 1);
#ifdef NOTUSED
int queue_idx = 0;
QueueState *qs = &s->queue[queue_idx];
int desc_idx;
Expand All @@ -1347,6 +1353,7 @@ int virtio_console_write_data(VIRTIODevice *s, const uint8_t *buf, int buf_len)
qs->last_avail_idx++;
printf("virtio_console_write_data: buf[0]=%c, buf_len=%d\n", buf[0], buf_len);////
return buf_len;
#endif // NOTUSED
}

/* send a resize event */
Expand Down

0 comments on commit a3d029e

Please sign in to comment.