if(strncmp("OSLOADOPTIONS=",argv[i],14) == 0) {
if(strncasecmp("osloadoptions=",argv[i],14) == 0) {
mips_init(argc, argv, code)	int argc;	char *argv[];	u_int code;{	register char *cp;	register int i;	register unsigned firstaddr;	register caddr_t sysend;	caddr_t start;	struct tlb tlb;	extern char edata[], end[];	extern char MachTLBMiss[], MachTLBMissEnd[];	extern char MachException[], MachExceptionEnd[];	/* clear the BSS segment in OpenBSD code */	sysend = (caddr_t)mips_round_page(end);	bzero(edata, sysend - edata);	/* Initialize the CPU type */	bios_ident();	/*	 * Get config register now as mapped from BIOS since we are	 * going to demap these addresses later. We want as may TLB	 * entries as possible to do something useful :-).	 */	switch (cputype) {	case ACER_PICA_61:	/* ALI PICA 61 and MAGNUM is almost the */	case MAGNUM:		/* Same kind of hardware. NEC goes here too */		if(cputype == MAGNUM) {			strcpy(cpu_model, "MIPS Magnum");		}		else {			strcpy(cpu_model, "Acer Pica-61");		}		isa_io_base = PICA_V_ISA_IO;		isa_mem_base = PICA_V_ISA_MEM;		/*		 * Set up interrupt handling and I/O addresses.		 */#if 0 /* XXX FIXME */		Mach_splnet = Mach_spl1;		Mach_splbio = Mach_spl0;		Mach_splimp = Mach_spl1;		Mach_spltty = Mach_spl2;		Mach_splstatclock = Mach_spl3;#endif		break;	case DESKSTATION_RPC44:		strcpy(cpu_model, "Deskstation rPC44");		isa_io_base = 0xb0000000;		/*XXX*/		isa_mem_base = 0xa0000000;		/*XXX*/		break;	case DESKSTATION_TYNE:		strcpy(cpu_model, "Deskstation Tyne");		isa_io_base = TYNE_V_ISA_IO;		isa_mem_base = TYNE_V_ISA_MEM;		break;	default:		bios_putstring("kernel not configured for this system\n");		boot(RB_HALT | RB_NOSYNC);	}	physmem = btoc(physmem);	/* look at argv[0] and compute bootdev for autoconfig setup */	makebootdev(argv[0]);	/*	 * Look at arguments passed to us and compute boothowto.	 * Default to SINGLE and ASKNAME if no args.	 */	boothowto = RB_SINGLE | RB_ASKNAME;#ifdef KADB	boothowto |= RB_KDB;#endif	if (argc > 1) {		for (i = 1; i < argc; i++) {			if(strncmp("OSLOADOPTIONS=",argv[i],14) == 0) {				for (cp = argv[i]+14; *cp; cp++) {					switch (*cp) {					case 'a': /* autoboot */						boothowto &= ~RB_SINGLE;						break;					case 'd': /* use compiled in default root */						boothowto |= RB_DFLTROOT;						break;					case 'm': /* mini root present in memory */						boothowto |= RB_MINIROOT;						break;					case 'n': /* ask for names */						boothowto |= RB_ASKNAME;						break;					case 'N': /* don't ask for names */						boothowto &= ~RB_ASKNAME;						break;					}				}			}		}	}#ifdef MFS	/*	 * Check to see if a mini-root was loaded into memory. It resides	 * at the start of the next page just after the end of BSS.	 */	if (boothowto & RB_MINIROOT) {		boothowto |= RB_DFLTROOT;		sysend += mfs_initminiroot(sysend);	}#endif	/*	 * Now its time to abandon the BIOS and be self supplying.	 * Start with cleaning out the TLB. Bye bye Microsoft....	 */	R4K_SetWIRED(0);	R4K_TLBFlush();	R4K_SetWIRED(VMWIRED_ENTRIES);		switch (cputype) {	case ACER_PICA_61:	case MAGNUM:		tlb_init_pica();		break;	case DESKSTATION_TYNE:		tlb_init_tyne();		break;	case DESKSTATION_RPC44:        break;	}	/*	 * Init mapping for u page(s) for proc[0], pm_tlbpid 1.	 */	sysend = (caddr_t)((int)sysend + 3 & -4);	start = sysend;	curproc->p_addr = proc0paddr = (struct user *)sysend;	curproc->p_md.md_regs = proc0paddr->u_pcb.pcb_regs;	firstaddr = CACHED_TO_PHYS(sysend);	for (i = 0; i < UPAGES; i+=2) {		tlb.tlb_mask = PG_SIZE_4K;		tlb.tlb_hi = vad_to_vpn((UADDR + (i << PGSHIFT))) | 1;		tlb.tlb_lo0 = vad_to_pfn(firstaddr) | PG_V | PG_M | PG_CACHED;		tlb.tlb_lo1 = vad_to_pfn(firstaddr + NBPG) | PG_V | PG_M | PG_CACHED;		curproc->p_md.md_upte[i] = tlb.tlb_lo0;		curproc->p_md.md_upte[i+1] = tlb.tlb_lo1;		R4K_TLBWriteIndexed(i,&tlb);		firstaddr += NBPG * 2;	}	sysend += UPAGES * NBPG;	sysend = (caddr_t)((int)sysend+3 & -4);	R4K_SetPID(1);	/*	 * init nullproc for swtch_exit().	 * init mapping for u page(s), pm_tlbpid 0	 * This could be used for an idle process.	 */	nullproc.p_addr = (struct user *)sysend;	nullproc.p_md.md_regs = nullproc.p_addr->u_pcb.pcb_regs;	bcopy("nullproc", nullproc.p_comm, sizeof("nullproc"));	firstaddr = CACHED_TO_PHYS(sysend);	for (i = 0; i < UPAGES; i+=2) {		nullproc.p_md.md_upte[i] = vad_to_pfn(firstaddr) | PG_V | PG_M | PG_CACHED;		nullproc.p_md.md_upte[i+1] = vad_to_pfn(firstaddr + NBPG) | PG_V | PG_M | PG_CACHED;		firstaddr += NBPG * 2;	}	sysend += UPAGES * NBPG;	/* clear pages for u areas */	bzero(start, sysend - start);	/*	 * Copy down exception vector code.	 */	if (MachTLBMissEnd - MachTLBMiss > 0x80)		panic("startup: TLB code too large");	bcopy(MachTLBMiss, (char *)TLB_MISS_EXC_VEC,		MachTLBMissEnd - MachTLBMiss);	bcopy(MachException, (char *)GEN_EXC_VEC,		MachExceptionEnd - MachException);	/*	 * Clear out the I and D caches.	 */	cpucfg = R4K_ConfigCache();	R4K_FlushCache();	/*	 * Initialize error message buffer.	 */	msgbufp = (struct msgbuf *)(sysend);	sysend = (caddr_t)(sysend + (sizeof(struct msgbuf)));	msgbufmapped = 1;	/*	 * Allocate space for system data structures.	 * The first available kernel virtual address is in "sysend".	 * As pages of kernel virtual memory are allocated, "sysend"	 * is incremented.	 *	 * These data structures are allocated here instead of cpu_startup()	 * because physical memory is directly addressable. We don't have	 * to map these into virtual address space.	 */	start = sysend;#define	valloc(name, type, num) \	    (name) = (type *)sysend; sysend = (caddr_t)((name)+(num))#define	valloclim(name, type, num, lim) \	    (name) = (type *)sysend; sysend = (caddr_t)((lim) = ((name)+(num)))#ifdef REAL_CLISTS	valloc(cfree, struct cblock, nclist);#endif	valloc(callout, struct callout, ncallout);	valloc(swapmap, struct map, nswapmap = maxproc * 2);#ifdef SYSVSHM	valloc(shmsegs, struct shmid_ds, shminfo.shmmni);#endif#ifdef SYSVSEM	valloc(sema, struct semid_ds, seminfo.semmni);	valloc(sem, struct sem, seminfo.semmns);	/* This is pretty disgusting! */	valloc(semu, int, (seminfo.semmnu * seminfo.semusz) / sizeof(int));#endif#ifdef SYSVMSG	valloc(msgpool, char, msginfo.msgmax);	valloc(msgmaps, struct msgmap, msginfo.msgseg);	valloc(msghdrs, struct msg, msginfo.msgtql);	valloc(msqids, struct msqid_ds, msginfo.msgmni);#endif	/*	 * Determine how many buffers to allocate.	 * We allocate more buffer space than the BSD standard of	 * using 10% of memory for the first 2 Meg, 5% of remaining.	 * We just allocate a flat 10%. Ensure a minimum of 16 buffers.	 * We allocate 1/2 as many swap buffer headers as file i/o buffers.	 */	if (bufpages == 0)		bufpages = physmem / 10 / CLSIZE;	if (nbuf == 0) {		nbuf = bufpages;		if (nbuf < 16)			nbuf = 16;	}	if (nswbuf == 0) {		nswbuf = (nbuf / 2) &~ 1;	/* force even */		if (nswbuf > 256)			nswbuf = 256;		/* sanity */	}	valloc(swbuf, struct buf, nswbuf);	valloc(buf, struct buf, nbuf);	/*	 * Clear allocated memory.	 */	bzero(start, sysend - start);	/*	 * Initialize the virtual memory system.	 */	pmap_bootstrap((vm_offset_t)sysend);}