connectToPort stub, acknowledge configuration memory

This commit is contained in:
wheremyfoodat 2022-09-17 02:02:45 +03:00
parent 8bb494229d
commit aa643c44bb
5 changed files with 27 additions and 1 deletions

View file

@ -54,6 +54,7 @@ set(KERNEL_SOURCE_FILES src/core/kernel/kernel.cpp src/core/kernel/resource_limi
set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/opengl.hpp include/termcolor.hpp
include/cpu.hpp include/cpu_dynarmic.hpp include/memory.hpp include/kernel/kernel.hpp
include/dynarmic_cp15.hpp include/kernel/resource_limits.hpp include/kernel/kernel_types.hpp
include/kernel/config_mem.hpp
)
set(THIRD_PARTY_SOURCE_FILES third_party/imgui/imgui.cpp

View file

@ -0,0 +1,10 @@
#pragma once
#include "helpers.hpp"
// Configuration memory addresses
namespace ConfigMem {
enum : u32 {
KernelVersionMinor = 0x1FF80002,
KernelVersionMajor = 0x1FF80003
};
}

View file

@ -59,6 +59,7 @@ class Kernel {
void getResourceLimitLimitValues();
void getResourceLimitCurrentValues();
void svcCloseHandle();
void connectToPort();
public:
Kernel(std::array<u32, 16>& regs, Memory& mem) : regs(regs), mem(mem), handleCounter(0) {

View file

@ -7,6 +7,7 @@ void Kernel::serviceSVC(u32 svc) {
case 0x01: controlMemory(); break;
case 0x21: createAddressArbiter(); break;
case 0x23: svcCloseHandle(); break;
case 0x2D: connectToPort(); break;
case 0x38: getResourceLimit(); break;
case 0x39: getResourceLimitLimitValues(); break;
case 0x3A: getResourceLimitCurrentValues(); break;
@ -64,6 +65,14 @@ void Kernel::svcCloseHandle() {
regs[0] = SVCResult::Success;
}
void Kernel::connectToPort() {
const u32 handlePointer = regs[0];
const char* port = static_cast<const char*>(mem.getReadPointer(regs[1]));
printf("ConnectToPort(handle pointer = %08X, port = \"%s\")\n", handlePointer, port);
Helpers::panic("Unimplemented IPC");
}
std::string Kernel::getProcessName(u32 pid) {
if (pid == KernelHandles::CurrentProcess) {
return "current";

View file

@ -1,6 +1,8 @@
#include "memory.hpp"
#include "config_mem.hpp"
#include <cassert>
Memory::Memory() {
fcram = new uint8_t[FCRAM_SIZE]();
readTable.resize(totalPageCount, 0);
@ -122,7 +124,10 @@ u8 Memory::read8(u32 vaddr) {
return *(u8*)(pointer + offset);
}
else {
Helpers::panic("Unimplemented 8-bit read, addr: %08X", vaddr);
switch (vaddr) {
case ConfigMem::KernelVersionMinor: return 38;
default: Helpers::panic("Unimplemented 8-bit read, addr: %08X", vaddr);
}
}
}