wip: extend shared library support, window demo
This commit is contained in:
@@ -417,6 +417,8 @@ namespace Montauk {
|
||||
return Sys_UnloadLib(frame->arg1);
|
||||
case SYS_DLSYM:
|
||||
return (int64_t)Sys_DLSym(frame->arg1, frame->arg2);
|
||||
case SYS_GETLIBBASE:
|
||||
return (int64_t)Sys_GetLibBase(frame->arg1);
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -210,6 +210,7 @@ namespace Montauk {
|
||||
static constexpr uint64_t SYS_LOAD_LIB = 114;
|
||||
static constexpr uint64_t SYS_UNLOAD_LIB = 115;
|
||||
static constexpr uint64_t SYS_DLSYM = 116;
|
||||
static constexpr uint64_t SYS_GETLIBBASE = 117;
|
||||
|
||||
static constexpr uint32_t IPC_SIGNAL_READABLE = 1u << 0;
|
||||
static constexpr uint32_t IPC_SIGNAL_WRITABLE = 1u << 1;
|
||||
|
||||
@@ -270,11 +270,11 @@ namespace Sched {
|
||||
if (copyStart < copyEnd) {
|
||||
// Source: file data at (copyStart - targetSegStart) offset from p_offset
|
||||
uint64_t srcOffset = phdr->p_offset + (copyStart - targetSegStart);
|
||||
// Dest: page at (copyStart - pageStart) offset
|
||||
uint64_t dstOffset = copyStart - pageStart;
|
||||
// Dest: page at (copyStart - targetSegStart) offset, then adjusted for this page
|
||||
uint64_t pageDataOffset = copyStart - targetSegStart;
|
||||
uint64_t copySize = copyEnd - copyStart;
|
||||
|
||||
uint8_t* dst = (uint8_t*)Memory::HHDM(physAddr) + dstOffset;
|
||||
uint8_t* dst = (uint8_t*)Memory::HHDM(physAddr) + pageDataOffset;
|
||||
uint8_t* src = fileData + srcOffset;
|
||||
memcpy(dst, src, copySize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user