diff --git a/hdr/device.h b/hdr/device.h index ce2ac597..9da8cc88 100644 --- a/hdr/device.h +++ b/hdr/device.h @@ -496,7 +496,7 @@ WORD ASMCFUNC FAR clk_driver(rqptr rp); /* execrh.asm */ #if defined(__WATCOMC__) && _M_IX86 >= 300 WORD execrh(request FAR *, struct dhdr FAR *); -#pragma aux execrh "^" parm reverse routine [] modify [ax bx cx dx es fs gs] +#pragma aux execrh "^" __parm __reverse __routine [] __modify [__ax __bx __cx __dx __es __fs __gs] #else WORD ASMPASCAL execrh(request FAR *, struct dhdr FAR *); #endif diff --git a/hdr/portab.h b/hdr/portab.h index 188bf090..82e15114 100644 --- a/hdr/portab.h +++ b/hdr/portab.h @@ -77,7 +77,7 @@ void __emit__(char, ...); #define enable() __emit__(0xfb) #endif -#elif defined (_MSC_VER) +#elif defined (_MSC_VER) #define I86 #define asm __asm @@ -110,9 +110,9 @@ static unsigned short __inline getSS(void) #endif #define __int__(intno) asm int intno; void disable(void); -#pragma aux disable = "cli" modify exact []; +#pragma aux disable = "cli" __modify __exact []; void enable(void); -#pragma aux enable = "sti" modify exact []; +#pragma aux enable = "sti" __modify __exact []; #define asm __asm #define far __far #define CDECL __cdecl @@ -120,12 +120,12 @@ void enable(void); #define PASCAL pascal #define _CS getCS() unsigned short getCS(void); -#pragma aux getCS = "mov dx,cs" value [dx] modify exact[dx]; +#pragma aux getCS = "mov dx,cs" __value [__dx] __modify __exact[__dx]; #define _SS getSS() unsigned short getSS(void); -#pragma aux getSS = "mov dx,ss" value [dx] modify exact[dx]; +#pragma aux getSS = "mov dx,ss" __value [__dx] __modify __exact[__dx]; #if !defined(FORSYS) && !defined(EXEFLAT) && _M_IX86 >= 300 -#pragma aux default parm [ax dx cx] modify [ax dx es fs] /* min.unpacked size */ +#pragma aux __default __parm [__ax __dx __cx] __modify [__ax __dx __es __fs] /* min.unpacked size */ #endif /* enable Possible loss of precision warning for compatibility with Borland */ @@ -234,7 +234,7 @@ typedef unsigned size_t; #define PARASIZE 16 /* "paragraph" size */ typedef unsigned size_t; #endif - /* functions, that are shared between C and ASM _must_ + /* functions, that are shared between C and ASM _must_ have a certain calling standard. These are declared as 'ASMCFUNC', and is (and will be ?-) cdecl */ #define ASMCFUNC CDECL @@ -301,7 +301,7 @@ typedef unsigned short CLUSTER; typedef unsigned short UNICODE; #if defined(STATICS) || defined(__WATCOMC__) || defined(__GNUC__) -#define STATIC static /* local calls inside module */ +#define STATIC static /* local calls inside module */ #else #define STATIC #endif @@ -333,7 +333,7 @@ typedef signed long LONG; #ifndef MK_FP #if defined(__WATCOMC__) -#define MK_FP(seg,ofs) (((UWORD)(seg)):>((VOID *)(ofs))) +#define MK_FP(seg,ofs) (((UWORD)(seg)):>((VOID *)(ofs))) #elif defined(__TURBOC__) && (__TURBOC__ > 0x202) #define MK_FP(seg,ofs) ((void _seg *)(seg) + (void near *)(ofs)) #else @@ -385,9 +385,9 @@ typedef VOID (FAR ASMCFUNC * intvec) (void); #endif /* - this suppresses the warning - unreferenced parameter 'x' - and (hopefully) generates no code + this suppresses the warning + unreferenced parameter 'x' + and (hopefully) generates no code */ #define UNREFERENCED_PARAMETER(x) (void)x; diff --git a/kernel/chario.c b/kernel/chario.c index 529a88d1..e0708262 100644 --- a/kernel/chario.c +++ b/kernel/chario.c @@ -142,7 +142,7 @@ int ndread(struct dhdr FAR **pdev) #ifdef __WATCOMC__ void fast_put_char(char c); -#pragma aux fast_put_char = "int 29h" parm[al] modify exact [bx] +#pragma aux fast_put_char = "int 29h" __parm[__al] __modify __exact [__bx] #else /* writes a character in raw mode using int29 for speed */ @@ -366,7 +366,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp) unsigned c; unsigned cu_pos = scr_pos; unsigned count = 0, stored_pos = 0; - unsigned size = kp->kb_size, stored_size = kp->kb_count; + unsigned size = kp->kb_size, stored_size = kp->kb_count; BOOL insert = FALSE, first = TRUE; if (size == 0) @@ -375,11 +375,11 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp) /* the stored line is invalid unless it ends with a CR */ if (kp->kb_buf[stored_size] != CR) stored_size = 0; - + do { unsigned new_pos = stored_size; - + c = read_char_check_break(sft_in, sft_out); if (c == 0) c = (unsigned)read_char_check_break(sft_in, sft_out) << 8; @@ -402,7 +402,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp) if (stored_pos < stored_size && count < size - 1) local_buffer[count++] = echo_char(kp->kb_buf[stored_pos++], sft_out); break; - + case F2: case F4: /* insert/delete up to character c */ @@ -430,7 +430,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp) } stored_pos = new_pos; break; - + case F5: fmemcpy(kp->kb_buf, local_buffer, count); stored_size = count; @@ -440,7 +440,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp) case INS: insert = !insert; break; - + case DEL: stored_pos++; break; @@ -522,7 +522,7 @@ void read_line(int sft_in, int sft_out, keyboard FAR * kp) size_t read_line_handle(int sft_idx, size_t n, char FAR * bp) { size_t chars_left; - + if (inputptr == NULL) { /* can we reuse kb_buf or was it overwritten? */ diff --git a/kernel/dsk.c b/kernel/dsk.c index 70c4a8f8..62b25aef 100644 --- a/kernel/dsk.c +++ b/kernel/dsk.c @@ -56,12 +56,12 @@ extern COUNT ASMPASCAL fl_lba_ReadWrite(BYTE drive, WORD mode, * dap_p); UWORD ASMPASCAL floppy_change(UWORD); #ifdef __WATCOMC__ -#pragma aux (pascal) fl_reset modify exact [ax dx] -#pragma aux (pascal) fl_diskchanged modify exact [ax dx] -#pragma aux (pascal) fl_setdisktype modify exact [ax bx dx] -#pragma aux (pascal) fl_readkey modify exact [ax] -#pragma aux (pascal) fl_lba_ReadWrite modify exact [ax dx] -#pragma aux (pascal) floppy_change modify exact [ax cx dx] +#pragma aux (__pascal) fl_reset __modify __exact [__ax __dx] +#pragma aux (__pascal) fl_diskchanged __modify __exact [__ax __dx] +#pragma aux (__pascal) fl_setdisktype __modify __exact [__ax __bx __dx] +#pragma aux (__pascal) fl_readkey __modify __exact [__ax] +#pragma aux (__pascal) fl_lba_ReadWrite __modify __exact [__ax __dx] +#pragma aux (__pascal) floppy_change __modify __exact [__ax __cx __dx] #endif STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer, @@ -374,7 +374,7 @@ STATIC WORD getbpb(ddt * pddt) unsigned secs_per_cyl; WORD ret; - /* pddt->ddt_descflags |= DF_NOACCESS; + /* pddt->ddt_descflags |= DF_NOACCESS; * disabled for now - problems with FORMAT ?? */ /* set drive to not accessible and changed */ @@ -426,7 +426,7 @@ STATIC WORD getbpb(ddt * pddt) #endif extended_BPB_signature = DiskTransferBuffer[0x26]; - /* 0x29 is usual signature value for serial#,vol label,& fstype; + /* 0x29 is usual signature value for serial#,vol label,& fstype; 0x28 older EBPB signature indicating only serial# is valid */ if ((extended_BPB_signature == 0x29) || (extended_BPB_signature == 0x28)) { @@ -716,7 +716,7 @@ STATIC WORD Genblkdev(rqptr rp, ddt * pddt) /* return error if media lacks extended BPB with serial # */ { - register BYTE extended_BPB_signature = + register BYTE extended_BPB_signature = DiskTransferBuffer[(pddt->ddt_bpb.bpb_nfsect != 0 ? 0x26 : 0x42)]; if ((extended_BPB_signature != 0x29) || (extended_BPB_signature != 0x28)) return failure(E_MEDIA); @@ -954,22 +954,22 @@ STATIC unsigned DMA_max_transfer(void FAR * buffer, unsigned count) UWORD *transferred sectors actually transferred Read/Write/Write+verify some sectors, using LBA addressing. - - + + This function handles all the minor details, including: - + retry in case of errors - + crossing the 64K DMA boundary - + translation to CHS addressing if necessary - + crossing track boundaries (necessary for some BIOSes - + High memory doesn't work very well, use internal buffer - + write with verify details for LBA - + */ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer, @@ -988,9 +988,9 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer, int num_retries; - UWORD bytes_sector = pddt->ddt_bpb.bpb_nbyte; /* bytes per sector, usually 512 */ + UWORD bytes_sector = pddt->ddt_bpb.bpb_nbyte; /* bytes per sector, usually 512 */ *transferred = 0; - + /* only low-level format floppies for now ! */ if (mode == LBA_FORMAT && hd(pddt->ddt_descflags)) return 0; @@ -1009,8 +1009,8 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer, fl_reset(driveno); } } - -/* + +/* if (LBA_address+totaltodo > pddt->total_sectors) { printf("LBA-Transfer error : address overflow = %lu > %lu max\n",LBA_address+totaltodo,driveParam->total_sectors); @@ -1027,7 +1027,7 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer, /* avoid overflowing 64K DMA boundary for drives that don't handle this transparently */ count = DMA_max_transfer(buffer, totaltodo); - } + } if (FP_SEG(buffer) >= 0xa000 || count == 0) { diff --git a/kernel/globals.h b/kernel/globals.h index 5bf50377..07b6468f 100644 --- a/kernel/globals.h +++ b/kernel/globals.h @@ -233,7 +233,7 @@ extern BYTE ASM NetDelay, ASM NetRetry; extern UWORD ASM first_mcb, /* Start of user memory */ ASM uppermem_root; /* Start of umb chain (usually 9fff) */ -extern char * ASM inputptr; /* pointer to unread CON input */ +extern char * ASM inputptr; /* pointer to unread CON input */ extern sfttbl FAR * ASM sfthead; /* System File Table head */ extern struct dhdr FAR * ASM clock; /* CLOCK$ device */ extern struct dhdr FAR * ASM syscon;/* console device */ @@ -264,8 +264,8 @@ extern BYTE ASM ErrorMode, /* Critical error flag */ ASM InDOS, /* In DOS critical section */ ASM OpenMode, /* File Open Attributes */ ASM SAttr, /* Attrib Mask for Dir Search */ - ASM dosidle_flag, ASM Server_Call, ASM CritErrLocus, ASM CritErrAction, - ASM CritErrClass, ASM VgaSet, + ASM dosidle_flag, ASM Server_Call, ASM CritErrLocus, ASM CritErrAction, + ASM CritErrClass, ASM VgaSet, ASM njoined; /* number of joined devices */ extern VOID FAR * ASM setverPtr; /* Pointer to SETVER list */ @@ -372,9 +372,9 @@ VOID ASMPASCAL WriteATClock(BYTE *, BYTE, BYTE, BYTE); VOID ASMPASCAL WritePCClock(ULONG); intvec getvec(unsigned char); #ifdef __WATCOMC__ -#pragma aux (pascal) ReadPCClock modify exact [ax cx dx] -#pragma aux (pascal) WriteATClock modify exact [ax bx cx dx] -#pragma aux (pascal) WritePCClock modify exact [ax cx dx] +#pragma aux (__pascal) ReadPCClock __modify __exact [__ax __cx __dx] +#pragma aux (__pascal) WriteATClock __modify __exact [__ax __bx __cx __dx] +#pragma aux (__pascal) WritePCClock __modify __exact [__ax __cx __dx] #endif /* */ @@ -410,7 +410,7 @@ void setvec(unsigned char intno, intvec vector); /* ^Break handling */ #ifdef __WATCOMC__ -#pragma aux (cdecl) spawn_int23 aborts; +#pragma aux (__cdecl) spawn_int23 __aborts; #endif void ASMCFUNC spawn_int23(void); /* procsupt.asm */ void ASMCFUNC DosIdle_hlt(void); /* dosidle.asm */ diff --git a/kernel/init-mod.h b/kernel/init-mod.h index 50fb0697..dfd0a789 100644 --- a/kernel/init-mod.h +++ b/kernel/init-mod.h @@ -84,18 +84,18 @@ char * ASMPASCAL strchr(const char *s, int ch); #ifdef __WATCOMC__ /* bx, cx, dx and es not used or clobbered for all asmsupt.asm functions except (f)memchr/(f)strchr (which clobber dx) */ -#pragma aux (pascal) pascal_ax modify exact [ax] -#pragma aux (pascal_ax) memset -#pragma aux (pascal_ax) fmemset -#pragma aux (pascal_ax) memcpy -#pragma aux (pascal_ax) fmemcpy -#pragma aux (pascal_ax) memcmp modify nomemory -#pragma aux (pascal_ax) fmemcmp modify nomemory -#pragma aux (pascal_ax) strcpy -#pragma aux (pascal_ax) fstrcpy -#pragma aux (pascal_ax) strlen modify nomemory -#pragma aux (pascal_ax) fstrlen modify nomemory -#pragma aux (pascal) strchr modify exact [ax dx] nomemory +#pragma aux (__pascal) __pascal_ax __modify __exact [__ax] +#pragma aux (__pascal_ax) memset +#pragma aux (__pascal_ax) fmemset +#pragma aux (__pascal_ax) memcpy +#pragma aux (__pascal_ax) fmemcpy +#pragma aux (__pascal_ax) memcmp __modify __nomemory +#pragma aux (__pascal_ax) fmemcmp __modify __nomemory +#pragma aux (__pascal_ax) strcpy +#pragma aux (__pascal_ax) fstrcpy +#pragma aux (__pascal_ax) strlen __modify __nomemory +#pragma aux (__pascal_ax) fstrlen __modify __nomemory +#pragma aux (__pascal) strchr __modify __exact [__ax __dx] __nomemory #endif #undef LINESIZE @@ -147,7 +147,7 @@ COUNT ASMPASCAL Umb_Test(void); COUNT ASMPASCAL UMB_get_largest(void FAR * driverAddress, UCOUNT * seg, UCOUNT * size); #ifdef __WATCOMC__ -#pragma aux (pascal) UMB_get_largest modify exact [ax bx cx dx] +#pragma aux (__pascal) UMB_get_largest __modify __exact [__ax __bx __cx __dx] #endif /* inithma.c */ @@ -185,18 +185,18 @@ int ASMPASCAL init_switchar(int chr); void ASMPASCAL keycheck(void); void ASMPASCAL set_DTA(void far *dta); #ifdef __WATCOMC__ -#pragma aux (pascal) init_call_intr modify exact [ax] -#pragma aux (pascal) read modify exact [ax bx cx dx] -#pragma aux (pascal) init_DosOpen modify exact [ax bx dx] -#pragma aux (pascal) close modify exact [ax bx] -#pragma aux (pascal) dup2 modify exact [ax bx cx] -#pragma aux (pascal) allocmem modify exact [ax bx] -#pragma aux (pascal) init_PSPSet modify exact [ax bx] -#pragma aux (pascal) init_DosExec modify exact [ax bx dx es] -#pragma aux (pascal) init_setdrive modify exact [ax bx dx] -#pragma aux (pascal) init_switchar modify exact [ax bx dx] -#pragma aux (pascal) keycheck modify exact [ax] -#pragma aux (pascal) set_DTA modify exact [ax bx dx] +#pragma aux (__pascal) init_call_intr __modify __exact [__ax] +#pragma aux (__pascal) read __modify __exact [__ax __bx __cx __dx] +#pragma aux (__pascal) init_DosOpen __modify __exact [__ax __bx __dx] +#pragma aux (__pascal) close __modify __exact [__ax __bx] +#pragma aux (__pascal) dup2 __modify __exact [__ax __bx __cx] +#pragma aux (__pascal) allocmem __modify __exact [__ax __bx] +#pragma aux (__pascal) init_PSPSet __modify __exact [__ax __bx] +#pragma aux (__pascal) init_DosExec __modify __exact [__ax __bx __dx __es] +#pragma aux (__pascal) init_setdrive __modify __exact [__ax __bx __dx] +#pragma aux (__pascal) init_switchar __modify __exact [__ax __bx __dx] +#pragma aux (__pascal) keycheck __modify __exact [__ax] +#pragma aux (__pascal) set_DTA __modify __exact [__ax __bx __dx] #endif /* irqstack.asm */ @@ -278,9 +278,9 @@ extern unsigned char DOSTEXTFAR ASM kbdType; extern struct { char ThisIsAConstantOne; short TableSize; - + struct CountrySpecificInfo C; - + } DOSFAR ASM nlsCountryInfoHardcoded; /* @@ -333,9 +333,9 @@ extern void FAR * ASMPASCAL DetectXMSDriver(VOID); extern int ASMPASCAL init_call_XMScall(void FAR * driverAddress, UWORD ax, UWORD dx); #ifdef __WATCOMC__ -#pragma aux (pascal) DetectXMSDriver modify exact [ax dx] -#pragma aux (pascal) _EnableA20 modify exact [ax] -#pragma aux (pascal) _DisableA20 modify exact [ax] +#pragma aux (__pascal) DetectXMSDriver __modify __exact [__ax __dx] +#pragma aux (__pascal) _EnableA20 __modify __exact [__ax] +#pragma aux (__pascal) _DisableA20 __modify __exact [__ax] #endif #if defined(WATCOM) && 0 diff --git a/kernel/prf.c b/kernel/prf.c index c10bce2d..da6672a9 100644 --- a/kernel/prf.c +++ b/kernel/prf.c @@ -99,13 +99,13 @@ void put_console(int c) #else #ifdef __WATCOMC__ void int29(char c); -#pragma aux int29 = "int 0x29" parm [al] modify exact [bx]; +#pragma aux int29 = "int 0x29" __parm [__al] __modify __exact [__bx]; #ifdef DEBUG_PRINT_COMPORT void fastComPrint(char c); #pragma aux fastComPrint = \ "mov bx, 0xFD05" \ - "int 0x29" parm [al] modify exact [bx]; + "int 0x29" __parm [__al] __modify __exact [__bx]; #endif #endif @@ -428,7 +428,7 @@ void hexd(char *title, UBYTE FAR * p, COUNT numBytes) { put_unsigned(p[loop], 16, 2); put_console(' '); - } + } for (loop = start; loop < numBytes && loop < start+16;loop++) put_console(p[loop] < 0x20 ? '.' : p[loop]); put_console('\n'); @@ -465,11 +465,11 @@ void put_string(const char *s) /* this testprogram verifies that the strings are printed correctly ( or the way, I expect them to print) - + compile like (note -DTEST !) c:\tc\tcc -DTEST -DI86 -I..\hdr prf.c - + and run. if strings are wrong, the program will wait for the ANYKEY */ diff --git a/kernel/proto.h b/kernel/proto.h index 551d03bd..743f2fd9 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -54,7 +54,7 @@ unsigned char ctrl_break_pressed(void); unsigned char check_handle_break(struct dhdr FAR **pdev); void handle_break(struct dhdr FAR **pdev, int sft_out); #ifdef __WATCOMC__ -#pragma aux handle_break aborts; +#pragma aux handle_break __aborts; #endif /* chario.c */ @@ -127,8 +127,8 @@ COUNT DosTruename(const char FAR * src, char FAR * dest); VOID ASMCFUNC DosIdle_int(void); VOID ASMCFUNC DosIdle_hlt(void); #ifdef __WATCOMC__ -#pragma aux (cdecl) DosIdle_int modify exact [] -#pragma aux (cdecl) DosIdle_hlt modify exact [] +#pragma aux (__cdecl) DosIdle_int __modify __exact [] +#pragma aux (__cdecl) DosIdle_hlt __modify __exact [] #endif /* error.c */ @@ -222,9 +222,9 @@ UWORD ASMPASCAL call_intr(WORD nr, iregs FAR * rp); COUNT ASMPASCAL res_DosExec(COUNT mode, exec_blk * ep, BYTE * lp); UCOUNT ASMPASCAL res_read(int fd, void *buf, UCOUNT count); #ifdef __WATCOMC__ -#pragma aux (pascal) call_intr modify exact [ax] -#pragma aux (pascal) res_DosExec modify exact [ax bx dx es] -#pragma aux (pascal) res_read modify exact [ax bx cx dx] +#pragma aux (__pascal) call_intr __modify __exact [__ax] +#pragma aux (__pascal) res_DosExec __modify __exact [__ax __bx __dx __es] +#pragma aux (__pascal) res_read __modify __exact [__ax __bx __cx __dx] #endif /* ioctl.c */ @@ -318,21 +318,21 @@ int /*ASMCFUNC*/ ASMPASCAL fmemcmp(const void FAR *m1, const void FAR *m2, size_ #ifdef __WATCOMC__ /* bx, cx, dx and es not used or clobbered for all asmsupt.asm functions except (f)memchr/(f)strchr (which clobber dx) */ -#pragma aux (pascal) pascal_ax modify exact [ax] -#pragma aux (pascal_ax) fmemcpy -#pragma aux (pascal_ax) memcpy -#pragma aux (pascal_ax) fmemset -#pragma aux (pascal_ax) memset -#pragma aux (pascal_ax) fmemcmp modify nomemory -#pragma aux (pascal_ax) memcmp modify nomemory -#pragma aux (pascal_ax) fstrcpy -#pragma aux (pascal_ax) strcpy -#pragma aux (pascal_ax) fstrlen modify nomemory -#pragma aux (pascal_ax) strlen modify nomemory -#pragma aux (pascal) memchr modify exact [ax dx] nomemory -#pragma aux (pascal) fmemchr modify exact [ax dx] nomemory -#pragma aux (pascal) strchr modify exact [ax dx] nomemory -#pragma aux (pascal) fstrchr modify exact [ax dx] nomemory +#pragma aux (__pascal) __pascal_ax __modify __exact [__ax] +#pragma aux (__pascal_ax) fmemcpy +#pragma aux (__pascal_ax) memcpy +#pragma aux (__pascal_ax) fmemset +#pragma aux (__pascal_ax) memset +#pragma aux (__pascal_ax) fmemcmp __modify __nomemory +#pragma aux (__pascal_ax) memcmp __modify __nomemory +#pragma aux (__pascal_ax) fstrcpy +#pragma aux (__pascal_ax) strcpy +#pragma aux (__pascal_ax) fstrlen __modify __nomemory +#pragma aux (__pascal_ax) strlen __modify __nomemory +#pragma aux (__pascal) memchr __modify __exact [__ax __dx] __nomemory +#pragma aux (__pascal) fmemchr __modify __exact [__ax __dx] __nomemory +#pragma aux (__pascal) strchr __modify __exact [__ax __dx] __nomemory +#pragma aux (__pascal) fstrchr __modify __exact [__ax __dx] __nomemory #endif /* sysclk.c */ @@ -393,9 +393,9 @@ VOID ASMCFUNC exec_user(iregs FAR * irp, int disable_a20); /* assert at compile time, that something is true. - - use like - ASSERT_CONST( SECSIZE == 512) + + use like + ASSERT_CONST( SECSIZE == 512) ASSERT_CONST( (BYTE FAR *)x->fcb_ext - (BYTE FAR *)x->fcbname == 8) */ diff --git a/sys/fdkrncfg.c b/sys/fdkrncfg.c index 40e71107..4fba2f3e 100644 --- a/sys/fdkrncfg.c +++ b/sys/fdkrncfg.c @@ -43,8 +43,8 @@ unsigned long lseek(int fildes, unsigned long offset, int whence); #pragma aux lseek = \ "mov ah, 0x42" \ "int 0x21" \ - parm [bx] [dx cx] [ax] \ - value [dx ax]; + __parm [__bx] [__dx __cx] [__ax] \ + __value [__dx __ax]; #elif defined(__GNUC__) #include @@ -95,8 +95,8 @@ void showUsage(void) " GLOBALENABLELBASUPPORT=0|1\n" " BootHarddiskSeconds=0|seconds to wait\n" " CheckDebugger=0|1|2\n" - " Verbose=0|1\n" - ); + " Verbose=0|1\n" + ); } /* simply reads in current configuration values, exiting program @@ -179,7 +179,7 @@ void displayConfigSettings(KernelConfig * cfg) if (cfg->ConfigSize >= 12) { printf - ("%s kernel %s (build %d.%d OEM:%02X)\n", + ("%s kernel %s (build %d.%d OEM:%02X)\n", (cfg->Version_OemID == 0xFD)?"FreeDOS":"DOS-C", cfg->Version_Release?"Nightly":"Release", cfg->Version_Major, @@ -243,7 +243,7 @@ void displayConfigSettings(KernelConfig * cfg) ("Verbose=%d : -1=quiet, *0=normal, 1=verbose\n", cfg->Verbose); } - + if (cfg->ConfigSize >= 15) { printf diff --git a/sys/sys.c b/sys/sys.c index 5ad0b48e..280cf310 100644 --- a/sys/sys.c +++ b/sys/sys.c @@ -239,7 +239,7 @@ unsigned getcurdrive(void); "mov ah, 0x19" \ "int 0x21" \ "xor ah, ah" \ - value [ax]; + __value [__ax]; long filelength(int __handle); @@ -256,9 +256,9 @@ long filelength(int __handle); "int 0x21" \ "pop dx" \ "pop ax" \ - parm [bx] \ - modify [cx] \ - value [dx ax]; + __parm [__bx] \ + __modify [__cx] \ + __value [__dx __ax]; extern int unlink(const char *pathname); @@ -461,7 +461,7 @@ DOSBootFiles bootFiles[] = { #define OEM_DR 1 /* FD boot sector,(Enhanced) DR-DOS names */ #endif #ifdef WITHOEMCOMPATBS -#define OEM_PC 3 /* use PC-DOS compatible boot sector and names */ +#define OEM_PC 3 /* use PC-DOS compatible boot sector and names */ #define OEM_MS 4 /* use PC-DOS compatible BS with MS names */ #define OEM_W9x 5 /* use PC-DOS compatible BS with MS names */ #define OEM_RX 6 /* use PC-DOS compatible BS with Rx names */ @@ -813,7 +813,7 @@ void initOptions(int argc, char *argv[], SYSOptions *opts) { int slen; /* set source path, reserving room to append filename */ - if ( (argv[srcarg][1] == ':') || ((argv[srcarg][0]=='\\') && (argv[srcarg][1] == '\\')) ) + if ( (argv[srcarg][1] == ':') || ((argv[srcarg][0]=='\\') && (argv[srcarg][1] == '\\')) ) strncpy(opts->srcDrive, argv[srcarg], SYS_MAXPATH-13); else if (argv[srcarg][1] == '\0') /* assume 1 char is drive not path specifier */ sprintf(opts->srcDrive, "%c:", toupper(*(argv[srcarg]))); @@ -824,14 +824,14 @@ void initOptions(int argc, char *argv[], SYSOptions *opts) if ((slen>2) && (opts->srcDrive[slen-1] != '\\') && (opts->srcDrive[slen-1] != '/')) strcat(opts->srcDrive, "\\"); } - /* source path is now in form of just a drive, "X:" + /* source path is now in form of just a drive, "X:" or form of drive + path + directory separator, "X:\path\" or "\\path\" If just drive we try current path then root, else just indicated path. */ /* if source and dest are same drive, then source should not be root, - so if is same drive and not explicit path, force only current + so if is same drive and not explicit path, force only current Note: actual copy routine prevents overwriting self when src=dst */ if ( (opts->dstDrive == (toupper(*(opts->srcDrive))-'A')) && (!opts->srcDrive[2]) ) @@ -889,7 +889,7 @@ void initOptions(int argc, char *argv[], SYSOptions *opts) } /* if unable to determine DOS, assume FreeDOS */ - if (opts->flavor == OEM_AUTO) opts->flavor = + if (opts->flavor == OEM_AUTO) opts->flavor = #ifdef DRSYS OEM_EDR; #else @@ -990,13 +990,13 @@ int main(int argc, char **argv) printf(SYS_NAME SYS_VERSION ", " __DATE__ "\n"); if (opts.verbose) - printf("Processing boot sector...\n"); + printf("Processing boot sector...\n"); put_boot(&opts); if (opts.copyKernel) { - if (opts.verbose) - printf("Now copying system files...\n"); + if (opts.verbose) + printf("Now copying system files...\n"); sprintf(srcFile, "%s%s", opts.srcDrive, (opts.fnKernel)?opts.fnKernel:opts.kernel.kernel); if (!copy(&opts, srcFile, opts.dstDrive, opts.kernel.kernel)) @@ -1018,9 +1018,9 @@ int main(int argc, char **argv) if (opts.copyShell) { - if (opts.verbose) - printf("Copying shell (command interpreter)...\n"); - + if (opts.verbose) + printf("Copying shell (command interpreter)...\n"); + /* copy command.com, 1st try source path, then try %COMSPEC% */ sprintf(srcFile, "%s%s", opts.srcDrive, (opts.fnCmd)?opts.fnCmd:"COMMAND.COM"); if (!copy(&opts, srcFile, opts.dstDrive, "COMMAND.COM")) @@ -1037,7 +1037,7 @@ int main(int argc, char **argv) } if (opts.verbose) - printf("\n"); + printf("\n"); printf("System transferred.\n\n"); return 0; } @@ -1081,9 +1081,9 @@ int absread(int DosDrive, int nsects, int foo, void *diskReadPacket); "sbb ax, ax" \ "popf" \ "pop bp" \ - parm [ax] [cx] [dx] [bx] \ - modify [si di] \ - value [ax]; + __parm [__ax] [__cx] [__dx] [__bx] \ + __modify [__si __di] \ + __value [__ax]; int abswrite(int DosDrive, int nsects, int foo, void *diskReadPacket); #pragma aux abswrite = \ @@ -1092,9 +1092,9 @@ int abswrite(int DosDrive, int nsects, int foo, void *diskReadPacket); "sbb ax, ax" \ "popf" \ "pop bp" \ - parm [ax] [cx] [dx] [bx] \ - modify [si di] \ - value [ax]; + __parm [__ax] [__cx] [__dx] [__bx] \ + __modify [__si __di] \ + __value [__ax]; int fat32readwrite(int DosDrive, void *diskReadPacket, unsigned intno); #pragma aux fat32readwrite = \ @@ -1102,9 +1102,9 @@ int fat32readwrite(int DosDrive, void *diskReadPacket, unsigned intno); "mov cx, 0xffff" \ "int 0x21" \ "sbb ax, ax" \ - parm [dx] [bx] [si] \ - modify [cx dx si] \ - value [ax]; + __parm [__dx] [__bx] [__si] \ + __modify [__cx __dx __si] \ + __value [__ax]; void reset_drive(int DosDrive); #pragma aux reset_drive = \ @@ -1115,22 +1115,22 @@ void reset_drive(int DosDrive); "mov ah,0x32" \ "int 0x21" \ "pop ds" \ - parm [dx] \ - modify [ax bx]; + __parm [__dx] \ + __modify [__ax __bx]; void truename(char far *dest, const char *src); #pragma aux truename = \ "mov ah,0x60" \ "int 0x21" \ - parm [es di] [si]; + __parm [__es __di] [__si]; int generic_block_ioctl(unsigned drive, unsigned cx, unsigned char *par); #pragma aux generic_block_ioctl = \ "mov ax, 0x440d" \ "int 0x21" \ "sbb ax, ax" \ - value [ax] \ - parm [bx] [cx] [dx]; /* BH must be 0 for lock! */ + __value [__ax] \ + __parm [__bx] [__cx] [__dx]; /* BH must be 0 for lock! */ #else @@ -1167,7 +1167,7 @@ int fat32readwrite(int DosDrive, void *diskReadPacket, unsigned intno) regs.x.cx = 0xffff; regs.x.si = intno; intdos(®s, ®s); - + return regs.x.cflag; } /* fat32readwrite */ @@ -1242,8 +1242,8 @@ unsigned getextdrivespace(void far *drivename, void *buf, unsigned buf_size); "stc" \ "int 0x21" \ "sbb ax, ax" \ - parm [es dx] [di] [cx] \ - value [ax]; + __parm [__es __dx] [__di] [__cx] \ + __value [__ax]; #else /* !defined __WATCOMC__ */ @@ -1284,8 +1284,8 @@ BOOL haveLBA(void); /* return TRUE if we have LBA BIOS, FALSE otherwise */ "and cx, 1" \ "xchg cx, ax" \ "quit:" \ - modify [bx cx dx] \ - value [ax]; + __modify [__bx __cx __dx] \ + __value [__ax]; #else BOOL haveLBA(void) @@ -1538,8 +1538,8 @@ void put_boot(SYSOptions *opts) if (fs == FAT32) { - if (opts->verbose) - printf("FAT type: FAT32%s\n", smallfat32 ? " (small)" : ""); + if (opts->verbose) + printf("FAT type: FAT32%s\n", smallfat32 ? " (small)" : ""); /* get default bpb (but not for floppies) */ if (opts->dstDrive >= 2 && generic_block_ioctl(opts->dstDrive + 1, 0x4860, default_bpb) == 0) @@ -1566,8 +1566,8 @@ void put_boot(SYSOptions *opts) } else { /* copy the FAT12/16 CHS+LBA boot sector */ - if (opts->verbose) - printf("FAT type: FAT1%c\n", fs + '0' - 10); + if (opts->verbose) + printf("FAT type: FAT1%c\n", fs + '0' - 10); if (opts->dstDrive >= 2 && generic_block_ioctl(opts->dstDrive + 1, 0x860, default_bpb) == 0) correct_bpb((struct bootsectortype *)(default_bpb + 7 - 11), bs, opts->verbose); @@ -1582,7 +1582,7 @@ void put_boot(SYSOptions *opts) /* magic offset: LBA detection */ unsigned offset; offset = (fs == FAT16) ? 0x178 : 0x17B; - + if ( (newboot[offset]==0x84) && (newboot[offset+1]==0xD2) ) /* test dl,dl */ { /* if always use LBA then NOP out conditional jmp over LBA logic if A: */ @@ -1600,7 +1600,7 @@ void put_boot(SYSOptions *opts) else { printf("%s: Internal error: FAT1%c LBA detect unexpected content\n", - pgm, fs == FAT12 ? '2' : '6'); + pgm, fs == FAT12 ? '2' : '6'); exit(1); } } @@ -1646,12 +1646,12 @@ void put_boot(SYSOptions *opts) /* the location of the "0060" segment portion of the far pointer in the boot sector is just before cont: in boot*.asm. - This happens to be offset 0x78 for FAT32 and offset 0x5c for FAT16 + This happens to be offset 0x78 for FAT32 and offset 0x5c for FAT16 force use of value stored in bs by NOPping out mov [drive], dl 0x82: 88h,56h,40h for fat32 chs & lba boot sectors - i.e. BE CAREFUL WHEN YOU CHANGE THE BOOT SECTORS !!! + i.e. BE CAREFUL WHEN YOU CHANGE THE BOOT SECTORS !!! */ if (opts->kernel.stdbs) { @@ -1662,7 +1662,7 @@ void put_boot(SYSOptions *opts) exit(1); } *(int *)(&newboot[0x78]) = opts->kernel.loadaddr; - bsBiosMovOff = 0x82; /* magic offset: mov byte [bp + 40h], dl */ + bsBiosMovOff = 0x82; /* magic offset: mov byte [bp + 40h], dl */ } else /* compatible bs */ { @@ -1684,7 +1684,7 @@ void put_boot(SYSOptions *opts) /* the location of the "0060" segment portion of the far pointer in the boot sector is just before cont: in boot*.asm. - This happens to be offset 0x78 for FAT32 and offset 0x5c for FAT16 + This happens to be offset 0x78 for FAT32 and offset 0x5c for FAT16 The oem boot sectors do not have/need this value for patching. the location of the jmp address (patching from @@ -1696,8 +1696,8 @@ void put_boot(SYSOptions *opts) force use of value stored in bs by NOPping out mov [drive], dl 0x66: 88h,56h,24h for fat16 and fat12 boot sectors 0x4F: 88h,56h,24h for oem compatible fat16 and fat12 boot sectors - - i.e. BE CAREFUL WHEN YOU CHANGE THE BOOT SECTORS !!! + + i.e. BE CAREFUL WHEN YOU CHANGE THE BOOT SECTORS !!! */ if (opts->kernel.stdbs) { @@ -1705,12 +1705,12 @@ void put_boot(SYSOptions *opts) int defaultload = *(int *)(&newboot[0x5C]); if (defaultload != 0x60 && defaultload != 0x70) { printf("%s: Internal error: FAT1%c load seg unexpected content\n", - pgm, fs == FAT12 ? '2' : '6'); + pgm, fs == FAT12 ? '2' : '6'); exit(1); } /* this sets the segment we load the kernel to, default is 0x60:0 */ *(int *)(&newboot[0x5C]) = opts->kernel.loadaddr; - bsBiosMovOff = 0x66; /* magic offset: mov byte [bp + 24h], dl */ + bsBiosMovOff = 0x66; /* magic offset: mov byte [bp + 24h], dl */ } else { @@ -1728,10 +1728,10 @@ void put_boot(SYSOptions *opts) } if (defaultload != 0x0 && defaultload != 0x200) { printf("%s: Internal error: OEM FAT1%c load ofs unexpected content\n", - pgm, fs == FAT12 ? '2' : '6'); + pgm, fs == FAT12 ? '2' : '6'); exit(1); } - bsBiosMovOff = 0x4F; /* magic offset: mov byte [bp + 24h], dl */ + bsBiosMovOff = 0x4F; /* magic offset: mov byte [bp + 24h], dl */ } } @@ -1759,7 +1759,7 @@ void put_boot(SYSOptions *opts) printf("Root directory starts at sector (PREVIOUS + %u * %u)\n", bs->bsFATsecs, bs->bsFATs); } - + { int i = 0; /* magic offset: (first) kernel filename */ @@ -1810,7 +1810,7 @@ void put_boot(SYSOptions *opts) printf("Can't write new boot sector to drive %c:\n", opts->dstDrive + 'A'); exit(1); } - + /* for FAT32, we need to update the backup copy as well */ /* unless user has asked us not to, eg for better dual boot support */ /* Note: assuming sectors 1-5 & 7-11 (FSINFO+additional boot code) @@ -1920,15 +1920,15 @@ BOOL copy(SYSOptions *opts, const BYTE *source, COUNT drive, const BYTE * filena #endif if (opts->verbose) - printf("Copying %s...\n", source); + printf("Copying %s...\n", source); truename(src, source); sprintf(dest, "%c:\\%s", 'A' + drive, filename); if (stricmp(src, dest) == 0) { - if (opts->verbose) - printf("%s: source and destination are identical: skipping \"%s\"\n", - pgm, source); + if (opts->verbose) + printf("%s: source and destination are identical: skipping \"%s\"\n", + pgm, source); return TRUE; } @@ -1979,7 +1979,7 @@ BOOL copy(SYSOptions *opts, const BYTE *source, COUNT drive, const BYTE * filena BYTE far *buffer; BYTE far *bufptr; UWORD offs; unsigned chunk_size; - + /* get length of file to copy, then allocate enough memory for whole file */ filesize = filelength(fdin); if (alloc_dos_mem(filesize, &theseg)!=0) @@ -2065,7 +2065,7 @@ BOOL copy(SYSOptions *opts, const BYTE *source, COUNT drive, const BYTE * filena close(fdin); if (opts->verbose) - printf("%lu Bytes transferred\n", copied); + printf("%lu Bytes transferred\n", copied); return TRUE; } /* copy */