예제 #1
0
파일: boot2.c 프로젝트: DragonQuan/minix3
void
print_banner(void)
{

	clearit();
#ifndef SMALL
	int n;
	if (bootconf.banner[0]) {
		for (n = 0; bootconf.banner[n] && n < MAXBANNER; n++) 
			printf("%s\n", bootconf.banner[n]);
	} else {
#endif /* !SMALL */
#ifndef __minix
		printf("\n"
		       ">> %s, Revision %s (from NetBSD %s)\n"
		       ">> Memory: %d/%d k\n",
		       bootprog_name, bootprog_rev, bootprog_kernrev,
		       getbasemem(), getextmem());
#else
		printf("\n"
			"--- Welcome to MINIX 3. This is the boot monitor. ---\n"
			"Memory: %d/%d k\n",
			getbasemem(), getextmem());
#endif

#ifndef SMALL
	}
#endif /* !SMALL */
}
예제 #2
0
파일: main.c 프로젝트: lacombar/netbsd-alc
static void
print_banner(void)
{
	printf("\n");
	printf(">> %s, Revision %s\n", bootprog_name, bootprog_rev);
	printf(">> (%s, %s)\n", bootprog_maker, bootprog_date);
#if 0
	printf(">> Memory: %d/%d k\n", getbasemem(), getextmem());
#endif
}
예제 #3
0
static void
print_banner(void)
{
	int base = getbasemem();
	int ext = getextmem();

	clearit();
	printf("\n"
	       ">> NetBSD/x86 PXE boot, Revision %s (from NetBSD %s)\n"
	       ">> Memory: %d/%d k\n",
	       bootprog_rev, bootprog_kernrev,
	       base, ext);
}
예제 #4
0
void
print_banner(void)
{

    clearit();
#ifndef SMALL
    int n;
    if (bootcfg_info.banner[0]) {
        for (n = 0; bootcfg_info.banner[n]
                && n < BOOTCFG_MAXBANNER; n++)
            printf("%s\n", bootcfg_info.banner[n]);
    } else {
#endif /* !SMALL */
        printf("\n"
               ">> %s, Revision %s (from NetBSD %s)\n"
               ">> Memory: %d/%d k\n",
               bootprog_name, bootprog_rev, bootprog_kernrev,
               getbasemem(), getextmem());

#ifndef SMALL
    }
#endif /* !SMALL */
}
예제 #5
0
파일: exec.c 프로젝트: DragonQuan/minix3
static int
common_load_kernel(const char *file, u_long *basemem, u_long *extmem,
    physaddr_t loadaddr, int floppy, u_long marks[MARK_MAX])
{
	int fd;
#ifdef XMS
	u_long		xmsmem;
	physaddr_t	origaddr = loadaddr;
#endif

	*extmem = getextmem();
	*basemem = getbasemem();

#ifdef XMS
	if ((getextmem1() == 0) && (xmsmem = checkxms())) {
	        u_long kernsize;

		/*
		 * With "CONSERVATIVE_MEMDETECT", extmem is 0 because
		 *  getextmem() is getextmem1(). Without, the "smart"
		 *  methods could fail to report all memory as well.
		 * xmsmem is a few kB less than the actual size, but
		 *  better than nothing.
		 */
		if (xmsmem > *extmem)
			*extmem = xmsmem;
		/*
		 * Get the size of the kernel
		 */
		marks[MARK_START] = loadaddr;
		if ((fd = loadfile(file, marks, COUNT_KERNEL)) == -1)
			return EIO;
		close(fd);

		kernsize = marks[MARK_END];
		kernsize = (kernsize + 1023) / 1024;

		loadaddr = xmsalloc(kernsize);
		if (!loadaddr)
			return ENOMEM;
	}
#endif
	marks[MARK_START] = loadaddr;
	if ((fd = loadfile(file, marks,
	    LOAD_KERNEL & ~(floppy ? LOAD_BACKWARDS : 0))) == -1)
		return EIO;

	close(fd);

	/* Now we know the root fs type, load modules for it. */
	if (fsmod != NULL)
		module_add(fsmod);
	if (fsmod !=NULL && fsmod2 != NULL && strcmp(fsmod, fsmod2) != 0)
		module_add(fsmod2);

	/*
	 * Gather some information for the kernel. Do this after the
	 * "point of no return" to avoid memory leaks.
	 * (but before DOS might be trashed in the XMS case)
	 */
#ifdef PASS_BIOSGEOM
	bi_getbiosgeom();
#endif
#ifdef PASS_MEMMAP
	bi_getmemmap();
#endif

#ifdef XMS
	if (loadaddr != origaddr) {
		/*
		 * We now have done our last DOS IO, so we may
		 * trash the OS. Copy the data from the temporary
		 * buffer to its real address.
		 */
		marks[MARK_START] -= loadaddr;
		marks[MARK_END] -= loadaddr;
		marks[MARK_SYM] -= loadaddr;
		marks[MARK_END] -= loadaddr;
		ppbcopy(loadaddr, origaddr, marks[MARK_END]);
	}
#endif
	marks[MARK_END] = (((u_long) marks[MARK_END] + sizeof(int) - 1)) &
	    (-sizeof(int));
	image_end = marks[MARK_END];
	kernel_loaded = true;

	return 0;
}