Crash in memmove function
Posted: Wed Sep 28, 2022 11:36 pm
Hi everyone,
It ís me again .
I have an issue with memmove function. When my OS run into memmove function. Everything works correctly if there is no interrupt happened. If there is interrupt happened, when the memmove's thread back, it raises exception General Protection. The context is saved correctly. Please help
It ís me again .
I have an issue with memmove function. When my OS run into memmove function. Everything works correctly if there is no interrupt happened. If there is interrupt happened, when the memmove's thread back, it raises exception General Protection. The context is saved correctly. Please help
void* memmove(void* des, void* src, size_t size)
{
size_t numq = size >> 3;
size_t numb = size & 0b111;
if (des < src)
{
uint64 *qdes = (uint64*)des;
uint64 *qsrc = (uint64*)src;
for (size_t i = 0; i < numq; ++i)
{
qdes = qsrc;
// printf(" %d ", i);
}
uint8 *bdes = (uint8*)(des + numq * ;
uint8 *bsrc = (uint8*)(src + numq * ;
for (size_t i = 0; i < numb; ++i)
{
bdes = bsrc;
}
}
return des;
}