acadia/sys/voyageurs/voyageurs.cpp

38 lines
997 B
C++
Raw Normal View History

#include <mammoth/util/debug.h>
#include <mammoth/util/init.h>
2023-11-25 19:37:04 -08:00
#include <yellowstone/yellowstone.yunq.client.h>
#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));
check(server_thread.Join());
check(keyboard_thread.Join());
return glcr::OK;
}