1993-07-08 19:37:25 +02:00
|
|
|
static char RCSId[] = "$Id: kernel.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
|
1993-06-29 18:33:12 +02:00
|
|
|
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "prototypes.h"
|
|
|
|
|
|
|
|
extern unsigned short *Stack16Frame;
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* KERNEL_LockSegment
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
KERNEL_LockSegment(int segment)
|
|
|
|
{
|
|
|
|
if (segment == -1)
|
|
|
|
segment = *(Stack16Frame + 6);
|
|
|
|
|
|
|
|
#ifdef RELAY_DEBUG
|
1993-07-01 12:58:21 +02:00
|
|
|
printf("LockSegment: segment %x\n", segment);
|
1993-06-29 18:33:12 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return segment;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* KERNEL_UnlockSegment
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
KERNEL_UnlockSegment(int segment)
|
|
|
|
{
|
|
|
|
if (segment == -1)
|
|
|
|
segment = *(Stack16Frame + 6);
|
|
|
|
|
|
|
|
#ifdef RELAY_DEBUG
|
1993-07-01 12:58:21 +02:00
|
|
|
printf("UnlockSegment: segment %x\n", segment);
|
1993-06-29 18:33:12 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return segment;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* KERNEL_WaitEvent
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
KERNEL_WaitEvent(int task)
|
|
|
|
{
|
|
|
|
#ifdef RELAY_DEBUG
|
1993-07-01 12:58:21 +02:00
|
|
|
printf("WaitEvent: task %d\n", task);
|
1993-06-29 18:33:12 +02:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/**********************************************************************
|
|
|
|
* KERNEL_GetModuleFileName
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
KERNEL_GetModuleFileName(int module, char *filename, int bytes)
|
|
|
|
{
|
|
|
|
#ifdef RELAY_DEBUG
|
1993-07-01 12:58:21 +02:00
|
|
|
printf("GetModuleFileName: module %d, filename %x, bytes %d\n",
|
1993-06-29 18:33:12 +02:00
|
|
|
module, filename, bytes);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
strcpy(filename, "TEST.EXE");
|
|
|
|
|
|
|
|
return strlen(filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* KERNEL_DOS3Call
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
KERNEL_DOS3Call(int ax, int cx, int dx, int bx, int sp, int bp,
|
|
|
|
int si, int di, int ds, int es)
|
|
|
|
{
|
|
|
|
switch ((ax >> 8) & 0xff)
|
|
|
|
{
|
|
|
|
case 0x30:
|
|
|
|
return 0x0303;
|
|
|
|
|
|
|
|
case 0x25:
|
|
|
|
case 0x35:
|
|
|
|
return 0;
|
|
|
|
|
1993-07-08 19:37:25 +02:00
|
|
|
case 0x4c:
|
|
|
|
exit(ax & 0xff);
|
|
|
|
|
1993-06-29 18:33:12 +02:00
|
|
|
default:
|
|
|
|
fprintf(stderr, "DOS: AX %04x, BX %04x, CX %04x, DX %04x\n",
|
|
|
|
ax, bx, cx, dx);
|
|
|
|
fprintf(stderr, " SP %04x, BP %04x, SI %04x, DI %04x\n",
|
|
|
|
sp, bp, si, di);
|
|
|
|
fprintf(stderr, " DS %04x, ES %04x\n",
|
|
|
|
ds, es);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|