mirror of https://github.com/FDOS/kernel.git
add some comments regarding relocation of kernel during configuration
This commit is contained in:
parent
114236da17
commit
a593799eb0
|
@ -305,6 +305,7 @@ VOID FAR * HMAalloc(COUNT bytesToAllocate)
|
||||||
|
|
||||||
unsigned CurrentKernelSegment = 0;
|
unsigned CurrentKernelSegment = 0;
|
||||||
|
|
||||||
|
/* relocate segment with HMA_TEXT code group */
|
||||||
void MoveKernel(unsigned NewKernelSegment)
|
void MoveKernel(unsigned NewKernelSegment)
|
||||||
{
|
{
|
||||||
UBYTE FAR *HMADest;
|
UBYTE FAR *HMADest;
|
||||||
|
@ -312,9 +313,11 @@ void MoveKernel(unsigned NewKernelSegment)
|
||||||
unsigned len;
|
unsigned len;
|
||||||
unsigned jmpseg = CurrentKernelSegment;
|
unsigned jmpseg = CurrentKernelSegment;
|
||||||
|
|
||||||
|
/* if the first time called, initialize to end of HMA_TEXT code group segment */
|
||||||
if (CurrentKernelSegment == 0)
|
if (CurrentKernelSegment == 0)
|
||||||
CurrentKernelSegment = FP_SEG(_HMATextEnd);
|
CurrentKernelSegment = FP_SEG(_HMATextEnd);
|
||||||
|
|
||||||
|
/* if already relocated into HMA, nothing to do */
|
||||||
if (CurrentKernelSegment == 0xffff)
|
if (CurrentKernelSegment == 0xffff)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -324,6 +327,8 @@ void MoveKernel(unsigned NewKernelSegment)
|
||||||
|
|
||||||
len = (FP_OFF(_HMATextEnd) | 0x000f) - (FP_OFF(_HMATextStart) & 0xfff0);
|
len = (FP_OFF(_HMATextEnd) | 0x000f) - (FP_OFF(_HMATextStart) & 0xfff0);
|
||||||
|
|
||||||
|
/* HMA doesn't start until a paragraph into 0xffff segment */
|
||||||
|
/* HMA begins with VDISK header to mark area is used */
|
||||||
if (NewKernelSegment == 0xffff)
|
if (NewKernelSegment == 0xffff)
|
||||||
{
|
{
|
||||||
HMASource += HMAOFFSET;
|
HMASource += HMAOFFSET;
|
||||||
|
|
|
@ -305,7 +305,14 @@ STATIC void init_kernel(void)
|
||||||
/* Init oem hook - returns memory size in KB */
|
/* Init oem hook - returns memory size in KB */
|
||||||
ram_top = init_oem();
|
ram_top = init_oem();
|
||||||
|
|
||||||
/* move kernel to high conventional RAM, just below the init code */
|
/* Note: HMA_TEXT and init code already moved higher in
|
||||||
|
conventional memory by startup code, however, we still
|
||||||
|
need to adjust any references to new location. So use
|
||||||
|
current CS as that is where we were moved to and perform
|
||||||
|
any fixups needed. Note this will also re-copy the
|
||||||
|
HMA_TEXT segment, so be sure not to overwrite it prior
|
||||||
|
to the MoveKernel() call. Kernel moved to around 8F??:0000
|
||||||
|
*/
|
||||||
#ifdef __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
lpTop = MK_FP(_CS, 0);
|
lpTop = MK_FP(_CS, 0);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue