snapshot. ready to call configure(), partial integration of torek's config

stuff, i.e it looks to do the right thing but we haven't written any code
yet :)
This commit is contained in:
glass 1993-08-13 13:16:11 +00:00
parent f94a1c2f10
commit 9c18e650a2
8 changed files with 227 additions and 10 deletions

View File

@ -0,0 +1,47 @@
#
# new style config file for sun3 architecture
#
#
#
define sunfb
#device mainbus at root { }
device obio at root {addr = -1, [priority = -1]}
device obmem at root {addr, size, [priority = -1]}
#define obio { addr = -1, size = -1, priority = -1, dvma = -1, flags = -1}
#define obmem { addr = -1, size = -1}
device le at obio: ifnet, ether
file arch/sun3/dev/if_le.c le device-driver needs-count
device zs at obio: tty
file arch/sun3/dev/zs.c zs device-driver needs-count
device bwtwo at obmem: sunfb
file arch/sun3/dev/bwtwo.c bwtwo
#
#
file arch/sun3/sun3/clock.c
file arch/sun3/sun3/conf.c
file arch/sun3/sun3/cons.c
file arch/sun3/sun3/control.c
#file arch/sun3/sun3/db_disasm.c ddb
file arch/sun3/sun3/db_interface.c ddb
file arch/sun3/sun3/db_trace.c ddb
file arch/sun3/sun3/disksubr.c
file arch/sun3/sun3/machdep.c
file arch/sun3/sun3/mem.c
file arch/sun3/sun3/obio.c
file arch/sun3/sun3/pmap.c
file arch/sun3/sun3/stub.c
file arch/sun3/sun3/sun3_startup.c
file arch/sun3/sun3/trap.c
file arch/sun3/sun3/vector.c
file arch/sun3/sun3/vm_machdep.c
file arch/sun3/dev/idprom.c idprom device-driver
file arch/sun3/dev/prom.c prom device-driver
file arch/sun3/dev/obmem.c obmem device-driver

View File

@ -0,0 +1,6 @@
machine "sun3"
#mainbus0 at root
obio0 at root
obmem0 at root

View File

@ -31,6 +31,16 @@
#define DMMIN 32 /* smallest swap allocation */
#define DMMAX 4096 /* largest potential swap allocation */
/*
* PTEs for mapping user space into the kernel for phyio operations.
* [this figure is based on the assumption that you can put ptes in real
* memory. this is a false assumption on a sun3]
*
*/
#ifndef USRIOSIZE
#define USRIOSIZE 1
#endif
/*
* The time for a process to be blocked before being very swappable.
* This is a number of seconds which the system takes as being a non-trivial

View File

@ -31,6 +31,16 @@
#define DMMIN 32 /* smallest swap allocation */
#define DMMAX 4096 /* largest potential swap allocation */
/*
* PTEs for mapping user space into the kernel for phyio operations.
* [this figure is based on the assumption that you can put ptes in real
* memory. this is a false assumption on a sun3]
*
*/
#ifndef USRIOSIZE
#define USRIOSIZE 1
#endif
/*
* The time for a process to be blocked before being very swappable.
* This is a number of seconds which the system takes as being a non-trivial

View File

@ -17,7 +17,8 @@
unsigned int *old_vector_table;
static struct idprom identity_prom;
unsigned char cpu_machine_id;
unsigned char cpu_machine_id = 0;
char *cpu_string = NULL;
vm_offset_t high_segment_free_start = 0;
vm_offset_t high_segment_free_end = 0;
@ -26,6 +27,7 @@ int msgbufmapped = 0;
struct msgbuf *msgbufp = NULL;
caddr_t vmmap;
extern vm_offset_t tmp_vpages[];
extern int physmem;
static void initialize_vector_table()
{
@ -276,7 +278,7 @@ void sun3_verify_hardware()
{
unsigned char arch;
int cpu_match = 0;
char *cpu_string;
if (idprom_fetch(&identity_prom, IDPROM_VERSION))
mon_panic("idprom fetch failed\n");

View File

@ -21,6 +21,11 @@
#include "../hpux/hpux.h"
#endif
#include "vm/vm.h"
#include "vm/vm_map.h"
#include "vm/vm_kern.h"
#include "vm/vm_page.h"
#include "machine/cpu.h"
#include "machine/reg.h"
#include "machine/psl.h"
@ -35,14 +40,151 @@
char kstack[NBPG]; /* totally bogus */
struct proc *proc0paddr = &proc0;
extern char *cpu_string;
int physmem;
int cold;
/*
* 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
void identifycpu()
{
/*
* actual identification done earlier because i felt like it,
* and i believe i will need the info to deal with some VAC, and awful
* framebuffer placement problems. could be moved later.
*/
printf("SUN3/%s\n", cpu_string);
/* should eventually include whether it has a VAC, etc */
}
void cpu_startup()
{
mon_printf("got to cpu_startup()\n");
caddr_t v;
int firstaddr, i;
vm_size_t size;
vm_offset_t minaddr, maxaddr;
printf("got to cpu_startup()\n");
/* msgbuf mapped earlier, should figure out why? */
printf(version);
identifycpu();
/* compute physmem? */
printf("real mem = %d\n", ctob(physmem));
/*
* Allocate space for system data structures.
* The first available real memory address is in "firstaddr".
* The first available kernel virtual address is in "v".
* As pages of kernel virtual memory are allocated, "v" is incremented.
* As pages of memory are allocated and cleared,
* "firstaddr" is incremented.
* An index into the kernel page table corresponding to the
* virtual memory address maintained in "v" is kept in "mapaddr".
*/
/*
* Make two passes. The first pass calculates how much memory is
* needed and allocates it. The second pass assigns virtual
* addresses to the various data structures.
*/
firstaddr = 0;
again:
v = (caddr_t)firstaddr;
#define valloc(name, type, num) \
(name) = (type *)v; v = (caddr_t)((name)+(num))
#define valloclim(name, type, num, lim) \
(name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num)))
/* valloc(cfree, struct cblock, nclist); no clists any more!!! - cgd */
valloc(callout, struct callout, ncallout);
valloc(swapmap, struct map, nswapmap = maxproc * 2);
#ifdef SYSVSHM
valloc(shmsegs, struct shmid_ds, shminfo.shmmni);
#endif
if (bufpages == 0)
if (physmem < (2 * 1024 * 1024))
bufpages = physmem / 10 / CLSIZE;
else
bufpages = ((2 * 1024 * 1024 + physmem) / 20) / CLSIZE;
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);
/*
* End of first pass, size has been calculated so allocate memory
*/
if (firstaddr == 0) {
size = (vm_size_t)(v - firstaddr);
firstaddr = (caddr_t) kmem_alloc(kernel_map, round_page(size));
if (firstaddr == 0)
panic("startup: no room for tables");
goto again;
}
/*
* End of second pass, addresses have been assigned
*/
if ((vm_size_t)(v - firstaddr) != size)
panic("startup: table size inconsistency");
/* buffer_map stuff but not used */
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
*/
/* exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,
* 16*NCARGS, TRUE);
* NOT CURRENTLY USED -- cgd
*/
/*
* Allocate a submap for physio
*/
phys_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,
VM_PHYS_SIZE, TRUE);
/*
* Finally, allocate mbuf pool. Since mclrefcnt is an off-size
* we use the more space efficient malloc in place of kmem_alloc.
*/
mclrefcnt = (char *)malloc(NMBCLUSTERS+CLBYTES/MCLBYTES,
M_MBUF, M_NOWAIT);
bzero(mclrefcnt, NMBCLUSTERS+CLBYTES/MCLBYTES);
mb_map = kmem_suballoc(kernel_map, (vm_offset_t)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
* Initialize callouts
*/
callfree = callout;
for (i = 1; i < ncallout; i++)
callout[i-1].c_next = &callout[i];
printf("avail mem = %d\n", ptoa(vm_page_free_count));
/* initcpu();*/
/*
* Set up buffers, so they can be used to read disk labels.
*/
bufinit();
/*
* Configure the system.
*/
printf("about to call configure\n");
/* configure();*/
sun3_stop();
cold = 0;
}

View File

@ -20,10 +20,6 @@
/*
* globals needed by the vm system
*
* [frankly the stupid vm system should allocate these]
*/
@ -883,8 +879,10 @@ pmap_init(phys_start, phys_end)
vm_offset_t phys_start, phys_end;
{
vm_offset_t tmp,end;
extern int physmem;
pv_init();
physmem = btoc(phys_end);
}
vm_offset_t

View File

@ -17,7 +17,8 @@
unsigned int *old_vector_table;
static struct idprom identity_prom;
unsigned char cpu_machine_id;
unsigned char cpu_machine_id = 0;
char *cpu_string = NULL;
vm_offset_t high_segment_free_start = 0;
vm_offset_t high_segment_free_end = 0;
@ -26,6 +27,7 @@ int msgbufmapped = 0;
struct msgbuf *msgbufp = NULL;
caddr_t vmmap;
extern vm_offset_t tmp_vpages[];
extern int physmem;
static void initialize_vector_table()
{
@ -276,7 +278,7 @@ void sun3_verify_hardware()
{
unsigned char arch;
int cpu_match = 0;
char *cpu_string;
if (idprom_fetch(&identity_prom, IDPROM_VERSION))
mon_panic("idprom fetch failed\n");