mirror of
https://github.com/FDOS/kernel.git
synced 2025-04-08 17:15:17 +02:00
Lucho reported that MSC compiled kernels now work after all. Let's mark
those nasty "BSS" variables explicitly then to try to avoid future problems. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@880 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
6f6ceadebc
commit
68c3f9ad13
@ -31,8 +31,8 @@ enable it.
|
||||
|
||||
This kernel compiles with Turbo C 2.01, Turbo C++ 1.01 (now freely
|
||||
available!), Turbo C 3.0, Borland C 4.51 & 5.01. It should work with
|
||||
other Borland compilers and (Open)Watcom C. Microsoft C and GCC can
|
||||
compile the kernel but the result does *not* work.
|
||||
other Borland and Microsoft compilers and (Open)Watcom C. GCC can
|
||||
compile the kernel but the result does *not* work (no 16-bit x86 support).
|
||||
|
||||
The OpenWatcom 1.0 compiler (or later) for DOS can be downloaded at
|
||||
www.openwatcom.org: you need at least the following zips from
|
||||
|
@ -58,9 +58,9 @@ struct MenuSelector
|
||||
};
|
||||
|
||||
/** Structure below holds the menu-strings */
|
||||
STATIC struct MenuSelector MenuStruct[MENULINESMAX];
|
||||
STATIC struct MenuSelector MenuStruct[MENULINESMAX] BSS_INIT({0});
|
||||
|
||||
int nMenuLine;
|
||||
int nMenuLine BSS_INIT(0);
|
||||
BOOL MenuColor = -1;
|
||||
|
||||
STATIC void WriteMenuLine(int MenuSelected)
|
||||
@ -116,13 +116,13 @@ STATIC void SelectLine(int MenuSelected)
|
||||
WriteMenuLine(MenuSelected);
|
||||
}
|
||||
|
||||
UWORD umb_start, UMB_top;
|
||||
UWORD ram_top; /* How much ram in Kbytes */
|
||||
size_t ebda_size;
|
||||
UWORD umb_start BSS_INIT(0), UMB_top BSS_INIT(0);
|
||||
UWORD ram_top BSS_INIT(0); /* How much ram in Kbytes */
|
||||
size_t ebda_size BSS_INIT(0);
|
||||
|
||||
static UBYTE ErrorAlreadyPrinted[128];
|
||||
static UBYTE ErrorAlreadyPrinted[128] BSS_INIT({0});
|
||||
|
||||
char master_env[128];
|
||||
char master_env[128] BSS_INIT({0});
|
||||
static char *envp = master_env;
|
||||
|
||||
struct config Config = {
|
||||
@ -148,23 +148,23 @@ struct config Config = {
|
||||
, 0xFFFF /* default value for switches=/E:nnnn */
|
||||
};
|
||||
|
||||
STATIC seg base_seg;
|
||||
STATIC seg umb_base_seg;
|
||||
BYTE FAR *lpTop;
|
||||
STATIC unsigned nCfgLine;
|
||||
COUNT UmbState;
|
||||
STATIC BYTE szLine[256];
|
||||
STATIC BYTE szBuf[256];
|
||||
STATIC seg base_seg BSS_INIT(0);
|
||||
STATIC seg umb_base_seg BSS_INIT(0);
|
||||
BYTE FAR *lpTop BSS_INIT(0);
|
||||
STATIC unsigned nCfgLine BSS_INIT(0);
|
||||
COUNT UmbState BSS_INIT(0);
|
||||
STATIC BYTE szLine[256] BSS_INIT({0});
|
||||
STATIC BYTE szBuf[256] BSS_INIT({0});
|
||||
|
||||
BYTE singleStep; /* F8 processing */
|
||||
BYTE SkipAllConfig; /* F5 processing */
|
||||
BYTE askThisSingleCommand; /* ?device= device?= */
|
||||
BYTE DontAskThisSingleCommand; /* !files= */
|
||||
BYTE singleStep BSS_INIT(FALSE); /* F8 processing */
|
||||
BYTE SkipAllConfig BSS_INIT(FALSE); /* F5 processing */
|
||||
BYTE askThisSingleCommand BSS_INIT(FALSE); /* ?device= device?= */
|
||||
BYTE DontAskThisSingleCommand BSS_INIT(FALSE); /* !files= */
|
||||
|
||||
COUNT MenuTimeout = -1;
|
||||
BYTE MenuSelected;
|
||||
UCOUNT MenuLine;
|
||||
UCOUNT Menus;
|
||||
BYTE MenuSelected BSS_INIT(0);
|
||||
UCOUNT MenuLine BSS_INIT(0);
|
||||
UCOUNT Menus BSS_INIT(0);
|
||||
|
||||
STATIC VOID CfgMenuColor(BYTE * pLine);
|
||||
|
||||
@ -313,9 +313,9 @@ int findend(BYTE * s)
|
||||
return nLen;
|
||||
}
|
||||
|
||||
BYTE *pLineStart;
|
||||
BYTE *pLineStart BSS_INIT(0);
|
||||
|
||||
BYTE HMAState;
|
||||
BYTE HMAState BSS_INIT(0);
|
||||
#define HMA_NONE 0 /* do nothing */
|
||||
#define HMA_REQ 1 /* DOS = HIGH detected */
|
||||
#define HMA_DONE 2 /* Moved kernel to HMA */
|
||||
@ -1634,7 +1634,7 @@ STATIC VOID mcb_init_copy(UCOUNT seg, UWORD size, mcb *near_mcb)
|
||||
|
||||
STATIC VOID mcb_init(UCOUNT seg, UWORD size, BYTE type)
|
||||
{
|
||||
static mcb near_mcb;
|
||||
static mcb near_mcb BSS_INIT({0});
|
||||
near_mcb.m_type = type;
|
||||
mcb_init_copy(seg, size, &near_mcb);
|
||||
}
|
||||
|
@ -25,6 +25,20 @@
|
||||
#include "init-dat.h"
|
||||
|
||||
#include "kconfig.h"
|
||||
|
||||
/* MSC places uninitialized data into COMDEF records,
|
||||
that end up in DATA segment. this can't be tolerated in INIT code.
|
||||
please make sure, that ALL data in INIT is initialized !!
|
||||
|
||||
These guys are marked BSS_INIT to mark that they really should be BSS
|
||||
but can't be because of MS
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#define BSS_INIT(x) = x
|
||||
#else
|
||||
#define BSS_INIT(x)
|
||||
#endif
|
||||
|
||||
extern struct _KernelConfig InitKernelConfig;
|
||||
|
||||
/*
|
||||
|
@ -32,8 +32,8 @@ static BYTE *dskRcsId =
|
||||
"$Id$";
|
||||
#endif
|
||||
|
||||
UBYTE InitDiskTransferBuffer[SEC_SIZE];
|
||||
COUNT nUnits;
|
||||
UBYTE InitDiskTransferBuffer[SEC_SIZE] BSS_INIT({0});
|
||||
COUNT nUnits BSS_INIT(0);
|
||||
|
||||
/*
|
||||
* Rev 1.0 13 May 2001 tom ehlert
|
||||
|
@ -71,9 +71,9 @@ static BYTE *RcsId =
|
||||
"$Id$";
|
||||
#endif
|
||||
|
||||
BYTE DosLoadedInHMA = FALSE; /* set to TRUE if loaded HIGH */
|
||||
BYTE HMAclaimed = FALSE; /* set to TRUE if claimed from HIMEM */
|
||||
UWORD HMAFree = 0; /* first byte in HMA not yet used */
|
||||
BYTE DosLoadedInHMA BSS_INIT(FALSE); /* set to TRUE if loaded HIGH */
|
||||
BYTE HMAclaimed BSS_INIT(0); /* set to TRUE if claimed from HIMEM */
|
||||
UWORD HMAFree BSS_INIT(0); /* first byte in HMA not yet used */
|
||||
|
||||
STATIC void InstallVDISK(void);
|
||||
|
||||
|
@ -43,7 +43,7 @@ static char copyright[] =
|
||||
"GNU General Public License as published by the Free Software Foundation;\n"
|
||||
"either version 2, or (at your option) any later version.\n";
|
||||
|
||||
struct _KernelConfig InitKernelConfig;
|
||||
struct _KernelConfig InitKernelConfig BSS_INIT({0});
|
||||
|
||||
STATIC VOID InitIO(void);
|
||||
|
||||
@ -64,12 +64,10 @@ __segment DosDataSeg = 0; /* serves for all references to the DOS DATA seg
|
||||
*/
|
||||
__segment DosTextSeg = 0;
|
||||
|
||||
struct lol FAR *LoL;
|
||||
|
||||
#else
|
||||
struct lol FAR *LoL = &DATASTART;
|
||||
#endif
|
||||
|
||||
struct lol FAR *LoL = &DATASTART;
|
||||
|
||||
VOID ASMCFUNC FreeDOSmain(void)
|
||||
{
|
||||
unsigned char drv;
|
||||
@ -79,7 +77,6 @@ VOID ASMCFUNC FreeDOSmain(void)
|
||||
extern FAR prn_dev;
|
||||
DosDataSeg = (__segment) & DATASTART;
|
||||
DosTextSeg = (__segment) & prn_dev;
|
||||
LoL = &DATASTART;
|
||||
#endif
|
||||
|
||||
/* if the kernel has been UPX'ed,
|
||||
|
Loading…
x
Reference in New Issue
Block a user