Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/doscmd/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- Makefile 25 Jan 2008 20:02:08 -0000 1.8 +++ Makefile 20 Mar 2008 15:03:14 -0000 @@ -27,10 +27,7 @@ MAN1= doscmd.1 MANCOMPRESSED= yes -.include +post-patch: + ${REINPLACE_CMD} -e 's|ff00|ff|' ${WRKSRC}/int14.c -.if ${OSVERSION} >= 800000 -BROKEN= does not build -.endif - -.include +.include --- /dev/null 2008-03-20 16:03:26.000000000 +0100 +++ files/patch-dos.h 2008-03-20 15:59:30.000000000 +0100 @@ -0,0 +1,403 @@ +--- dos.h.orig 2008-03-20 15:59:15.000000000 +0100 ++++ dos.h 2008-03-20 15:52:44.000000000 +0100 +@@ -113,52 +113,60 @@ + u_char searchdir[1024]; + } search_t; + ++#if __FreeBSD_version >= 800000 ++# define PRE_PACKED __attribute__((packed)) ++# define IN_PACKED ++#else ++# define PRE_PACKED ++# define IN_PACKED __attribute__((packed)) ++#endif ++ + /* + * This is really the format of the DTA. The file redirector will only + * use the first 21 bytes. + */ +-typedef struct { +- u_char drive __attribute__ ((packed)); +- u_char pattern[11] __attribute__ ((packed)); +- u_char flag __attribute__ ((packed)); +- u_char reserved1[4] __attribute__ ((packed)); +- search_t *searchptr __attribute__ ((packed)); +- u_char attr __attribute__ ((packed)); +- u_short time __attribute__ ((packed)); +- u_short date __attribute__ ((packed)); +- u_long size __attribute__ ((packed)); +- u_char name[13] __attribute__ ((packed)); ++typedef struct PRE_PACKED { ++ u_char drive IN_PACKED; ++ u_char pattern[11] IN_PACKED; ++ u_char flag IN_PACKED; ++ u_char reserved1[4] IN_PACKED; ++ search_t *searchptr IN_PACKED; ++ u_char attr IN_PACKED; ++ u_short time IN_PACKED; ++ u_short date IN_PACKED; ++ u_long size IN_PACKED; ++ u_char name[13] IN_PACKED; + }/* __attribute__((__packed__))*/ find_block_t; + + /* + * DOS directory entry structure + */ +-typedef struct { +- u_char name[8] __attribute__ ((packed)); +- u_char ext[3] __attribute__ ((packed)); +- u_char attr __attribute__ ((packed)); +- u_char reserved[10] __attribute__ ((packed)); +- u_short time __attribute__ ((packed)); +- u_short date __attribute__ ((packed)); +- u_short start __attribute__ ((packed)); +- u_long size __attribute__ ((packed)); ++typedef struct PRE_PACKED { ++ u_char name[8] IN_PACKED; ++ u_char ext[3] IN_PACKED; ++ u_char attr IN_PACKED; ++ u_char reserved[10] IN_PACKED; ++ u_short time IN_PACKED; ++ u_short date IN_PACKED; ++ u_short start IN_PACKED; ++ u_long size IN_PACKED; + } dosdir_t; + + /* + * The Current Drive Structure + */ +-typedef struct { +- u_char path[0x43] __attribute__ ((packed)); +- u_short flag __attribute__ ((packed)); +- u_short dpb_off __attribute__ ((packed)); +- u_short dpb_seg __attribute__ ((packed)); +- u_short redirector_off __attribute__ ((packed)); +- u_short redirector_seg __attribute__ ((packed)); +- u_char paramter_int21[2] __attribute__ ((packed)); +- u_short offset __attribute__ ((packed)); +- u_char dummy __attribute__ ((packed)); +- u_char ifs_driver[4] __attribute__ ((packed)); +- u_char dummy2[2] __attribute__ ((packed)); ++typedef struct PRE_PACKED { ++ u_char path[0x43] IN_PACKED; ++ u_short flag IN_PACKED; ++ u_short dpb_off IN_PACKED; ++ u_short dpb_seg IN_PACKED; ++ u_short redirector_off IN_PACKED; ++ u_short redirector_seg IN_PACKED; ++ u_char paramter_int21[2] IN_PACKED; ++ u_short offset IN_PACKED; ++ u_char dummy IN_PACKED; ++ u_char ifs_driver[4] IN_PACKED; ++ u_char dummy2[2] IN_PACKED; + }/* __attribute__((__packed__))*/ CDS; + + #define CDS_remote 0x8000 +@@ -171,162 +179,162 @@ + /* + * The List of Lists (used to get the CDS and a few other numbers) + */ +-typedef struct { +- u_char dummy1[0x16] __attribute__ ((packed)); +- u_short cds_offset __attribute__ ((packed)); +- u_short cds_seg __attribute__ ((packed)); +- u_char dummy2[6] __attribute__ ((packed)); +- u_char numberbdev __attribute__ ((packed)); +- u_char lastdrive __attribute__ ((packed)); ++typedef struct PRE_PACKED { ++ u_char dummy1[0x16] IN_PACKED; ++ u_short cds_offset IN_PACKED; ++ u_short cds_seg IN_PACKED; ++ u_char dummy2[6] IN_PACKED; ++ u_char numberbdev IN_PACKED; ++ u_char lastdrive IN_PACKED; + } LOL; + + /* + * The System File Table + */ +-typedef struct { +-/*00*/ u_short nfiles __attribute__ ((packed)); /* Number file handles referring to this file */ +-/*02*/ u_short open_mode __attribute__ ((packed)); /* Open mode (bit 15 -> by FCB) */ +-/*04*/ u_char attribute __attribute__ ((packed)); +-/*05*/ u_short info __attribute__ ((packed)); /* 15 -> remote, 14 -> dont set date */ +-/*07*/ u_char ddr_dpb[4] __attribute__ ((packed)); /* Device Driver Header/Drive Paramter Block */ +-/*0b*/ u_short fd __attribute__ ((packed)); +-/*0d*/ u_short time __attribute__ ((packed)); +-/*0f*/ u_short date __attribute__ ((packed)); +-/*11*/ u_long size __attribute__ ((packed)); +-/*15*/ u_long offset __attribute__ ((packed)); +-/*19*/ u_short rel_cluster __attribute__ ((packed)); +-/*1b*/ u_short abs_cluster __attribute__ ((packed)); +-/*1d*/ u_char dir_sector[2] __attribute__ ((packed)); +-/*1f*/ u_char dir_entry __attribute__ ((packed)); +-/*20*/ u_char name[8] __attribute__ ((packed)); +-/*28*/ u_char ext[3] __attribute__ ((packed)); +-/*2b*/ u_char sharesft[4] __attribute__ ((packed)); +-/*2f*/ u_char sharenet[2] __attribute__ ((packed)); +-/*31*/ u_short psp __attribute__ ((packed)); +-/*33*/ u_char share_off[2] __attribute__ ((packed)); +-/*35*/ u_char local_end[2] __attribute__ ((packed)); +-/*37*/ u_char ifd_driver[4] __attribute__ ((packed)); ++typedef struct PRE_PACKED { ++/*00*/ u_short nfiles IN_PACKED; /* Number file handles referring to this file */ ++/*02*/ u_short open_mode IN_PACKED; /* Open mode (bit 15 -> by FCB) */ ++/*04*/ u_char attribute IN_PACKED; ++/*05*/ u_short info IN_PACKED; /* 15 -> remote, 14 -> dont set date */ ++/*07*/ u_char ddr_dpb[4] IN_PACKED; /* Device Driver Header/Drive Paramter Block */ ++/*0b*/ u_short fd IN_PACKED; ++/*0d*/ u_short time IN_PACKED; ++/*0f*/ u_short date IN_PACKED; ++/*11*/ u_long size IN_PACKED; ++/*15*/ u_long offset IN_PACKED; ++/*19*/ u_short rel_cluster IN_PACKED; ++/*1b*/ u_short abs_cluster IN_PACKED; ++/*1d*/ u_char dir_sector[2] IN_PACKED; ++/*1f*/ u_char dir_entry IN_PACKED; ++/*20*/ u_char name[8] IN_PACKED; ++/*28*/ u_char ext[3] IN_PACKED; ++/*2b*/ u_char sharesft[4] IN_PACKED; ++/*2f*/ u_char sharenet[2] IN_PACKED; ++/*31*/ u_short psp IN_PACKED; ++/*33*/ u_char share_off[2] IN_PACKED; ++/*35*/ u_char local_end[2] IN_PACKED; ++/*37*/ u_char ifd_driver[4] IN_PACKED; + } /*__attribute__((__packed__))*/ SFT; + + /* + * Format of PCDOS 4.01 swappable data area + * (Sorry, but you need a wide screen to make this look nice) + */ +-typedef struct { +- u_char err_crit __attribute__ ((packed)); /* 00h BYTE critical error flag */ +- u_char InDOS __attribute__ ((packed)); /* 01h BYTE InDOS flag (count of active INT 21 calls) */ +- u_char err_drive __attribute__ ((packed)); /* 02h BYTE ??? drive number or FFh */ +- u_char err_locus __attribute__ ((packed)); /* 03h BYTE locus of last error */ +- u_short err_code __attribute__ ((packed)); /* 04h WORD extended error code of last error */ +- u_char err_suggest __attribute__ ((packed)); /* 06h BYTE suggested action for last error */ +- u_char err_class __attribute__ ((packed)); /* 07h BYTE class of last error */ +- u_short err_di __attribute__ ((packed)); +- u_short err_es __attribute__ ((packed)); /* 08h DWORD ES:DI pointer for last error */ +- u_short dta_off __attribute__ ((packed)); +- u_short dta_seg __attribute__ ((packed)); /* 0Ch DWORD current DTA */ +- u_short psp __attribute__ ((packed)); /* 10h WORD current PSP */ +- u_short int_23_sp __attribute__ ((packed)); /* 12h WORD stores SP across an INT 23 */ +- u_short wait_status __attribute__ ((packed)); /* 14h WORD return code from last process termination (set to 0 after reading with AH=4Dh) */ +- u_char current_drive __attribute__ ((packed)); /* 16h BYTE current drive */ +- u_char break_flag __attribute__ ((packed)); /* 17h BYTE extended break flag */ +- u_char unknown1[2] __attribute__ ((packed)); /* 18h 2 BYTEs ??? */ +- u_short int_21_ax __attribute__ ((packed)); /* 1Ah WORD value of AX on call to INT 21 */ +- u_short net_psp __attribute__ ((packed)); /* 1Ch WORD PSP segment for sharing/network */ +- u_short net_number __attribute__ ((packed)); /* 1Eh WORD network machine number for sharing/network (0000h = us) */ +- u_short first_mem __attribute__ ((packed)); /* 20h WORD first usable memory block found when allocating memory */ +- u_short best_mem __attribute__ ((packed)); /* 22h WORD best usable memory block found when allocating memory */ +- u_short last_mem __attribute__ ((packed)); /* 24h WORD last usable memory block found when allocating memory */ +- u_char unknown[10] __attribute__ ((packed)); /* 26h 2 BYTEs ??? (don't seem to be referenced) */ +- u_char monthday __attribute__ ((packed)); /* 30h BYTE day of month */ +- u_char month __attribute__ ((packed)); /* 31h BYTE month */ +- u_short year __attribute__ ((packed)); /* 32h WORD year - 1980 */ +- u_short days __attribute__ ((packed)); /* 34h WORD number of days since 1-1-1980 */ +- u_char weekday __attribute__ ((packed)); /* 36h BYTE day of week (0 = Sunday) */ +- u_char unknown2[3] __attribute__ ((packed)); /* 37h BYTE ??? */ +- u_char ddr_head[30] __attribute__ ((packed)); /* 38h 30 BYTEs device driver request header */ +- u_short ddre_ip __attribute__ ((packed)); +- u_short ddre_cs __attribute__ ((packed)); /* 58h DWORD pointer to device driver entry point (used in calling driver) */ +- u_char ddr_head2[22] __attribute__ ((packed)); /* 5Ch 22 BYTEs device driver request header */ +- u_char ddr_head3[30] __attribute__ ((packed)); /* 72h 30 BYTEs device driver request header */ +- u_char unknown3[6] __attribute__ ((packed)); /* 90h 6 BYTEs ??? */ +- u_char clock_xfer[6] __attribute__ ((packed)); /* 96h 6 BYTEs CLOCK$ transfer record (see AH=52h) */ +- u_char unknown4[2] __attribute__ ((packed)); /* 9Ch 2 BYTEs ??? */ +- u_char filename1[128] __attribute__ ((packed)); /* 9Eh 128 BYTEs buffer for filename */ +- u_char filename2[128] __attribute__ ((packed)); /* 11Eh 128 BYTEs buffer for filename */ +- u_char findfirst[21] __attribute__ ((packed)); /* 19Eh 21 BYTEs findfirst/findnext search data block (see AH=4Eh) */ +- u_char foundentry[32] __attribute__ ((packed)); /* 1B3h 32 BYTEs directory entry for found file */ +- u_char cds[88] __attribute__ ((packed)); /* 1D3h 88 BYTEs copy of current directory structure for drive being accessed */ +- u_char fcbname[11] __attribute__ ((packed)); /* 22Bh 11 BYTEs ??? FCB-format filename */ +- u_char unknown5 __attribute__ ((packed)); /* 236h BYTE ??? */ +- u_char wildcard[11] __attribute__ ((packed)); /* 237h 11 BYTEs wildcard destination specification for rename (FCB format) */ +- u_char unknown6[11] __attribute__ ((packed)); /* 242h 2 BYTEs ??? */ +- u_char attrmask __attribute__ ((packed)); /* 24Dh BYTE attribute mask for directory search??? */ +- u_char open_mode __attribute__ ((packed)); /* 24Eh BYTE open mode */ +- u_char unknown7[3] __attribute__ ((packed)); /* 24fh BYTE ??? */ +- u_char virtual_dos __attribute__ ((packed)); /* 252h BYTE flag indicating how DOS function was invoked (00h = direct INT 20/INT 21, FFh = server call AX=5D00h) */ +- u_char unknown8[9] __attribute__ ((packed)); /* 253h BYTE ??? */ +- u_char term_type __attribute__ ((packed)); /* 25Ch BYTE type of process termination (00h-03h) */ +- u_char unknown9[3] __attribute__ ((packed)); /* 25Dh BYTE ??? */ +- u_short dpb_off __attribute__ ((packed)); +- u_short dpb_seg __attribute__ ((packed)); /* 260h DWORD pointer to Drive Parameter Block for critical error invocation */ +- u_short int21_sf_off __attribute__ ((packed)); +- u_short int21_sf_seg __attribute__ ((packed)); /* 264h DWORD pointer to stack frame containing user registers on INT 21 */ +- u_short store_sp __attribute__ ((packed)); /* 268h WORD stores SP??? */ +- u_short dosdpb_off __attribute__ ((packed)); +- u_short dosdpb_seg __attribute__ ((packed)); /* 26Ah DWORD pointer to DOS Drive Parameter Block for ??? */ +- u_short disk_buf_seg __attribute__ ((packed)); /* 26Eh WORD segment of disk buffer */ +- u_short unknown10[4] __attribute__ ((packed)); /* 270h WORD ??? */ +- u_char media_id __attribute__ ((packed)); /* 278h BYTE Media ID byte returned by AH=1Bh,1Ch */ +- u_char unknown11 __attribute__ ((packed)); /* 279h BYTE ??? (doesn't seem to be referenced) */ +- u_short unknown12[2] __attribute__ ((packed)); /* 27Ah DWORD pointer to ??? */ +- u_short sft_off __attribute__ ((packed)); +- u_short sft_seg __attribute__ ((packed)); /* 27Eh DWORD pointer to current SFT */ +- u_short cds_off __attribute__ ((packed)); +- u_short cds_seg __attribute__ ((packed)); /* 282h DWORD pointer to current directory structure for drive being accessed */ +- u_short fcb_off __attribute__ ((packed)); +- u_short fcb_seg __attribute__ ((packed)); /* 286h DWORD pointer to caller's FCB */ +- u_short unknown13[2] __attribute__ ((packed)); /* 28Ah WORD ??? */ +- u_short jft_off __attribute__ ((packed)); +- u_short jft_seg __attribute__ ((packed)); /* 28Eh DWORD pointer to a JFT entry in process handle table (see AH=26h) */ +- u_short filename1_off __attribute__ ((packed)); /* 292h WORD offset in DOS CS of first filename argument */ +- u_short filename2_off __attribute__ ((packed)); /* 294h WORD offset in DOS CS of second filename argument */ +- u_short unknown14[12] __attribute__ ((packed)); /* 296h WORD ??? */ +- u_short file_offset_lo __attribute__ ((packed)); +- u_short file_offset_hi __attribute__ ((packed)); /* 2AEh DWORD offset in file??? */ +- u_short unknown15 __attribute__ ((packed)); /* 2B2h WORD ??? */ +- u_short partial_bytes __attribute__ ((packed)); /* 2B4h WORD bytes in partial sector */ +- u_short number_sectors __attribute__ ((packed)); /* 2B6h WORD number of sectors */ +- u_short unknown16[3] __attribute__ ((packed)); /* 2B8h WORD ??? */ +- u_short nbytes_lo __attribute__ ((packed)); +- u_short nbytes_hi __attribute__ ((packed)); /* 2BEh DWORD number of bytes appended to file */ +- u_short qpdb_off __attribute__ ((packed)); +- u_short qpdb_seg __attribute__ ((packed)); /* 2C2h DWORD pointer to ??? disk buffer */ +- u_short asft_off __attribute__ ((packed)); +- u_short asft_seg __attribute__ ((packed)); /* 2C6h DWORD pointer to ??? SFT */ +- u_short int21_bx __attribute__ ((packed)); /* 2CAh WORD used by INT 21 dispatcher to store caller's BX */ +- u_short int21_ds __attribute__ ((packed)); /* 2CCh WORD used by INT 21 dispatcher to store caller's DS */ +- u_short temporary __attribute__ ((packed)); /* 2CEh WORD temporary storage while saving/restoring caller's registers */ +- u_short prevcall_off __attribute__ ((packed)); +- u_short prevcall_seg __attribute__ ((packed)); /* 2D0h DWORD pointer to prev call frame (offset 264h) if INT 21 reentered also switched to for duration of INT 24 */ +- u_char unknown17[9] __attribute__ ((packed)); /* 2D4h WORD ??? */ +- u_short ext_action __attribute__ ((packed)); /* 2DDh WORD multipurpose open action */ +- u_short ext_attr __attribute__ ((packed)); /* 2DFh WORD multipurpose attribute */ +- u_short ext_mode __attribute__ ((packed)); /* 2E1h WORD multipurpose mode */ +- u_char unknown17a[9] __attribute__ ((packed)); +- u_short lol_ds __attribute__ ((packed)); /* 2ECh WORD stores DS during call to [List-of-Lists + 37h] */ +- u_char unknown18[5] __attribute__ ((packed)); /* 2EEh WORD ??? */ +- u_char usernameptr[4] __attribute__ ((packed)); /* 2F3h DWORD pointer to user-supplied filename */ +- u_char unknown19[4] __attribute__ ((packed)); /* 2F7h DWORD pointer to ??? */ +- u_char lol_ss[2] __attribute__ ((packed)); /* 2FBh WORD stores SS during call to [List-of-Lists + 37h] */ +- u_char lol_sp[2] __attribute__ ((packed)); /* 2FDh WORD stores SP during call to [List-of-Lists + 37h] */ +- u_char lol_flag __attribute__ ((packed)); /* 2FFh BYTE flag, nonzero if stack switched in calling [List-of-Lists+37h] */ +- u_char searchdata[21] __attribute__ ((packed)); /* 300h 21 BYTEs FindFirst search data for source file(s) of a rename operation (see AH=4Eh) */ +- u_char renameentry[32] __attribute__ ((packed)); /* 315h 32 BYTEs directory entry for file being renamed */ +- u_char errstack[331] __attribute__ ((packed)); /* 335h 331 BYTEs critical error stack */ +- u_char diskstack[384] __attribute__ ((packed)); /* 480h 384 BYTEs disk stack (functions greater than 0Ch, INT 25, INT 26) */ +- u_char iostack[384] __attribute__ ((packed)); /* 600h 384 BYTEs character I/O stack (functions 01h through 0Ch) */ +- u_char int_21_08_flag __attribute__ ((packed)); /* 780h BYTE flag affecting AH=08h (see AH=64h) */ +- u_char unknown20[11] __attribute__ ((packed)); /* 781h BYTE ??? looks like a drive number */ ++typedef struct PRE_PACKED { ++ u_char err_crit IN_PACKED; /* 00h BYTE critical error flag */ ++ u_char InDOS IN_PACKED; /* 01h BYTE InDOS flag (count of active INT 21 calls) */ ++ u_char err_drive IN_PACKED; /* 02h BYTE ??? drive number or FFh */ ++ u_char err_locus IN_PACKED; /* 03h BYTE locus of last error */ ++ u_short err_code IN_PACKED; /* 04h WORD extended error code of last error */ ++ u_char err_suggest IN_PACKED; /* 06h BYTE suggested action for last error */ ++ u_char err_class IN_PACKED; /* 07h BYTE class of last error */ ++ u_short err_di IN_PACKED; ++ u_short err_es IN_PACKED; /* 08h DWORD ES:DI pointer for last error */ ++ u_short dta_off IN_PACKED; ++ u_short dta_seg IN_PACKED; /* 0Ch DWORD current DTA */ ++ u_short psp IN_PACKED; /* 10h WORD current PSP */ ++ u_short int_23_sp IN_PACKED; /* 12h WORD stores SP across an INT 23 */ ++ u_short wait_status IN_PACKED; /* 14h WORD return code from last process termination (set to 0 after reading with AH=4Dh) */ ++ u_char current_drive IN_PACKED; /* 16h BYTE current drive */ ++ u_char break_flag IN_PACKED; /* 17h BYTE extended break flag */ ++ u_char unknown1[2] IN_PACKED; /* 18h 2 BYTEs ??? */ ++ u_short int_21_ax IN_PACKED; /* 1Ah WORD value of AX on call to INT 21 */ ++ u_short net_psp IN_PACKED; /* 1Ch WORD PSP segment for sharing/network */ ++ u_short net_number IN_PACKED; /* 1Eh WORD network machine number for sharing/network (0000h = us) */ ++ u_short first_mem IN_PACKED; /* 20h WORD first usable memory block found when allocating memory */ ++ u_short best_mem IN_PACKED; /* 22h WORD best usable memory block found when allocating memory */ ++ u_short last_mem IN_PACKED; /* 24h WORD last usable memory block found when allocating memory */ ++ u_char unknown[10] IN_PACKED; /* 26h 2 BYTEs ??? (don't seem to be referenced) */ ++ u_char monthday IN_PACKED; /* 30h BYTE day of month */ ++ u_char month IN_PACKED; /* 31h BYTE month */ ++ u_short year IN_PACKED; /* 32h WORD year - 1980 */ ++ u_short days IN_PACKED; /* 34h WORD number of days since 1-1-1980 */ ++ u_char weekday IN_PACKED; /* 36h BYTE day of week (0 = Sunday) */ ++ u_char unknown2[3] IN_PACKED; /* 37h BYTE ??? */ ++ u_char ddr_head[30] IN_PACKED; /* 38h 30 BYTEs device driver request header */ ++ u_short ddre_ip IN_PACKED; ++ u_short ddre_cs IN_PACKED; /* 58h DWORD pointer to device driver entry point (used in calling driver) */ ++ u_char ddr_head2[22] IN_PACKED; /* 5Ch 22 BYTEs device driver request header */ ++ u_char ddr_head3[30] IN_PACKED; /* 72h 30 BYTEs device driver request header */ ++ u_char unknown3[6] IN_PACKED; /* 90h 6 BYTEs ??? */ ++ u_char clock_xfer[6] IN_PACKED; /* 96h 6 BYTEs CLOCK$ transfer record (see AH=52h) */ ++ u_char unknown4[2] IN_PACKED; /* 9Ch 2 BYTEs ??? */ ++ u_char filename1[128] IN_PACKED; /* 9Eh 128 BYTEs buffer for filename */ ++ u_char filename2[128] IN_PACKED; /* 11Eh 128 BYTEs buffer for filename */ ++ u_char findfirst[21] IN_PACKED; /* 19Eh 21 BYTEs findfirst/findnext search data block (see AH=4Eh) */ ++ u_char foundentry[32] IN_PACKED; /* 1B3h 32 BYTEs directory entry for found file */ ++ u_char cds[88] IN_PACKED; /* 1D3h 88 BYTEs copy of current directory structure for drive being accessed */ ++ u_char fcbname[11] IN_PACKED; /* 22Bh 11 BYTEs ??? FCB-format filename */ ++ u_char unknown5 IN_PACKED; /* 236h BYTE ??? */ ++ u_char wildcard[11] IN_PACKED; /* 237h 11 BYTEs wildcard destination specification for rename (FCB format) */ ++ u_char unknown6[11] IN_PACKED; /* 242h 2 BYTEs ??? */ ++ u_char attrmask IN_PACKED; /* 24Dh BYTE attribute mask for directory search??? */ ++ u_char open_mode IN_PACKED; /* 24Eh BYTE open mode */ ++ u_char unknown7[3] IN_PACKED; /* 24fh BYTE ??? */ ++ u_char virtual_dos IN_PACKED; /* 252h BYTE flag indicating how DOS function was invoked (00h = direct INT 20/INT 21, FFh = server call AX=5D00h) */ ++ u_char unknown8[9] IN_PACKED; /* 253h BYTE ??? */ ++ u_char term_type IN_PACKED; /* 25Ch BYTE type of process termination (00h-03h) */ ++ u_char unknown9[3] IN_PACKED; /* 25Dh BYTE ??? */ ++ u_short dpb_off IN_PACKED; ++ u_short dpb_seg IN_PACKED; /* 260h DWORD pointer to Drive Parameter Block for critical error invocation */ ++ u_short int21_sf_off IN_PACKED; ++ u_short int21_sf_seg IN_PACKED; /* 264h DWORD pointer to stack frame containing user registers on INT 21 */ ++ u_short store_sp IN_PACKED; /* 268h WORD stores SP??? */ ++ u_short dosdpb_off IN_PACKED; ++ u_short dosdpb_seg IN_PACKED; /* 26Ah DWORD pointer to DOS Drive Parameter Block for ??? */ ++ u_short disk_buf_seg IN_PACKED; /* 26Eh WORD segment of disk buffer */ ++ u_short unknown10[4] IN_PACKED; /* 270h WORD ??? */ ++ u_char media_id IN_PACKED; /* 278h BYTE Media ID byte returned by AH=1Bh,1Ch */ ++ u_char unknown11 IN_PACKED; /* 279h BYTE ??? (doesn't seem to be referenced) */ ++ u_short unknown12[2] IN_PACKED; /* 27Ah DWORD pointer to ??? */ ++ u_short sft_off IN_PACKED; ++ u_short sft_seg IN_PACKED; /* 27Eh DWORD pointer to current SFT */ ++ u_short cds_off IN_PACKED; ++ u_short cds_seg IN_PACKED; /* 282h DWORD pointer to current directory structure for drive being accessed */ ++ u_short fcb_off IN_PACKED; ++ u_short fcb_seg IN_PACKED; /* 286h DWORD pointer to caller's FCB */ ++ u_short unknown13[2] IN_PACKED; /* 28Ah WORD ??? */ ++ u_short jft_off IN_PACKED; ++ u_short jft_seg IN_PACKED; /* 28Eh DWORD pointer to a JFT entry in process handle table (see AH=26h) */ ++ u_short filename1_off IN_PACKED; /* 292h WORD offset in DOS CS of first filename argument */ ++ u_short filename2_off IN_PACKED; /* 294h WORD offset in DOS CS of second filename argument */ ++ u_short unknown14[12] IN_PACKED; /* 296h WORD ??? */ ++ u_short file_offset_lo IN_PACKED; ++ u_short file_offset_hi IN_PACKED; /* 2AEh DWORD offset in file??? */ ++ u_short unknown15 IN_PACKED; /* 2B2h WORD ??? */ ++ u_short partial_bytes IN_PACKED; /* 2B4h WORD bytes in partial sector */ ++ u_short number_sectors IN_PACKED; /* 2B6h WORD number of sectors */ ++ u_short unknown16[3] IN_PACKED; /* 2B8h WORD ??? */ ++ u_short nbytes_lo IN_PACKED; ++ u_short nbytes_hi IN_PACKED; /* 2BEh DWORD number of bytes appended to file */ ++ u_short qpdb_off IN_PACKED; ++ u_short qpdb_seg IN_PACKED; /* 2C2h DWORD pointer to ??? disk buffer */ ++ u_short asft_off IN_PACKED; ++ u_short asft_seg IN_PACKED; /* 2C6h DWORD pointer to ??? SFT */ ++ u_short int21_bx IN_PACKED; /* 2CAh WORD used by INT 21 dispatcher to store caller's BX */ ++ u_short int21_ds IN_PACKED; /* 2CCh WORD used by INT 21 dispatcher to store caller's DS */ ++ u_short temporary IN_PACKED; /* 2CEh WORD temporary storage while saving/restoring caller's registers */ ++ u_short prevcall_off IN_PACKED; ++ u_short prevcall_seg IN_PACKED; /* 2D0h DWORD pointer to prev call frame (offset 264h) if INT 21 reentered also switched to for duration of INT 24 */ ++ u_char unknown17[9] IN_PACKED; /* 2D4h WORD ??? */ ++ u_short ext_action IN_PACKED; /* 2DDh WORD multipurpose open action */ ++ u_short ext_attr IN_PACKED; /* 2DFh WORD multipurpose attribute */ ++ u_short ext_mode IN_PACKED; /* 2E1h WORD multipurpose mode */ ++ u_char unknown17a[9] IN_PACKED; ++ u_short lol_ds IN_PACKED; /* 2ECh WORD stores DS during call to [List-of-Lists + 37h] */ ++ u_char unknown18[5] IN_PACKED; /* 2EEh WORD ??? */ ++ u_char usernameptr[4] IN_PACKED; /* 2F3h DWORD pointer to user-supplied filename */ ++ u_char unknown19[4] IN_PACKED; /* 2F7h DWORD pointer to ??? */ ++ u_char lol_ss[2] IN_PACKED; /* 2FBh WORD stores SS during call to [List-of-Lists + 37h] */ ++ u_char lol_sp[2] IN_PACKED; /* 2FDh WORD stores SP during call to [List-of-Lists + 37h] */ ++ u_char lol_flag IN_PACKED; /* 2FFh BYTE flag, nonzero if stack switched in calling [List-of-Lists+37h] */ ++ u_char searchdata[21] IN_PACKED; /* 300h 21 BYTEs FindFirst search data for source file(s) of a rename operation (see AH=4Eh) */ ++ u_char renameentry[32] IN_PACKED; /* 315h 32 BYTEs directory entry for file being renamed */ ++ u_char errstack[331] IN_PACKED; /* 335h 331 BYTEs critical error stack */ ++ u_char diskstack[384] IN_PACKED; /* 480h 384 BYTEs disk stack (functions greater than 0Ch, INT 25, INT 26) */ ++ u_char iostack[384] IN_PACKED; /* 600h 384 BYTEs character I/O stack (functions 01h through 0Ch) */ ++ u_char int_21_08_flag IN_PACKED; /* 780h BYTE flag affecting AH=08h (see AH=64h) */ ++ u_char unknown20[11] IN_PACKED; /* 781h BYTE ??? looks like a drive number */ + } /*__attribute__((__packed__))*/ SDA; + + struct exehdr { --- /dev/null 2008-03-20 16:03:32.000000000 +0100 +++ files/patch-ems.h 2008-03-20 15:54:43.000000000 +0100 @@ -0,0 +1,31 @@ +--- ems.h.orig 2008-03-20 15:52:49.000000000 +0100 ++++ ems.h 2008-03-20 15:54:29.000000000 +0100 +@@ -296,18 +296,18 @@ + * DOS + */ + +-typedef struct { +- u_long length __attribute__ ((packed)); /* length of region */ ++typedef struct PRE_PACKED { ++ u_long length IN_PACKED; /* length of region */ + #define EMS_MOVE_CONV 0 + #define EMS_MOVE_EMS 1 +- u_char src_type __attribute__ ((packed)); /* source type (0,1) */ +- u_short src_handle __attribute__ ((packed)); /* source handle */ +- u_short src_offset __attribute__ ((packed)); /* source offset */ +- u_short src_seg __attribute__ ((packed)); /* source type */ +- u_char dst_type __attribute__ ((packed)); /* destination type (0,1) */ +- u_short dst_handle __attribute__ ((packed)); /* destination handle */ +- u_short dst_offset __attribute__ ((packed)); /* destination offset */ +- u_short dst_seg __attribute__ ((packed)); /* destination type */ ++ u_char src_type IN_PACKED; /* source type (0,1) */ ++ u_short src_handle IN_PACKED; /* source handle */ ++ u_short src_offset IN_PACKED; /* source offset */ ++ u_short src_seg IN_PACKED; /* source type */ ++ u_char dst_type IN_PACKED; /* destination type (0,1) */ ++ u_short dst_handle IN_PACKED; /* destination handle */ ++ u_short dst_offset IN_PACKED; /* destination offset */ ++ u_short dst_seg IN_PACKED; /* destination type */ + } EMSmovemem; + + #endif /* EMS_H */ --- /dev/null 2008-03-20 16:03:39.000000000 +0100 +++ files/patch-xms.h 2008-03-20 15:59:07.000000000 +0100 @@ -0,0 +1,18 @@ +--- xms.h.orig 2008-03-20 15:58:53.000000000 +0100 ++++ xms.h 2008-03-20 15:58:44.000000000 +0100 +@@ -110,11 +110,11 @@ + * DOS + */ + +-struct XMSinfo { ++struct PRE_PACKED XMSinfo { + u_char handle; /* the handle */ +- u_char num_locks __attribute__ ((packed)); /* number of locks */ +- u_long size __attribute__ ((packed)); /* size of memory */ +- u_long phys_addr __attribute__ ((packed)); /* "physical" address */ ++ u_char num_locks IN_PACKED; /* number of locks */ ++ u_long size IN_PACKED; /* size of memory */ ++ u_long phys_addr IN_PACKED; /* "physical" address */ + }; + + /*