Stub FS service, we now get to main in libctru

This commit is contained in:
wheremyfoodat 2022-09-18 03:09:35 +03:00
parent 083a0d04d7
commit 91356f1de9
6 changed files with 70 additions and 4 deletions

View file

@ -12,9 +12,10 @@ namespace KernelHandles {
CurrentProcess = 0xFFFF8001, // Used by the original kernel
APT = 0xFFFF8002, // App Title something service?
HID = 0xFFFF8003, // Handles everything input-related including gyro
FS = 0xFFFF8004, // Filesystem service
MinServiceHandle = APT,
MaxServiceHandle = HID
MaxServiceHandle = FS
};
// Returns whether "handle" belongs to one of the OS services
@ -27,6 +28,7 @@ namespace KernelHandles {
switch (handle) {
case APT: return "APT";
case HID: return "HID";
case FS: return "FS";
default: return "Unknown";
}
}

18
include/services/fs.hpp Normal file
View file

@ -0,0 +1,18 @@
#pragma once
#include "helpers.hpp"
#include "kernel_types.hpp"
#include "memory.hpp"
class FSService {
Handle handle = KernelHandles::FS;
Memory& mem;
// Service commands
void initialize(u32 messagePointer);
void openArchive(u32 messagePointer);
public:
FSService(Memory& mem) : mem(mem) {}
void reset();
void handleSyncRequest(u32 messagePointer);
};

View file

@ -4,6 +4,7 @@
#include "memory.hpp"
#include "services/apt.hpp"
#include "services/hid.hpp"
#include "services/fs.hpp"
class ServiceManager {
std::array<u32, 16>& regs;
@ -11,6 +12,7 @@ class ServiceManager {
APTService apt;
HIDService hid;
FSService fs;
// "srv:" commands
void getServiceHandle(u32 messagePointer);