Sync with -current.

XXX root on nfs don't work, though root on wd0 works well.
This commit is contained in:
tsubai 1999-09-14 11:20:52 +00:00
parent 40905bd3ec
commit 17dc484c1c
8 changed files with 25 additions and 191 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.2 1999/09/13 16:26:18 msaitoh Exp $
# $NetBSD: GENERIC,v 1.3 1999/09/14 11:20:52 tsubai Exp $
#
# GENERIC -- everything that's currently supported
#
@ -42,6 +42,7 @@ options SYSVSHM # System V-like memory sharing
# Compatibility options
options COMPAT_13 # NetBSD 1.3
options COMPAT_14 # NetBSD 1.4,
options COMPAT_43 # and 4.3BSD
# Executable format options

View File

@ -1,4 +1,4 @@
# $NetBSD: MMEYE,v 1.2 1999/09/13 16:26:18 msaitoh Exp $
# $NetBSD: MMEYE,v 1.3 1999/09/14 11:20:52 tsubai Exp $
#
# GENERIC -- everything that's currently supported
#
@ -34,6 +34,7 @@ options PMAP_NEW # new pmap interface
# Compatibility options
options COMPAT_13 # NetBSD 1.3
options COMPAT_14 # NetBSD 1.4,
options COMPAT_43 # and 4.3BSD
# Executable format options
@ -54,8 +55,8 @@ options NFS_BOOT_DHCP # Support DHCP NFS root
options PCMCIAVERBOSE # verbose PCMCIA configuration messages
# Kernel root file system and dump configuration.
config netbsd root on ? type nfs
#config netbsd root on wd0a type ffs
#config netbsd root on ? type nfs
config netbsd root on wd0a type ffs
#
# Device configuration

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.mmeye,v 1.1 1999/09/13 10:30:50 itojun Exp $
# $NetBSD: Makefile.mmeye,v 1.2 1999/09/14 11:20:52 tsubai Exp $
# Makefile for NetBSD
#
@ -48,7 +48,6 @@ MMEYE= $S/arch/mmeye
HAVE_GCC28!= ${CC} --version | egrep "^(2\.8|2\.9|egcs)" ; echo
INCLUDES= -I. -I$S/arch -I$S -nostdinc
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dmmeye -Dsh3
CPPFLAGS+= -D__NetBSD__
CWARNFLAGS= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes
CWARNFLAGS+= -Wpointer-arith -Wno-parentheses
.if (${HAVE_GCC28} != "")
@ -62,8 +61,6 @@ LINKFLAGS= -e start -T ../../../mmeye/conf/sh.x
LINKFLAGS= -N -Ttext 8c010000 -e start
.endif
STRIPFLAGS= --strip-debug
MACHINE=mmeye
MACHINE_ARCH=sh3
### find out what to use for libkern
.include "$S/lib/libkern/Makefile.inc"

View File

@ -1,8 +1,7 @@
# $NetBSD: std.mmeye,v 1.1 1999/09/13 10:30:51 itojun Exp $
# $NetBSD: std.mmeye,v 1.2 1999/09/14 11:20:52 tsubai Exp $
#
# standard, required NetBSD/mmeye 'options'
machine mmeye sh3
#options PMAP_NEW # UVM's new pmap interface
options EXEC_SCRIPT # exec #! scripts

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.2 1999/09/13 16:26:19 msaitoh Exp $ */
/* $NetBSD: conf.c,v 1.3 1999/09/14 11:20:53 tsubai Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@ -96,8 +96,6 @@ cdev_decl(ptc);
cdev_decl(log);
#include "com.h"
cdev_decl(com);
#include "sci.h"
cdev_decl(sci);
cdev_decl(fd);
cdev_decl(sd);
cdev_decl(st);
@ -146,7 +144,7 @@ struct cdevsw cdevsw[] =
cdev_tty_init(NCOM,com), /* 8: serial port */
cdev_notdef(), /* 9 (was floppy disk) */
cdev_notdef(), /* 10 (was QIC-02/QIC-36 tape) */
cdev_tty_init(NSCI,sci), /* 11: */
cdev_notdef(), /* 11: */
cdev_notdef(), /* 12: (was PC console) */
cdev_disk_init(NSD,sd), /* 13: SCSI disk */
cdev_tape_init(NST,st), /* 14: SCSI tape */

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.1 1999/09/13 10:31:02 itojun Exp $
# $NetBSD: genassym.cf,v 1.2 1999/09/14 11:20:53 tsubai Exp $
#
# Copyright (c) 1995, 1997 Charles M. Hannum. All rights reserved.
@ -39,8 +39,6 @@
# @(#)genassym.c 5.11 (Berkeley) 5/10/91
#
include "opt_pmap_new.h"
include <sys/param.h>
include <sys/proc.h>
include <sys/resourcevar.h>
@ -59,20 +57,11 @@ include <machine/vmparam.h>
define SRUN SRUN
ifdef PMAP_NEW
define PDSLOT_PTE PDSLOT_PTE
define PDSLOT_APTE PDSLOT_APTE
define PDSLOT_KERN PDSLOT_KERN
define NKPTP_MIN NKPTP_MIN
define NKPTP_MAX NKPTP_MAX
else
define PTDPTDI PTDPTDI
define KPTDI KPTDI
define NKPDE_BASE NKPDE_BASE
define NKPDE_MAX NKPDE_MAX
define NKPDE_SCALE NKPDE_SCALE
define APTDPTDI APTDPTDI
endif
define VM_MAXUSER_ADDRESS (int)VM_MAXUSER_ADDRESS

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.1 1999/09/13 10:31:02 itojun Exp $ */
/* $NetBSD: locore.s,v 1.2 1999/09/14 11:20:54 tsubai Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1997
@ -41,7 +41,6 @@
*/
#include "opt_ddb.h"
#include "opt_pmap_new.h"
#include "assym.h"
@ -232,17 +231,9 @@
*
* XXX 4 == sizeof pde
*/
#ifdef PMAP_NEW
.set _C_LABEL(PTmap), (PDSLOT_PTE << PDSHIFT)
.set _C_LABEL(PTD), (_C_LABEL(PTmap) + PDSLOT_PTE * NBPG)
.set _C_LABEL(PTDpde), (_C_LABEL(PTD) + PDSLOT_PTE * 4)
#else
.globl _PTmap, _PTD, _PTDpde
.set _PTmap,(PTDPTDI << PDSHIFT)
.set _PTD,(_PTmap + PTDPTDI * NBPG)
.set _PTDpde,(_PTD + PTDPTDI * 4)
#endif
/*
* APTmap, APTD is the alternate recursive pagemap.
@ -250,16 +241,9 @@
*
* XXX 4 == sizeof pde
*/
#ifdef PMAP_NEW
.set _C_LABEL(APTmap),(PDSLOT_APTE << PDSHIFT)
.set _C_LABEL(APTD),(_C_LABEL(APTmap) + PDSLOT_APTE * NBPG)
.set _C_LABEL(APTDpde),(_C_LABEL(PTD) + PDSLOT_APTE * 4)
#else
.globl _APTmap,_APTD,_APTDpde
.set _APTmap,(APTDPTDI << PDSHIFT)
.set _APTD,(_APTmap + APTDPTDI * NBPG)
.set _APTDpde,(_PTD + APTDPTDI * 4)
#endif
/*
* Initialization

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.1 1999/09/13 10:31:03 itojun Exp $ */
/* $NetBSD: machdep.c,v 1.2 1999/09/14 11:20:54 tsubai Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -75,10 +75,8 @@
* @(#)machdep.c 7.4 (Berkeley) 6/3/91
*/
#include "opt_bufcache.h"
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
#include "opt_pmap_new.h"
#include "opt_sysv.h"
#include <sys/param.h>
@ -102,15 +100,6 @@
#include <sys/device.h>
#include <sys/extent.h>
#include <sys/syscallargs.h>
#ifdef SYSVMSG
#include <sys/msg.h>
#endif
#ifdef SYSVSEM
#include <sys/sem.h>
#endif
#ifdef SYSVSHM
#include <sys/shm.h>
#endif
#ifdef KGDB
#include <sys/kgdb.h>
@ -155,26 +144,6 @@ char cpu_model[120];
char bootinfo[BOOTINFO_MAXSIZE];
/*
* Declare these as initialized data so we can patch them.
*/
int nswbuf = 0;
#ifdef NBUF
int nbuf = NBUF;
#else
int nbuf = 0;
#endif
#ifdef BUFPAGES
int bufpages = BUFPAGES;
#else
int bufpages = 0;
#endif
#ifdef BUFCACHE
int bufcache = BUFCACHE; /* % of RAM to use for buffer cache */
#else
int bufcache = 0; /* fallback to old algorithm */
#endif
int physmem;
int dumpmem_low;
int dumpmem_high;
@ -212,7 +181,6 @@ struct extent *iomem_ex;
static int ioport_malloc_safe;
void setup_bootinfo __P((void));
caddr_t allocsys __P((caddr_t));
void dumpsys __P((void));
void identifycpu __P((void));
void initSH3 __P((void *));
@ -246,21 +214,23 @@ cpu_startup()
vaddr_t minaddr, maxaddr;
vsize_t size;
struct pcb *pcb;
char pbuf[9];
printf(version);
sprintf(cpu_model, "Hitachi SH3");
printf("real mem = %d\n", ctob(physmem));
format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
printf("total memory = %s\n", pbuf);
/*
* Find out how much space we need, allocate it,
* and then give everything true virtual addresses.
*/
sz = (int)allocsys((caddr_t)0);
sz = (int)allocsys(NULL, NULL);
if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0)
panic("startup: no room for tables");
if (allocsys(v) - v != sz)
if (allocsys(v, NULL) - v != sz)
panic("startup: table size inconsistency");
/*
@ -297,22 +267,12 @@ cpu_startup()
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
while (curbufsize) {
/*
* Attempt to allocate buffers from the first
* 16M of RAM to avoid bouncing file system
* transfers.
*/
pg = uvm_pagealloc(NULL, 0, NULL, 0);
if (pg == NULL)
panic("cpu_startup: not enough memory for "
"buffer cache");
#if defined(PMAP_NEW)
pmap_kenter_pgs(curbuf, &pg, 1);
#else
pmap_enter(kernel_map->pmap, curbuf,
VM_PAGE_TO_PHYS(pg), VM_PROT_ALL, TRUE,
VM_PROT_ALL);
#endif
pmap_kenter_pa(curbuf, VM_PAGE_TO_PHYS(pg),
VM_PROT_READ|VM_PROT_WRITE);
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
}
@ -344,9 +304,10 @@ cpu_startup()
for (i = 1; i < ncallout; i++)
callout[i-1].c_next = &callout[i];
printf("avail mem = %ld\n", ptoa(uvmexp.free));
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
printf("avail memory = %s\n", pbuf);
format_bytes(pbuf, sizeof(pbuf), bufpages * CLBYTES);
printf("using %d buffers containing %s of memory\n", nbuf, pbuf);
/*
* Set up buffers, so they can be used to read disk labels.
@ -370,104 +331,13 @@ cpu_startup()
#endif
}
/*
* Allocate space for system data structures. We are given
* a starting virtual address and we return a final virtual
* address; along the way we set each data structure pointer.
*
* We call allocsys() with 0 to find out how much space we want,
* allocate that much and fill it with zeroes, and then call
* allocsys() again with the correct base virtual address.
*/
caddr_t
allocsys(v)
caddr_t v;
{
#define valloc(name, type, num) \
v = (caddr_t)(((name) = (type *)v) + (num))
#ifdef REAL_CLISTS
valloc(cfree, struct cblock, nclist);
#endif
valloc(callout, struct callout, ncallout);
#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
/*
* If necessary, determine the number of pages to use for the
* buffer cache. We allocate 1/2 as many swap buffer headers
* as file I/O buffers.
*/
if (bufpages == 0) {
if (bufcache == 0) { /* use old algorithm */
/*
* Determine how many buffers to allocate. We use 10%
* of the first 2MB of memory, and 5% of the rest, with
* a minimum of 16 buffers.
*/
if (physmem < btoc(2 * 1024 * 1024))
bufpages = physmem / (10 * CLSIZE);
else
bufpages = (btoc(2 * 1024 * 1024) + physmem) /
(20 * CLSIZE);
} else {
/*
* Set size of buffer cache to physmem/bufcache * 100
* (i.e., bufcache % of physmem).
*/
if (bufcache < 5 || bufcache > 95) {
printf(
"warning: unable to set bufcache to %d%% of RAM, using 10%%",
bufcache);
bufcache = 10;
}
bufpages= physmem / (CLSIZE * 100) * bufcache;
}
}
if (nbuf == 0) {
nbuf = bufpages;
if (nbuf < 16)
nbuf = 16;
}
/*
* XXX stopgap measure to prevent wasting too much KVM on
* the sparsely filled buffer cache.
*/
if (nbuf * MAXBSIZE > VM_MAX_KERNEL_BUF)
nbuf = VM_MAX_KERNEL_BUF / MAXBSIZE;
if (nswbuf == 0) {
nswbuf = (nbuf / 2) &~ 1; /* force even */
if (nswbuf > 256)
nswbuf = 256; /* sanity */
}
valloc(buf, struct buf, nbuf);
return v;
}
/*
* Info for CTL_HW
*/
extern char version[];
#define CPUDEBUG
/*
* machine dependent system variables.
*/
@ -1065,11 +935,7 @@ initSH3(pc)
/* Install a PDE recursively mapping page directory as a page table! */
pte = (u_int)pagedir;
pte |= PG_V | PG_4K | PG_KW | PG_M | PG_N;
#if defined(PMAP_NEW)
pagedir[PDSLOT_PTE] = pte;
#else
pagedir[PTDPTDI] = pte;
#endif
/* set PageDirReg */
SHREG_TTB = (u_int)pagedir;
@ -1115,10 +981,9 @@ initSH3(pc)
/* MMEYE_LED = 0x01; */
proc0.p_addr = proc0paddr; /* page dir address */
#if defined(PMAP_NEW)
/* XXX: PMAP_NEW requires valid curpcb. also init'd in cpu_startup */
curpcb = &proc0.p_addr->u_pcb;
#endif
/*
* Initialize the I/O port and I/O mem extent maps.