Update kernelctl syscall

This commit is contained in:
Alex 2023-04-21 18:53:09 +03:00
parent 1eb41e4977
commit 7e201e0958
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -205,6 +205,15 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t
debug("Returning memory image %#lx (%s)", (uintptr_t)lib.MemoryImage, Identifier); debug("Returning memory image %#lx (%s)", (uintptr_t)lib.MemoryImage, Identifier);
return (uintptr_t)lib.MemoryImage; return (uintptr_t)lib.MemoryImage;
} }
case KCTL_GET_FRAMEBUFFER_BUFFER:
return r_cst(uint64_t, Display->GetBuffer(0)->Buffer);
case KCTL_GET_FRAMEBUFFER_WIDTH:
return Display->GetBuffer(0)->Width;
case KCTL_GET_FRAMEBUFFER_HEIGHT:
return Display->GetBuffer(0)->Height;
case KCTL_GET_FRAMEBUFFER_SIZE:
return Display->GetBuffer(0)->Size;
default: default:
{ {
warn("KernelCTL: Unknown command: %lld", Command); warn("KernelCTL: Unknown command: %lld", Command);
@ -419,9 +428,9 @@ uintptr_t HandleNativeSyscalls(SyscallsFrame *Frame)
return SYSCALL_INTERNAL_ERROR; return SYSCALL_INTERNAL_ERROR;
} }
debug("[%#lx]->( %#lx %#lx %#lx %#lx %#lx %#lx )", // debug("[%#lx]->( %#lx %#lx %#lx %#lx %#lx %#lx )",
Frame->rax, // Frame->rax,
Frame->rdi, Frame->rsi, Frame->rdx, Frame->rcx, Frame->r8, Frame->r9); // Frame->rdi, Frame->rsi, Frame->rdx, Frame->rcx, Frame->r8, Frame->r9);
uintptr_t ret = call((uintptr_t)Frame, Frame->rdi, Frame->rsi, Frame->rdx, Frame->r10, Frame->r8, Frame->r9); uintptr_t ret = call((uintptr_t)Frame, Frame->rdi, Frame->rsi, Frame->rdx, Frame->r10, Frame->r8, Frame->r9);
Frame->rax = ret; Frame->rax = ret;