diff --git a/sys/CMakeLists.txt b/sys/CMakeLists.txt index 095befe..3c22374 100644 --- a/sys/CMakeLists.txt +++ b/sys/CMakeLists.txt @@ -1,6 +1,7 @@ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") add_subdirectory(denali) +add_subdirectory(teton) add_subdirectory(victoriafalls) add_subdirectory(yellowstone) diff --git a/sys/teton/CMakeLists.txt b/sys/teton/CMakeLists.txt new file mode 100644 index 0000000..72498fa --- /dev/null +++ b/sys/teton/CMakeLists.txt @@ -0,0 +1,20 @@ +add_executable(teton + teton.cpp + ) + +target_include_directories(teton + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/include") + +target_link_libraries(teton + glacier + mammoth + yellowstone_yunq + ) + +set_target_properties(teton PROPERTIES + COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILE_FLAGS}" + LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${BASE_LINK_FLAGS}" + ) + +install(TARGETS teton) diff --git a/sys/teton/teton.cpp b/sys/teton/teton.cpp new file mode 100644 index 0000000..ac71212 --- /dev/null +++ b/sys/teton/teton.cpp @@ -0,0 +1,15 @@ +#include +#include + +uint64_t main(uint64_t init_port) { + ParseInitPort(init_port); + + dbgln("Teton Starting"); + // 1. Set up framebuffer. + + // 2. Parse a font file. + + // 3. Write a line to the screen. + + return 0; +} diff --git a/sys/victoriafalls/victoriafalls_server.cpp b/sys/victoriafalls/victoriafalls_server.cpp index 0b9f48d..815e0bd 100644 --- a/sys/victoriafalls/victoriafalls_server.cpp +++ b/sys/victoriafalls/victoriafalls_server.cpp @@ -22,14 +22,19 @@ glcr::ErrorCode VFSServer::HandleOpenFile(const OpenFileRequest& request, ASSIGN_OR_RETURN(auto files, driver_.ReadDirectory(2)); for (uint64_t i = 1; i < path_tokens.size() - 1; i++) { - for (uint64_t j = 0; j < files.size(); j++) { + bool found_token = false; + for (uint64_t j = 0; j < files.size() && !found_token; j++) { if (path_tokens.at(i) == glcr::StringView(files.at(j).name, files.at(j).name_len)) { ASSIGN_OR_RETURN(files, driver_.ReadDirectory(files.at(j).inode)); + found_token = true; } } - dbgln("Directory '{}' not found.", glcr::String(path_tokens.at(i)).cstr()); - return glcr::NOT_FOUND; + if (!found_token) { + dbgln("Directory '{}' not found.", + glcr::String(path_tokens.at(i)).cstr()); + return glcr::NOT_FOUND; + } } uint64_t inode_num; diff --git a/sys/yellowstone/yellowstone.cpp b/sys/yellowstone/yellowstone.cpp index 815e2f9..439f6e9 100644 --- a/sys/yellowstone/yellowstone.cpp +++ b/sys/yellowstone/yellowstone.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -47,6 +48,21 @@ uint64_t main(uint64_t port_cap) { glcr::String file(reinterpret_cast(filemem.vaddr()), response.size()); + glcr::Vector files = glcr::StrSplit(file, '\n'); + + for (uint64_t i = 0; i < files.size(); i++) { + if (!files[i].empty()) { + dbgln("Starting {}", files[i]); + OpenFileRequest req; + req.set_path(glcr::StrFormat("/bin/{}", files[i])); + OpenFileResponse resp; + check(vfs_client->OpenFile(req, resp)); + + ASSIGN_OR_RETURN(YellowstoneClient client3, server->CreateClient()); + check(SpawnProcess(resp.memory(), client3.Capability())); + } + } + dbgln("Test: '{}'", file.cstr()); check(server_thread.Join()); diff --git a/sysroot/bin/teton b/sysroot/bin/teton new file mode 100755 index 0000000..9f2aa4d Binary files /dev/null and b/sysroot/bin/teton differ diff --git a/sysroot/init.txt b/sysroot/init.txt index f70f10e..a6b83aa 100644 --- a/sysroot/init.txt +++ b/sysroot/init.txt @@ -1 +1 @@ -A +teton