[orbis-kernel] chroot bugfixes

reduce log spam
increase count of gcm buffers
This commit is contained in:
DH 2023-11-11 22:12:07 +03:00
parent 1f001101a4
commit e9dfaf2573
12 changed files with 60 additions and 27 deletions

View file

@ -659,7 +659,8 @@ SysResult sys_opmc_set_ctr(Thread *thread /* TODO */);
SysResult sys_opmc_get_ctr(Thread *thread /* TODO */);
SysResult sys_budget_create(Thread *thread /* TODO */);
SysResult sys_budget_delete(Thread *thread /* TODO */);
SysResult sys_budget_get(Thread *thread /* TODO */);
SysResult sys_budget_get(Thread *thread, sint id, ptr<void> a,
ptr<uint32_t> count);
SysResult sys_budget_set(Thread *thread, slong budget);
SysResult sys_virtual_query(Thread *thread, ptr<void> addr, uint64_t unk,
ptr<void> info, size_t infosz);

View file

@ -60,6 +60,7 @@ struct Process final {
kstring cwd;
kstring root = "/";
sint memoryContainer{1};
sint budgetId{1};
bool isInSandbox = false;
std::uint64_t nextTlsSlot = 1;

View file

@ -30,7 +30,7 @@ orbis::SysResult orbis::sys_fcntl(Thread *thread, sint fd, sint cmd,
return {};
}
orbis::SysResult orbis::sys_close(Thread *thread, sint fd) {
ORBIS_LOG_NOTICE(__FUNCTION__, fd);
// ORBIS_LOG_NOTICE(__FUNCTION__, fd);
if (thread->tproc->fileDescriptors.close(fd)) {
return {};
}

View file

@ -629,8 +629,9 @@ orbis::SysResult orbis::sys_budget_create(Thread *thread /* TODO */) {
orbis::SysResult orbis::sys_budget_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_budget_get(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
orbis::SysResult orbis::sys_budget_get(Thread *thread, sint id, ptr<void> a,
ptr<uint32_t> count) {
return {};
}
orbis::SysResult orbis::sys_budget_set(Thread *thread, slong budget) {
ORBIS_LOG_TODO(__FUNCTION__, budget);
@ -1013,11 +1014,11 @@ orbis::sys_dynlib_get_info_ex(Thread *thread, SceKernelModule handle,
return uwrite(destModuleInfoEx, result);
}
orbis::SysResult orbis::sys_budget_getid(Thread *thread) {
thread->retval[0] = 1;
thread->retval[0] = thread->tproc->budgetId;
return {};
}
orbis::SysResult orbis::sys_budget_get_ptype(Thread *thread, sint budgetId) {
thread->retval[0] = 1;
thread->retval[0] = budgetId;
return {};
}
orbis::SysResult

View file

@ -49,6 +49,10 @@ orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
enum sysctl_machdep_liverpool { telemetry = 1000, icc_max };
struct ProcInfo {
char data[0x448];
};
// for (unsigned int i = 0; i < namelen; ++i) {
// std::fprintf(stderr, " name[%u] = %u\n", i, name[i]);
// }
@ -83,12 +87,8 @@ orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
if (name[0] == kern && name[1] == 14 && name[2] == 8) {
// KERN_PROC_PROC
struct ProcInfo {
char data[0x448];
};
*oldlenp = 0;
std::memset(old, 0, sizeof(ProcInfo));
*oldlenp = sizeof(ProcInfo);
return {};
}
@ -120,6 +120,12 @@ orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
}
if (namelen == 4) {
if (name[0] == kern && name[1] == 14 && name[2] == 1) {
std::memset(old, 0, sizeof(ProcInfo));
*oldlenp = sizeof(ProcInfo);
return {};
}
if (name[0] == 1 && name[1] == 14 && name[2] == 35) {
// AppInfo get/set
@ -129,7 +135,8 @@ orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
if (process->pid != name[3] && name[3] != -1) {
process = g_context.findProcessById(name[3]);
if (process == nullptr) {
ORBIS_LOG_ERROR("appinfo process not found", name[3], thread->tproc->pid);
ORBIS_LOG_ERROR("appinfo process not found", name[3],
thread->tproc->pid);
return ErrorCode::SRCH;
}
}
@ -164,8 +171,8 @@ orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
auto &appInfo = process->appInfo;
ORBIS_LOG_ERROR("set AppInfo", appInfo.appId, appInfo.unk0,
appInfo.unk1, appInfo.appType, appInfo.titleId,
appInfo.unk2, appInfo.unk3, appInfo.unk5, appInfo.unk6,
appInfo.unk7, appInfo.unk8);
appInfo.unk2, appInfo.unk3, appInfo.unk5,
appInfo.unk6, appInfo.unk7, appInfo.unk8);
// HACK
if (appInfo.appId == 0 && appInfo.unk4 == 0) {

View file

@ -44,7 +44,7 @@ orbis::SysResult orbis::sys_open(Thread *thread, ptr<char> path, sint flags,
auto fd = thread->tproc->fileDescriptors.insert(file);
thread->retval[0] = fd;
ORBIS_LOG_NOTICE(__FUNCTION__, path, flags, mode, fd);
// ORBIS_LOG_NOTICE(__FUNCTION__, path, flags, mode, fd);
return {};
}
@ -208,7 +208,7 @@ orbis::SysResult orbis::sys_lpathconf(Thread *thread, ptr<char> path,
}
orbis::SysResult orbis::sys_readlink(Thread *thread, ptr<char> path,
ptr<char> buf, size_t count) {
return ErrorCode::NOSYS;
return ErrorCode::INVAL;
}
orbis::SysResult orbis::sys_readlinkat(Thread *thread, sint fd, ptr<char> path,
ptr<char> buf, size_t bufsize) {