2023-11-22 14:39:27 -08:00
|
|
|
#include <mammoth/util/debug.h>
|
|
|
|
#include <mammoth/util/init.h>
|
2023-10-24 18:24:26 -07:00
|
|
|
#include <yellowstone/yellowstone.yunq.client.h>
|
2023-07-05 16:03:46 -07:00
|
|
|
|
2023-07-05 22:56:08 -07:00
|
|
|
#include "fs/ext2/ext2_driver.h"
|
2023-10-25 23:08:45 -07:00
|
|
|
#include "victoriafalls_server.h"
|
2023-06-22 00:22:59 -07:00
|
|
|
|
|
|
|
uint64_t main(uint64_t init_cap) {
|
|
|
|
ParseInitPort(init_cap);
|
|
|
|
|
|
|
|
dbgln("VFs Started");
|
2023-07-05 16:03:46 -07:00
|
|
|
|
2023-10-24 18:24:26 -07:00
|
|
|
YellowstoneClient yellowstone(gInitEndpointCap);
|
|
|
|
Empty empty;
|
|
|
|
DenaliInfo denali_info;
|
|
|
|
RET_ERR(yellowstone.GetDenali(empty, denali_info));
|
2023-11-15 09:47:32 -08:00
|
|
|
ASSIGN_OR_RETURN(Ext2Driver ext2, Ext2Driver::Init(denali_info));
|
2023-07-05 16:03:46 -07:00
|
|
|
|
2023-11-02 20:57:28 -07:00
|
|
|
ASSIGN_OR_RETURN(auto server, VFSServer::Create(ext2));
|
2023-10-25 23:08:45 -07:00
|
|
|
|
2023-11-02 18:55:05 -07:00
|
|
|
Thread server_thread = server->RunServer();
|
|
|
|
|
2023-10-25 23:08:45 -07:00
|
|
|
RegisterEndpointRequest req;
|
|
|
|
req.set_endpoint_name("victoriafalls");
|
|
|
|
ASSIGN_OR_RETURN(auto client, server->CreateClient());
|
|
|
|
req.set_endpoint_capability(client.Capability());
|
|
|
|
check(yellowstone.RegisterEndpoint(req, empty));
|
2023-07-05 16:03:46 -07:00
|
|
|
|
2023-11-02 18:55:05 -07:00
|
|
|
RET_ERR(server_thread.Join());
|
|
|
|
|
2023-06-22 00:22:59 -07:00
|
|
|
return 0;
|
|
|
|
}
|