/* *Startthekernel.
*/ staticinlinevoid
runkernel(void)
{
__asm__ __volatile__( "bis %0,%0,$27\n\t" "jmp ($27)"
: /* no outputs: it doesn't even return */
: "r" (START_ADDR));
}
/* Must record the SP (it is virtual) on entry, so we can make sure
not to overwrite it during movement or decompression. */ unsignedlong SP_on_entry;
/* Calculate the kernel image address based on the end of the BOOTP bootstrapper(iethisprogram).
*/ externchar _end; #define KERNEL_ORIGIN \
((((unsignedlong)&_end) + 511) & ~511)
/* Round address to next higher page boundary. */ #define NEXT_PAGE(a) (((a) | (PAGE_SIZE - 1)) + 1)
/* Virtual addresses for just the bootstrapper part of the BOOTP image. */ #define V_BOOTSTRAPPER_START BOOT_ADDR #define V_BOOTSTRAPPER_END KERNEL_ORIGIN
/* Virtual addresses for just the data part of the BOOTP image.ThismayalsoincludetheINITRDimage,butalways includestheSTACK.
*/ #define V_DATA_START KERNEL_ORIGIN #define V_INITRD_START (KERNEL_ORIGIN + KERNEL_Z_SIZE) #define V_INTRD_END (V_INITRD_START + REAL_INITRD_SIZE) #define V_DATA_END V_BOOT_IMAGE_END
/* Define to where we may have to decompress the kernel image, before wemoveittothefinalposition,incaseofoverlap.Thiswillbe abovethefinalpositionofthekernel.
Regardlessofoverlap,wemovetheINITRDimagetotheendofthis copyarea,becausethereneedstobeabufferareaafterthekernel for"bootmem"anyway.
*/ #define K_COPY_IMAGE_START NEXT_PAGE(K_KERNEL_IMAGE_END) /* Reserve one page below INITRD for the new stack. */ #define K_INITRD_START \
NEXT_PAGE(K_COPY_IMAGE_START + KERNEL_SIZE + PAGE_SIZE) #define K_COPY_IMAGE_END \
(K_INITRD_START + REAL_INITRD_SIZE + MALLOC_AREA_SIZE) #define K_COPY_IMAGE_SIZE \
NEXT_PAGE(K_COPY_IMAGE_END - K_COPY_IMAGE_START)
void
start_kernel(void)
{ int must_move = 0;
/* Initialize these for the decompression-in-place situation, whichisthesmallestamountofworkandmostlikelyto occurwhenusingthenormalSTART_ADDRofthekernel (currentlysetto16MB,toclearallconsolecode.
*/ unsignedlong uncompressed_image_start = K_KERNEL_IMAGE_START; unsignedlong uncompressed_image_end = K_KERNEL_IMAGE_END;
/* Since all the SRM consoles load the BOOTP image at virtual *0x20000000,wehavetoensurethatthephysicalmemory *pagesoccupiedbythatimagedoNOToverlapthephysical *addressrangewherethekernelwantstoberun.This *causesrealproblemswhenattemptingtocdecompressthe *formerintothelatter...:-( * *So,wemayhavetodecompress/movethekernel/INITRDimage *virtual-to-physicalsomeplaceelsefirstbeforemoving *kernel/INITRDtotheirfinalrestingplaces...;-} * *Sigh...
*/
/* First, check to see if the range of addresses occupied by thebootstrapperpartoftheBOOTPimageincludeanyofthe physicalpagesintowhichthekernelwillbeplacedfor execution.
Weonlyneedcheckonthefinalkernelimagerange,sincewe willputtheINITRDsomeplacethatwecanbesureisnot inconflict.
*/ if (check_range(V_BOOTSTRAPPER_START, V_BOOTSTRAPPER_END,
K_KERNEL_DATA_START, K_KERNEL_IMAGE_END))
{
srm_printk("FATAL ERROR: overlap of bootstrapper code\n");
__halt();
}
/* Next, check to see if the range of addresses occupied by thecompressedkernel/INITRD/stackportionoftheBOOTP imageincludeanyofthephysicalpagesintowhichthe decompressedkernelortheINITRDwillbeplacedfor execution.
*/ if (check_range(V_DATA_START, V_DATA_END,
K_KERNEL_IMAGE_START, K_COPY_IMAGE_END))
{ #ifdef DEBUG_ADDRESSES
srm_printk("OVERLAP: cannot decompress in place\n"); #endif
uncompressed_image_start = K_COPY_IMAGE_START;
uncompressed_image_end = K_COPY_IMAGE_END;
must_move = 1;
/* Finally, check to see if the range of addresses occupiedbythecompressedkernel/INITRDpartof theBOOTPimageincludeanyofthephysicalpages intowhichthatpartistobecopiedfor decompression.
*/ while (check_range(V_DATA_START, V_DATA_END,
uncompressed_image_start,
uncompressed_image_end))
{ #if0
uncompressed_image_start += K_COPY_IMAGE_SIZE;
uncompressed_image_end += K_COPY_IMAGE_SIZE;
initrd_image_start += K_COPY_IMAGE_SIZE; #else /* Keep as close as possible to end of BOOTP image. */
uncompressed_image_start += PAGE_SIZE;
uncompressed_image_end += PAGE_SIZE;
initrd_image_start += PAGE_SIZE; #endif
}
}
srm_printk("Starting to load the kernel with args '%s'\n", envval);
/* First, we always move the INITRD image, if present. */ #ifdef DEBUG_ADDRESSES
srm_printk("Moving the INITRD image...\n" " from 0x%lx to 0x%lx size 0x%x\n",
V_INITRD_START,
initrd_image_start,
INITRD_IMAGE_SIZE); #endif
memcpy((void *)initrd_image_start, (void *)V_INITRD_START,
INITRD_IMAGE_SIZE);
#endif/* INITRD_IMAGE_SIZE */
/* Next, we may have to move the uncompressed kernel to the finaldestination.
*/ if (must_move) { #ifdef DEBUG_ADDRESSES
srm_printk("Moving the uncompressed kernel...\n" "...from 0x%lx to 0x%lx size 0x%x\n",
uncompressed_image_start,
K_KERNEL_IMAGE_START,
(unsigned)KERNEL_SIZE); #endif /* *Movethestacktoasafeplacetoensureitwon'tbe *overwrittenbykernelimage.
*/
move_stack(initrd_image_start - PAGE_SIZE);
/* Clear the zero page, then move the argument list in. */ #ifdef DEBUG_LAST_STEPS
srm_printk("Preparing ZERO_PGE...\n"); #endif
memset((char*)ZERO_PGE, 0, PAGE_SIZE);
strcpy((char*)ZERO_PGE, envval);
#ifdef INITRD_IMAGE_SIZE
#ifdef DEBUG_LAST_STEPS
srm_printk("Preparing INITRD info...\n"); #endif /* Finally, set the INITRD paramenters for the kernel. */
((long *)(ZERO_PGE+256))[0] = initrd_image_start;
((long *)(ZERO_PGE+256))[1] = INITRD_IMAGE_SIZE;
/* dummy function, should never be called. */ void *__kmalloc(size_t size, gfp_t flags)
{ return (void *)NULL;
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.13Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.