Merge pull request #1 from lpproj/prototype
Cross-build on Windows and DBCS fix
This commit is contained in:
commit
7f649868f9
@ -435,7 +435,10 @@ struct nlsPackage { /* the contents of one chain item of the
|
||||
|
||||
struct nlsDBCS { /* The internal structure is unknown to me */
|
||||
UWORD numEntries;
|
||||
UWORD dbcsTbl[1];
|
||||
UWORD dbcsTbl[4]; /* I don't know max size but it should need
|
||||
at least 3 words (6 bytes)
|
||||
({0x81,0x9f,0xe0,0xfc,0,0} for CP932-Japan)
|
||||
-- lpproj 2014/10/27 */
|
||||
};
|
||||
|
||||
struct nlsCharTbl {
|
||||
|
@ -100,9 +100,14 @@ static unsigned short __inline getSS(void)
|
||||
asm mov ax, ss;
|
||||
}
|
||||
|
||||
#elif defined(__WATCOMC__) && defined(BUILD_UTILS)
|
||||
/* workaround for building some utils with OpenWatcom (owcc) */
|
||||
#define MC68K
|
||||
#elif defined(__WATCOMC__) /* don't know a better way */
|
||||
|
||||
#if defined(_M_I86)
|
||||
#define I86
|
||||
#endif
|
||||
#define __int__(intno) asm int intno;
|
||||
void disable(void);
|
||||
#pragma aux disable = "cli" modify exact [];
|
||||
@ -170,10 +175,12 @@ We might even deal with a pre-ANSI compiler. This will certainly not compile.
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
#else
|
||||
#define CONST
|
||||
#if !(defined(_SIZE_T) || defined(_SIZE_T_DEFINED) || defined(__SIZE_T_DEFINED))
|
||||
typedef unsigned size_t;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef I86
|
||||
#endif
|
||||
#if defined(I86) && !defined(MC68K)
|
||||
#define VOID void
|
||||
#define FAR far /* segment architecture */
|
||||
#define NEAR near /* " " */
|
||||
|
@ -1542,7 +1542,7 @@ err:printf("%s has invalid format\n", filename);
|
||||
{
|
||||
if (hdr[i].length != 6)
|
||||
goto err;
|
||||
if (hdr[i].id < 1 || hdr[i].id > 6 || hdr[i].id == 3)
|
||||
if (hdr[i].id < 1 || hdr[i].id > 7 || hdr[i].id == 3)
|
||||
continue;
|
||||
if (lseek(fd, hdr[i].offset) == 0xffffffffL
|
||||
|| read(fd, &subf_data, 10) != 10
|
||||
|
@ -1377,7 +1377,7 @@ dispatch:
|
||||
case 0:
|
||||
p = DosGetDBCS();
|
||||
lr.DS = FP_SEG(p);
|
||||
lr.SI = FP_OFF(p);
|
||||
lr.SI = FP_OFF(p) + 2;
|
||||
break;
|
||||
case 1: /* set Korean Hangul input method to DL 0/1 */
|
||||
lr.AL = 0xff; /* flag error (AL would be 0 if okay) */
|
||||
|
@ -21,9 +21,9 @@ OBJS4=break.obj dosfns.obj fatdir.obj fatfs.obj fattab.obj fcbfns.obj \
|
||||
inthndlr.obj
|
||||
OBJS5=ioctl.obj memmgr.obj task.obj newstuff.obj nls.obj network.obj
|
||||
OBJS6=prf.obj misc.obj strings.obj syspack.obj lfnapi.obj iasmsupt.obj memdisk.obj
|
||||
OBJS7=main.obj config.obj initoem.obj inithma.obj dyninit.obj iprf.obj \
|
||||
initdisk.obj initclk.obj cpu.obj
|
||||
OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7)
|
||||
OBJS7=main.obj config.obj initoem.obj inithma.obj dyninit.obj iprf.obj
|
||||
OBJS8=initdisk.obj initclk.obj cpu.obj
|
||||
OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7) $(OBJS8)
|
||||
|
||||
# *Explicit Rules*
|
||||
|
||||
@ -62,7 +62,8 @@ $(TARGET).lnk: turboc.cfg makefile ../mkfiles/generic.mak ../mkfiles/$(COMPILER)
|
||||
$(ECHOTO) $(TARGET).lnk $(OBJS4)+
|
||||
$(ECHOTO) $(TARGET).lnk $(OBJS5)+
|
||||
$(ECHOTO) $(TARGET).lnk $(OBJS6)+
|
||||
$(ECHOTO) $(TARGET).lnk $(OBJS7)
|
||||
$(ECHOTO) $(TARGET).lnk $(OBJS7)+
|
||||
$(ECHOTO) $(TARGET).lnk $(OBJS8)
|
||||
$(ECHOTO) $(TARGET).lnk kernel.exe
|
||||
$(ECHOTO) $(TARGET).lnk kernel.map
|
||||
$(ECHOTO) $(TARGET).lnk $(LIBS)
|
||||
|
25
makefile
25
makefile
@ -1,10 +1,14 @@
|
||||
# What you WANT on DOS is:
|
||||
# EDIT CONFIG.B, COPY CONFIG.B to CONFIG.BAT, RUN BUILD.BAT
|
||||
# On Linux, use config.mak, and "make all", "make clean", or "make clobber"
|
||||
# On Windows, use config.mak, and
|
||||
# "mingw32-make all", "mingw32-make clean", or "mingw32-make clobber"
|
||||
|
||||
default:
|
||||
@echo On DOS, please type build, clean, or clobber.
|
||||
@echo On Linux, please type make all, make clean, or make clobber.
|
||||
@echo On Windows, please type mingw32-make all, mingw32-make clean, or
|
||||
@echo mingw32-make clobber.
|
||||
|
||||
build:
|
||||
build
|
||||
@ -60,14 +64,27 @@ zip: zip_src zipfat16 zipfat32
|
||||
#Linux part
|
||||
#defaults: override using config.mak
|
||||
export
|
||||
COMPILER=owlinux
|
||||
|
||||
XCPU=86
|
||||
XFAT=32
|
||||
ifeq ($(OS),Windows_NT)
|
||||
BUILDENV ?= windows
|
||||
else
|
||||
BUILDENV ?= linux
|
||||
endif
|
||||
|
||||
ifeq ($(BUILDENV),windows)
|
||||
COMPILER=owwin
|
||||
TEST_F=type >nul 2>nul
|
||||
else
|
||||
COMPILER=owlinux
|
||||
TEST_F=test -f
|
||||
ifndef WATCOM
|
||||
WATCOM=$(HOME)/watcom
|
||||
PATH:=$(WATCOM)/binl:$(PATH)
|
||||
endif
|
||||
endif
|
||||
|
||||
XCPU=86
|
||||
XFAT=32
|
||||
XUPX=upx --8086 --best
|
||||
XNASM=nasm
|
||||
MAKE=wmake -ms -h
|
||||
@ -81,7 +98,7 @@ endif
|
||||
|
||||
all:
|
||||
cd utils && $(MAKE) production
|
||||
cd lib && ( test -f libm.lib || touch libm.lib )
|
||||
cd lib && ( $(TEST_F) libm.lib || wtouch libm.lib )
|
||||
cd drivers && $(MAKE) production
|
||||
cd boot && $(MAKE) production
|
||||
cd sys && $(MAKE) production
|
||||
|
21
mkfiles/owwin.mak
Normal file
21
mkfiles/owwin.mak
Normal file
@ -0,0 +1,21 @@
|
||||
#
|
||||
# WATCOM.MAK - kernel compiler options for Open Watcom on Windows (cross-compile)
|
||||
#
|
||||
|
||||
# Get definitions from watcom.mak, then override
|
||||
include "../mkfiles/watcom.mak"
|
||||
|
||||
DIRSEP=\
|
||||
|
||||
INCLUDEPATH=$(COMPILERPATH)$(DIRSEP)h
|
||||
#RM=del 2>nul
|
||||
#CP=copy
|
||||
#ECHOTO=echo>>
|
||||
#INITPATCH=@echo > nul
|
||||
CLDEF=1
|
||||
CLT=owcc -DDOSC_TIME_H -DBUILD_UTILS -I../hdr -o $@
|
||||
CLC=$(CLT)
|
||||
CFLAGST=-fo=.obj $(CFLAGST)
|
||||
ALLCFLAGS=-fo=.obj $(ALLCFLAGS)
|
||||
NASMFLAGS=-Dowlinux $(NASMFLAGS)
|
||||
XLINK=$(XLINK) debug all op symfile format dos option map,statics,verbose F { $(OBJS) } L ..$(DIRSEP)lib$(DIRSEP)device.lib N kernel.exe $#
|
34
sys/makefile
34
sys/makefile
@ -1,5 +1,5 @@
|
||||
#
|
||||
# makefile for bin2c.com and sys.com
|
||||
# makefile for bin2c.exe and sys.com
|
||||
#
|
||||
# $Id: makefile 1482 2009-07-11 16:59:43Z perditionc $
|
||||
#
|
||||
@ -18,31 +18,31 @@ SYS_EXE_dependencies = \
|
||||
talloc.obj
|
||||
|
||||
# *Explicit Rules*
|
||||
production: bin2c.com ../bin/sys.com
|
||||
production: bin2c.exe ../bin/sys.com
|
||||
|
||||
bin2c.com: bin2c.c
|
||||
$(CLT) bin2c.c
|
||||
bin2c.exe: bin2c.c
|
||||
$(CLC) bin2c.c
|
||||
|
||||
../bin/sys.com: sys.com
|
||||
$(CP) sys.com ..$(DIRSEP)bin
|
||||
|
||||
fat12com.h: ../boot/fat12com.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat12com.bin fat12com.h fat12com
|
||||
fat12com.h: ../boot/fat12com.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat12com.bin fat12com.h fat12com
|
||||
|
||||
fat16com.h: ../boot/fat16com.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat16com.bin fat16com.h fat16com
|
||||
fat16com.h: ../boot/fat16com.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat16com.bin fat16com.h fat16com
|
||||
|
||||
fat32chs.h: ../boot/fat32chs.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat32chs.bin fat32chs.h fat32chs
|
||||
fat32chs.h: ../boot/fat32chs.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat32chs.bin fat32chs.h fat32chs
|
||||
|
||||
fat32lba.h: ../boot/fat32lba.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/fat32lba.bin fat32lba.h fat32lba
|
||||
fat32lba.h: ../boot/fat32lba.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/fat32lba.bin fat32lba.h fat32lba
|
||||
|
||||
oemfat12.h: ../boot/oemfat12.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/oemfat12.bin oemfat12.h oemfat12
|
||||
oemfat12.h: ../boot/oemfat12.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/oemfat12.bin oemfat12.h oemfat12
|
||||
|
||||
oemfat16.h: ../boot/oemfat16.bin bin2c.com
|
||||
.$(DIRSEP)bin2c.com ../boot/oemfat16.bin oemfat16.h oemfat16
|
||||
oemfat16.h: ../boot/oemfat16.bin bin2c.exe
|
||||
.$(DIRSEP)bin2c.exe ../boot/oemfat16.bin oemfat16.h oemfat16
|
||||
|
||||
prf.obj: ../kernel/prf.c
|
||||
$(CC) $(CFLAGS) ..$(DIRSEP)kernel$(DIRSEP)prf.c
|
||||
@ -55,7 +55,7 @@ sys.com: $(SYS_EXE_dependencies)
|
||||
$(CL) $(CFLAGST) $(TINY) $(SYS_EXE_dependencies)
|
||||
|
||||
clobber: clean
|
||||
-$(RM) bin2c.com sys.com fat*.h oemfat*.h
|
||||
-$(RM) bin2c.exe sys.com fat*.h oemfat*.h
|
||||
|
||||
clean:
|
||||
-$(RM) *.obj *.bak *.crf *.xrf *.map *.lst *.las *.cod *.err status.me
|
||||
|
Loading…
Reference in New Issue
Block a user