2023-11-25 13:08:30 -08:00
|
|
|
|
|
|
|
#include <mammoth/util/debug.h>
|
|
|
|
#include <mammoth/util/init.h>
|
2023-11-25 19:37:04 -08:00
|
|
|
#include <yellowstone/yellowstone.yunq.client.h>
|
2023-11-25 13:08:30 -08:00
|
|
|
|
|
|
|
#include "keyboard/keyboard_driver.h"
|
|
|
|
#include "voyageurs_server.h"
|
|
|
|
|
|
|
|
uint64_t main(uint64_t init_port) {
|
|
|
|
ParseInitPort(init_port);
|
|
|
|
|
|
|
|
dbgln("Initializing PS/2 Driver.");
|
|
|
|
KeyboardDriver driver;
|
|
|
|
|
|
|
|
dbgln("Starting PS/2 Thread.");
|
|
|
|
Thread keyboard_thread = driver.StartInterruptLoop();
|
|
|
|
|
|
|
|
dbgln("Starting voyaguers server.");
|
|
|
|
ASSIGN_OR_RETURN(glcr::UniquePtr<VoyageursServer> server,
|
|
|
|
VoyageursServer::Create(driver));
|
|
|
|
|
|
|
|
Thread server_thread = server->RunServer();
|
|
|
|
|
2023-11-25 19:37:04 -08:00
|
|
|
YellowstoneClient yellowstone(gInitEndpointCap);
|
|
|
|
|
|
|
|
RegisterEndpointRequest req;
|
|
|
|
req.set_endpoint_name("voyageurs");
|
|
|
|
ASSIGN_OR_RETURN(VoyageursClient client, server->CreateClient());
|
|
|
|
req.set_endpoint_capability(client.Capability());
|
|
|
|
Empty empty;
|
|
|
|
check(yellowstone.RegisterEndpoint(req, empty));
|
|
|
|
|
2023-11-25 13:08:30 -08:00
|
|
|
check(server_thread.Join());
|
|
|
|
check(keyboard_thread.Join());
|
|
|
|
|
|
|
|
return glcr::OK;
|
|
|
|
}
|