diff --git a/sys/yellowstone/CMakeLists.txt b/sys/yellowstone/CMakeLists.txt index 1fa51b9..22f7444 100644 --- a/sys/yellowstone/CMakeLists.txt +++ b/sys/yellowstone/CMakeLists.txt @@ -12,6 +12,7 @@ target_link_libraries(yellowstone denali_yunq mammoth glacier + victoriafalls_yunq yellowstone_yunq ) diff --git a/sys/yellowstone/yellowstone.cpp b/sys/yellowstone/yellowstone.cpp index 0fc0a7d..32d4685 100644 --- a/sys/yellowstone/yellowstone.cpp +++ b/sys/yellowstone/yellowstone.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,17 @@ uint64_t main(uint64_t port_cap) { dbgln("VFS Available."); + auto vfs_client = server->GetVFSClient(); + OpenFileRequest request; + request.set_path("/init.txt"); + OpenFileResponse response; + check(vfs_client->OpenFile(request, response)); + + MappedMemoryRegion file = + MappedMemoryRegion::FromCapability(response.memory()); + + dbgln("addr: %lu, size: %lu", file.vaddr(), file.size()); + check(server_thread.Join()); dbgln("Yellowstone Finished Successfully."); return 0; diff --git a/sys/yellowstone/yellowstone_server.cpp b/sys/yellowstone/yellowstone_server.cpp index 25de583..4cb5ea3 100644 --- a/sys/yellowstone/yellowstone_server.cpp +++ b/sys/yellowstone/yellowstone_server.cpp @@ -85,6 +85,9 @@ glcr::ErrorCode YellowstoneServer::HandleRegisterEndpoint( check(has_denali_mutex_.Release()); } else if (req.endpoint_name() == "victoriafalls") { victoria_falls_cap_ = req.endpoint_capability(); + // FIXME: Probably make a separate copy for use within yellowstone vs + // transmit to other processes. + vfs_client_ = glcr::MakeShared(victoria_falls_cap_); check(has_victoriafalls_mutex_.Release()); } else { dbgln("[WARN] Got endpoint cap type: %s", req.endpoint_name().cstr()); @@ -101,3 +104,7 @@ glcr::ErrorCode YellowstoneServer::WaitVictoriaFallsRegistered() { RET_ERR(has_victoriafalls_mutex_.Lock()); return has_victoriafalls_mutex_.Release(); } + +glcr::SharedPtr YellowstoneServer::GetVFSClient() { + return vfs_client_; +} diff --git a/sys/yellowstone/yellowstone_server.h b/sys/yellowstone/yellowstone_server.h index 06a54f6..95734a7 100644 --- a/sys/yellowstone/yellowstone_server.h +++ b/sys/yellowstone/yellowstone_server.h @@ -1,11 +1,13 @@ #pragma once +#include #include #include #include #include #include #include +#include #include "hw/pcie.h" #include "lib/yellowstone/yellowstone.yunq.server.h" @@ -22,12 +24,15 @@ class YellowstoneServer : public YellowstoneServerBase { glcr::ErrorCode WaitDenaliRegistered(); glcr::ErrorCode WaitVictoriaFallsRegistered(); + glcr::SharedPtr GetVFSClient(); + private: // TODO: Store these in a data structure. z_cap_t denali_cap_ = 0; uint64_t device_id_ = 0; uint64_t lba_offset_ = 0; z_cap_t victoria_falls_cap_ = 0; + glcr::SharedPtr vfs_client_; PciReader pci_reader_; diff --git a/sysroot/text.txt b/sysroot/init.txt similarity index 100% rename from sysroot/text.txt rename to sysroot/init.txt