I have recently somehow broke my system calls.
The problem is that by some reason, parameters do not pass to requested function properly anymore.
Code: Select all
void Reserved()
{
puts("This system call is reserved for future, and thus could not be used.\n");
}
void* sfunc[]=
{
Reserved,Reserved,putc,puts,OpenFile,Reserved,ReadFile,Reserved,Reserved,Reserved,Reserved,Reserved,sleep,getch,Reserved,Reserved,Reserved
};
__declspec(naked) void SystemCallIrq()
{
static uint16 no;
_asm mov [no], bx
if(no>16)_asm iretd
static void* callsy=sfunc[no];
_asm
{
push edi
push esi
push edx
push ecx
push ebx
push eax
call callsy
add esp, 24
iretd
}
}
Because this is an interrupt, to not corrupt any previously ran code I return stack by 6 entries.
Anywhooo?