mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-23 13:54:30 +02:00
Merge pull request #2 from lpproj/underdesk
fix for fat16 build and DBCS
This commit is contained in:
commit
6e1274b1b3
@ -1563,6 +1563,24 @@ err:printf("%s has invalid format\n", filename);
|
|||||||
subf_data.length = /* MS-DOS "CTYINFO" is up to 38 bytes */
|
subf_data.length = /* MS-DOS "CTYINFO" is up to 38 bytes */
|
||||||
min(subf_data.length, sizeof(struct CountrySpecificInfo));
|
min(subf_data.length, sizeof(struct CountrySpecificInfo));
|
||||||
}
|
}
|
||||||
|
if (hdr[i].id == 7)
|
||||||
|
{
|
||||||
|
if (subf_data.length == 0)
|
||||||
|
{
|
||||||
|
/* if DBCS table (in country.sys) is empty, clear internal table */
|
||||||
|
*(DWORD *)(subf_data.buffer) = 0L;
|
||||||
|
fmemcpy((BYTE FAR *)(table[hdr[i].id].p), subf_data.buffer, 4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fmemcpy((BYTE FAR *)(table[hdr[i].id].p) + 2, subf_data.buffer, subf_data.length);
|
||||||
|
/* write length */
|
||||||
|
*(UWORD *)(subf_data.buffer) = subf_data.length;
|
||||||
|
fmemcpy((BYTE FAR *)(table[hdr[i].id].p), subf_data.buffer, 2);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
fmemcpy((BYTE FAR *)(table[hdr[i].id].p) + 2, subf_data.buffer,
|
fmemcpy((BYTE FAR *)(table[hdr[i].id].p) + 2, subf_data.buffer,
|
||||||
/* skip length ^*/ subf_data.length);
|
/* skip length ^*/ subf_data.length);
|
||||||
}
|
}
|
||||||
|
@ -868,10 +868,8 @@ dispatch:
|
|||||||
rc = DosGetCountryInformation(cntry, FP_DS_DX);
|
rc = DosGetCountryInformation(cntry, FP_DS_DX);
|
||||||
if (rc >= SUCCESS)
|
if (rc >= SUCCESS)
|
||||||
{
|
{
|
||||||
/* HACK FIXME */
|
|
||||||
if (cntry == (UWORD) - 1)
|
if (cntry == (UWORD) - 1)
|
||||||
cntry = 1;
|
cntry = nlsInfo.actPkg->cntry;
|
||||||
/* END OF HACK */
|
|
||||||
lr.AX = lr.BX = cntry;
|
lr.AX = lr.BX = cntry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@ _nlsCollHardcoded:
|
|||||||
GLOBAL _nlsDBCSHardcoded
|
GLOBAL _nlsDBCSHardcoded
|
||||||
_nlsDBCSHardcoded:
|
_nlsDBCSHardcoded:
|
||||||
?table7:
|
?table7:
|
||||||
DB 000h, 000h, 000h, 000h
|
DB 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
|
||||||
|
DB 000h, 000h
|
||||||
GLOBAL _hcTablesEnd
|
GLOBAL _hcTablesEnd
|
||||||
_hcTablesEnd:
|
_hcTablesEnd:
|
||||||
|
@ -53,7 +53,7 @@ large portions copied from task.c
|
|||||||
|
|
||||||
#define BUFSIZE 32768u
|
#define BUFSIZE 32768u
|
||||||
|
|
||||||
#define KERNEL_START 0x10 /* the kernel code really starts here at 60:10 */
|
#define KERNEL_START 0x16 /* the kernel code really starts here at 60:16 */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UWORD off, seg;
|
UWORD off, seg;
|
||||||
@ -97,6 +97,7 @@ static int exeflat(const char *srcfile, const char *dstfile,
|
|||||||
FILE *src, *dest;
|
FILE *src, *dest;
|
||||||
short silentdone = 0;
|
short silentdone = 0;
|
||||||
int compress_sys_file;
|
int compress_sys_file;
|
||||||
|
UWORD realentry;
|
||||||
|
|
||||||
if ((src = fopen(srcfile, "rb")) == NULL)
|
if ((src = fopen(srcfile, "rb")) == NULL)
|
||||||
{
|
{
|
||||||
@ -198,6 +199,16 @@ static int exeflat(const char *srcfile, const char *dstfile,
|
|||||||
printf("\nProcessed %d relocations, %d not shown\n",
|
printf("\nProcessed %d relocations, %d not shown\n",
|
||||||
header->exRelocItems, silentdone);
|
header->exRelocItems, silentdone);
|
||||||
|
|
||||||
|
realentry = KERNEL_START;
|
||||||
|
if (buffers[0][0] == 0xeb /* jmp short */)
|
||||||
|
{
|
||||||
|
realentry = buffers[0][1] + 2;
|
||||||
|
}
|
||||||
|
else if (buffers[0][0] == 0xe9 /* jmp near */)
|
||||||
|
{
|
||||||
|
realentry = ((UWORD)(buffers[0][2]) << 8) + buffers[0][1] + 3;
|
||||||
|
}
|
||||||
|
|
||||||
if ((dest = fopen(dstfile, "wb+")) == NULL)
|
if ((dest = fopen(dstfile, "wb+")) == NULL)
|
||||||
{
|
{
|
||||||
printf("Destination file %s could not be created\n", dstfile);
|
printf("Destination file %s could not be created\n", dstfile);
|
||||||
@ -250,8 +261,9 @@ static int exeflat(const char *srcfile, const char *dstfile,
|
|||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
dhdr[i] = 0xffff;
|
dhdr[i] = 0xffff;
|
||||||
/* strategy will jump to us, interrupt never called */
|
/* strategy will jump to us, interrupt never called */
|
||||||
dhdr[3] = KERNEL_START;
|
dhdr[3] = realentry; /* KERNEL_START; */
|
||||||
fwrite(dhdr, sizeof(dhdr), 1, dest);
|
fwrite(dhdr, sizeof(dhdr), 1, dest);
|
||||||
|
printf("KERNEL_START = 0x%04x\n", realentry);
|
||||||
}
|
}
|
||||||
fclose(dest);
|
fclose(dest);
|
||||||
return compress_sys_file;
|
return compress_sys_file;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user