[Yellowstone] Try to spawn the teton process from disk.
This commit is contained in:
parent
9e05b3b3dd
commit
0e99189dba
|
@ -1,6 +1,7 @@
|
||||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
||||||
|
|
||||||
add_subdirectory(denali)
|
add_subdirectory(denali)
|
||||||
|
add_subdirectory(teton)
|
||||||
add_subdirectory(victoriafalls)
|
add_subdirectory(victoriafalls)
|
||||||
add_subdirectory(yellowstone)
|
add_subdirectory(yellowstone)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include <mammoth/debug.h>
|
||||||
|
#include <mammoth/init.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
|
@ -22,14 +22,19 @@ glcr::ErrorCode VFSServer::HandleOpenFile(const OpenFileRequest& request,
|
||||||
|
|
||||||
ASSIGN_OR_RETURN(auto files, driver_.ReadDirectory(2));
|
ASSIGN_OR_RETURN(auto files, driver_.ReadDirectory(2));
|
||||||
for (uint64_t i = 1; i < path_tokens.size() - 1; i++) {
|
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) ==
|
if (path_tokens.at(i) ==
|
||||||
glcr::StringView(files.at(j).name, files.at(j).name_len)) {
|
glcr::StringView(files.at(j).name, files.at(j).name_len)) {
|
||||||
ASSIGN_OR_RETURN(files, driver_.ReadDirectory(files.at(j).inode));
|
ASSIGN_OR_RETURN(files, driver_.ReadDirectory(files.at(j).inode));
|
||||||
|
found_token = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dbgln("Directory '{}' not found.", glcr::String(path_tokens.at(i)).cstr());
|
if (!found_token) {
|
||||||
return glcr::NOT_FOUND;
|
dbgln("Directory '{}' not found.",
|
||||||
|
glcr::String(path_tokens.at(i)).cstr());
|
||||||
|
return glcr::NOT_FOUND;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t inode_num;
|
uint64_t inode_num;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <glacier/string/str_format.h>
|
#include <glacier/string/str_format.h>
|
||||||
|
#include <glacier/string/str_split.h>
|
||||||
#include <mammoth/debug.h>
|
#include <mammoth/debug.h>
|
||||||
#include <mammoth/endpoint_client.h>
|
#include <mammoth/endpoint_client.h>
|
||||||
#include <mammoth/init.h>
|
#include <mammoth/init.h>
|
||||||
|
@ -47,6 +48,21 @@ uint64_t main(uint64_t port_cap) {
|
||||||
glcr::String file(reinterpret_cast<const char*>(filemem.vaddr()),
|
glcr::String file(reinterpret_cast<const char*>(filemem.vaddr()),
|
||||||
response.size());
|
response.size());
|
||||||
|
|
||||||
|
glcr::Vector<glcr::StringView> 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());
|
dbgln("Test: '{}'", file.cstr());
|
||||||
|
|
||||||
check(server_thread.Join());
|
check(server_thread.Join());
|
||||||
|
|
Binary file not shown.
|
@ -1 +1 @@
|
||||||
A
|
teton
|
||||||
|
|
Loading…
Reference in New Issue