/programs/develop/libraries/menuetlibc/src/libc/dos/dos/Makefile |
---|
0,0 → 1,6 |
THIS_SRCS = bdos.c bdosptr.s delay.c fexistp.c getcbrk.c getdate.c getdfree.c \ |
getdinfo.c getdos_v.c getftime.c gettime.c gettimeo.c \ |
osflavor.c osmajor.c osminor.c remotdrv.c \ |
remothdl.c setcbrk.c setdate.c setftime.c settime.c |
include $(MENUET_LIBC_TOPDIR)/Make.rules |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/bdos.c |
---|
0,0 → 1,8 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <assert.h> |
int bdos(int func, unsigned dx, unsigned al) |
{ |
unimpl(); |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/bdosptr.s |
---|
0,0 → 1,5 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include<libc/asm.h> |
MK_C_SYM(bdosptr) |
jmp C_SYM(bdos) |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/delay.c |
---|
0,0 → 1,8 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <menuet/os.h> |
void delay(unsigned msec) |
{ |
__menuet__delay100(msec); |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/fexistp.c |
---|
0,0 → 1,14 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <unistd.h> |
#include <errno.h> |
#include <io.h> |
#include <stdio.h> |
int __file_exists(const char *fn) |
{ |
FILE * f; |
f=fopen(fn,"r"); |
if(!f) return 0; |
fclose(f); |
return 1; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/getcbrk.c |
---|
0,0 → 1,8 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <assert.h> |
int getcbrk(void) |
{ |
return 0; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/getdate.c |
---|
0,0 → 1,17 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <assert.h> |
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) |
void getdate( struct date *dateblk) |
{ |
unsigned long tmp; |
__asm__ __volatile__("int $0x40":"=a"(tmp):"0"(29)); |
dateblk->da_year=2000+(tmp&0xff); |
dateblk->da_mon=(tmp>>8)&0xff; |
dateblk->da_day=(tmp>>16)&0xff; |
BCD_TO_BIN(dateblk->da_year); |
BCD_TO_BIN(dateblk->da_mon); |
BCD_TO_BIN(dateblk->da_day); |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/getdfree.c |
---|
0,0 → 1,8 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <errno.h> |
#include <assert.h> |
void getdfree(unsigned char drive, struct dfree *dtable) |
{ |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/getdinfo.c |
---|
0,0 → 1,21 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
/* This is file GETDINFO.C */ |
/* |
* Get device info word by calling IOCTL Function 0. |
* |
* Copyright (c) 1994 Eli Zaretskii <eliz@is.elta.co.il> |
* |
* This software may be used freely so long as this copyright notice is |
* left intact. There is no warranty on this software. |
* |
*/ |
#include <errno.h> |
#include <libc/dosio.h> |
#include <assert.h> |
short _get_dev_info(int); |
short _get_dev_info(int fhandle) |
{ |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/getdos_v.c |
---|
0,0 → 1,62 |
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
/* |
* This is file GETDOS_V.C |
* |
* Copyright (c) 1994,95 Eli Zaretskii <eliz@is.elta.co.il> |
* |
* This software may be used freely so long as this copyright notice is |
* left intact. There is no warranty on this software. |
* |
*/ |
#include <libc/bss.h> |
#include <dos.h> |
/* Return OS version number, either true or ``simulated'' one. |
Global variables _OSMAJOR and _OSMINOR are ALWAYS set to whatever |
INT 21h/AX=30h returns. Global _OS_FLAVOR is set to a string |
which identifies the OEM of DOS. |
*/ |
/* From Ralph Brown's interrupt list, v.45. |
Note: some OEMs, like Novell NDOS 7, Compaq DOS 3.31 and possibly |
others return 0 OEM code, like IBM PC-DOS. There is nothing |
I can do to overcome this. |
*/ |
static struct _oem_info { |
unsigned char oem_num; |
const char * oem_name; |
} dos_flavors[] = { |
{0, "IBM PC-DOS"}, |
{1, "Compaq DOS"}, |
{2, "Microsoft DOS"}, |
{4, "AT&T DOS"}, |
{5, "Zenith DOS"}, |
{6, "Hewlett-Packard DOS"}, |
{7, "Groupe Bull DOS"}, |
{0xd, "Packard-Bell DOS"}, |
{0x16, "DEC DOS"}, |
{0x23, "Olivetti DOS"}, |
{0x28, "Texas Instruments DOS"}, |
{0x29, "Toshiba DOS"}, |
{0x33, "Novell Win3 device ID"}, |
{0x34, "MS Multimedia Win3 device ID"}, |
{0x35, "MS Multimedia Win3 device ID"}, |
{0x4d, "Hewlett-Packard DOS"}, |
{0x5e, "RxDOS"}, |
{0x66, "PTS-DOS"}, |
{0x99, "GenSoft Embedded DOS"}, |
{0xee, "DR-DOS"}, |
{0xef, "Novell DOS"}, |
{0xff, "Microsoft MS-DOS"}, |
{0, (char *)0} |
}; |
static int getdosv_count = -1; |
unsigned short |
_get_dos_version(int true_version) |
{ |
return 0x0500; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/getftime.c |
---|
0,0 → 1,10 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <libc/dosio.h> |
#include <errno.h> |
#include <assert.h> |
int getftime(int handle, struct ftime *ft) |
{ |
return -1; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/gettime.c |
---|
0,0 → 1,16 |
#include <dos.h> |
#include <assert.h> |
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) |
void gettime( struct time *tp) |
{ |
unsigned long tmp=__menuet__getsystemclock(); |
tp->ti_hour=tmp&0xff; |
tp->ti_min=(tmp>>8)&0xff; |
tp->ti_sec=(tmp>>16)&0xff; |
tp->ti_hund=0; |
BCD_TO_BIN(tp->ti_hour); |
BCD_TO_BIN(tp->ti_min); |
BCD_TO_BIN(tp->ti_sec); |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/gettimeo.c |
---|
0,0 → 1,35 |
#include <time.h> |
#include <assert.h> |
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) |
int gettimeofday(struct timeval *tv, struct timezone *tz) |
{ |
struct tm tmblk; |
struct timeval tv_tmp; |
unsigned long xtmp; |
if (!tv) tv = &tv_tmp; |
tv->tv_usec=0; |
xtmp=__menuet__getsystemclock(); |
tmblk.tm_sec = (xtmp>>16)&0xff; |
tmblk.tm_min = (xtmp>>8)&0xff; |
tmblk.tm_hour = xtmp&0xff; |
BCD_TO_BIN(tmblk.tm_sec); |
BCD_TO_BIN(tmblk.tm_min); |
BCD_TO_BIN(tmblk.tm_hour); |
__asm__ __volatile__("int $0x40":"=a"(xtmp):"0"(29)); |
tmblk.tm_mday = (xtmp>>16)&0xff; |
tmblk.tm_mon = ((xtmp>>8)&0xff)-1; |
tmblk.tm_year = ((xtmp&0xff)+2000)-1900; |
tmblk.tm_wday = tmblk.tm_yday = tmblk.tm_gmtoff = 0; |
tmblk.tm_zone = 0; |
tmblk.tm_isdst = -1; |
tv->tv_sec = mktime(&tmblk); |
if(tz) |
{ |
struct tm *tmloc = localtime(&(tv->tv_sec)); |
tz->tz_minuteswest = - tmloc->tm_gmtoff / 60; |
tz->tz_dsttime = tmloc->tm_isdst; |
} |
return 0; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/osflavor.c |
---|
0,0 → 1,4 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
const char *_os_flavor; |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/osmajor.c |
---|
0,0 → 1,4 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
unsigned short _osmajor; |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/osminor.c |
---|
0,0 → 1,4 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
unsigned short _osminor; |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/remotdrv.c |
---|
0,0 → 1,20 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
/* |
* This is file REMOTDRV.C |
* |
* Copyright (c) 1994, 1995 Eli Zaretskii <eliz@is.elta.co.il> |
* |
* This software may be used freely so long as this copyright notice is |
* left intact. There is no warranty on this software. |
* |
*/ |
#include <errno.h> |
#include <dos.h> |
#include <libc/dosio.h> |
int _is_remote_drive(int c) |
{ |
return 0; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/remothdl.c |
---|
0,0 → 1,20 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
/* This is file REMOTHDL.C */ |
/* |
* Copyright (c) 1994 Eli Zaretskii <eliz@is.elta.co.il> |
* |
* This software may be used freely so long as this copyright notice is |
* left intact. There is no warranty on this software. |
* |
*/ |
#include <errno.h> |
#include <libc/dosio.h> |
int _is_remote_handle(int); |
int |
_is_remote_handle(int fhandle) |
{ |
return 0; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/setcbrk.c |
---|
0,0 → 1,8 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <assert.h> |
int setcbrk(int v) |
{ |
unimpl(); |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/setdate.c |
---|
0,0 → 1,7 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <assert.h> |
void setdate( struct date *dateblk) |
{ |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/setftime.c |
---|
0,0 → 1,10 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <libc/dosio.h> |
#include <errno.h> |
#include <assert.h> |
int setftime(int handle, struct ftime *ft) |
{ |
return -EPERM; |
} |
/programs/develop/libraries/menuetlibc/src/libc/dos/dos/settime.c |
---|
0,0 → 1,7 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <dos.h> |
#include <assert.h> |
void settime( struct time *tp) |
{ |
} |