/* tej - changed return type to void as nothing returned */ static void InitMFS(void) { FAR_PTR LOL; FAR_PTR SDA; unsigned char _osmajor; unsigned char _osminor; state_t preg; LOL = GetListOfLists(); SDA = GetSDAPointer(); /* now get the DOS version */ pre_msdos(); HI(ax) = 0x30; call_msdos(); _osmajor = LO(ax); _osminor = HI(ax); post_msdos(); /* get DOS version into CX */ preg.ecx = _osmajor | (_osminor <<8); preg.edx = FP_OFF16(LOL); preg.es = FP_SEG16(LOL); preg.esi = FP_OFF16(SDA); preg.ds = FP_SEG16(SDA); preg.ebx = 0x500; mfs_helper(&preg); }
int com_dosgetdrive(void) { int ret; pre_msdos(); HI(ax) = 0x19; call_msdos(); /* call MSDOS */ ret = LO(ax); /* 0=A, 1=B, ... */ post_msdos(); return ret; }
int com_dossetdrive(int drive) { int ret; pre_msdos(); HI(ax) = 0x0e; LO(dx) = drive; /* 0=A, 1=B, ... */ call_msdos(); /* call MSDOS */ ret = LO(ax); /* number of available logical drives */ post_msdos(); return ret; }
int com_dosfreemem(u_short para) { int ret = 0; pre_msdos(); HI(ax) = 0x49; SREG(es) = para; call_msdos(); if (REG(eflags) & CF) ret = -1; post_msdos(); return ret; }
int com_dosallocmem(u_short para) { int ret; pre_msdos(); HI(ax) = 0x48; LWORD(ebx) = para; call_msdos(); if (REG(eflags) & CF) ret = 0; else ret = LWORD(eax); post_msdos(); return ret; }
int com_dossetcurrentdir(char *path) { /*struct com_starter_seg *ctcb = owntcb->params;*/ char *s = com_strdup(path); com_errno = 8; if (!s) return -1; pre_msdos(); HI(ax) = 0x3b; SREG(ds) = DOSEMU_LMHEAP_SEG; LWORD(edx) = DOSEMU_LMHEAP_OFFS_OF(s); call_msdos(); /* call MSDOS */ com_strfree(s); if (LWORD(eflags) & CF) { post_msdos(); return -1; } post_msdos(); return 0; }