Skip to content

Commit

Permalink
Add USB keyboard implementation, albeit untested
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Dec 11, 2024
1 parent d5e1a85 commit 75d947d
Show file tree
Hide file tree
Showing 5 changed files with 968 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/usb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
add_library(usb usb_hid.c usb_uhci_bochs.c usb_ohci_bochs.c usb_common.c)
add_library(usb usb_hid.c usb_hid_keyboard.c usb_uhci_bochs.c usb_ohci_bochs.c usb_common.c)
2 changes: 2 additions & 0 deletions src/usb/usb_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,7 @@ bool usb_device_get_halted(usb_device_c* device, int ep);
int usb_set_usb_string(uint8_t *buf, const char *str);
/* Get maximum packet size the device can handle for an endpoint. */
int usb_device_get_mps(usb_device_c* device, const int ep);
/* Events to send to the host controller. */
extern int usb_device_hc_event(usb_device_c* host, int event, usb_device_c *device);

#endif
4 changes: 4 additions & 0 deletions src/usb/usb_hid.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* TODO: Investigate properly what the SGI 320 firmware expects after receiving a NAK.
Maybe wakeup interrupts? In that case it'd require changing polling to be emulator-driven.
*/

#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
Expand Down
Loading

0 comments on commit 75d947d

Please sign in to comment.