acadia/sys/yellowstone/yellowstone.cpp

39 lines
939 B
C++
Raw Normal View History

2023-06-15 16:20:29 -07:00
#include <denali/denali.h>
#include <mammoth/debug.h>
#include <mammoth/endpoint_client.h>
#include <mammoth/init.h>
#include <mammoth/process.h>
#include <zcall.h>
#include "hw/gpt.h"
#include "hw/pcie.h"
2023-06-16 23:15:41 -07:00
uint64_t main(uint64_t port_cap) {
dbgln("Yellowstone Initializing.");
check(ParseInitPort(port_cap));
DumpPciEDevices();
uint64_t vaddr;
check(ZAddressSpaceMap(gSelfVmasCap, 0, gBootDenaliVmmoCap, &vaddr));
2023-06-15 16:20:29 -07:00
auto endpoint_or = SpawnProcessFromElfRegion(vaddr);
if (!endpoint_or) {
check(endpoint_or.error());
}
EndpointClient endpoint = endpoint_or.value();
DenaliClient client(endpoint);
GptReader reader(client);
check(reader.ParsePartitionTables());
check(ZAddressSpaceMap(gSelfVmasCap, 0, gBootVictoriaFallsVmmoCap, &vaddr));
auto error_or = SpawnProcessFromElfRegion(vaddr);
if (!error_or) {
check(error_or.error());
}
dbgln("Yellowstone Finished Successfully.");
return 0;
}