diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1997-03-03 19:32:35 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1997-03-03 19:32:35 +0000 |
commit | 90ff5a441368313fa226376473fea6908c2c3539 (patch) | |
tree | 38e1de6dcfb2805194734736d7209f51e06fa9e1 /sys/arch/mvme88k/stand/prtvid | |
parent | 7848f1c3b3e234584c90f67e60c6164590478f49 (diff) |
Third try at importing the mvme88k port. This is a working kernel
from nivas.
Userland and compiler still need to be worked on.
Make certain what directory the import is done from.
Diffstat (limited to 'sys/arch/mvme88k/stand/prtvid')
-rw-r--r-- | sys/arch/mvme88k/stand/prtvid/Makefile | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/prtvid/chklabel | bin | 0 -> 17060 bytes | |||
-rw-r--r-- | sys/arch/mvme88k/stand/prtvid/chklabel.c | 114 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/prtvid/prtvid | bin | 0 -> 17075 bytes | |||
-rw-r--r-- | sys/arch/mvme88k/stand/prtvid/prtvid.c | 132 |
5 files changed, 252 insertions, 0 deletions
diff --git a/sys/arch/mvme88k/stand/prtvid/Makefile b/sys/arch/mvme88k/stand/prtvid/Makefile new file mode 100644 index 00000000000..f6a6d3e1e1a --- /dev/null +++ b/sys/arch/mvme88k/stand/prtvid/Makefile @@ -0,0 +1,6 @@ +PROG= prtvid +NOMAN= + +install: + +.include <bsd.prog.mk> diff --git a/sys/arch/mvme88k/stand/prtvid/chklabel b/sys/arch/mvme88k/stand/prtvid/chklabel Binary files differnew file mode 100644 index 00000000000..05637c518f5 --- /dev/null +++ b/sys/arch/mvme88k/stand/prtvid/chklabel diff --git a/sys/arch/mvme88k/stand/prtvid/chklabel.c b/sys/arch/mvme88k/stand/prtvid/chklabel.c new file mode 100644 index 00000000000..fc92660c5b5 --- /dev/null +++ b/sys/arch/mvme88k/stand/prtvid/chklabel.c @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1993 Paul Kranenburg + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Paul Kranenburg. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/param.h> +#include <sys/disklabel.h> +#include <stdio.h> + +void cputobsdlabel __P((struct disklabel *lp, struct cpu_disklabel *clp)); + +main(int argc, char *argv[]) +{ + struct cpu_disklabel cpu_label; + struct disklabel sdlabel; + int i; + + fread((void *)&cpu_label, sizeof(struct cpu_disklabel), 1, stdin); + cputobsdlabel(&sdlabel, (struct cpu_disklabel *)&cpu_label); + + for (i = 0; i < MAXPARTITIONS; i++) { + printf("part %x off %x size %x\n", + i, sdlabel.d_partitions[i].p_offset, + sdlabel.d_partitions[i].p_size); + } +} + +void +cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp) +{ + int i; + + lp->d_magic = clp->magic1; + lp->d_type = clp->type; + lp->d_subtype = clp->subtype; + bcopy(clp->vid_vd, lp->d_typename, 16); + bcopy(clp->packname, lp->d_packname, 16); + lp->d_secsize = clp->cfg_psm; + lp->d_nsectors = clp->cfg_spt; + lp->d_ncylinders = clp->cfg_trk; /* trk is really num of cyl! */ + lp->d_ntracks = clp->cfg_hds; + + lp->d_secpercyl = clp->secpercyl; + lp->d_secperunit = clp->secperunit; + lp->d_secpercyl = clp->secpercyl; + lp->d_secperunit = clp->secperunit; + lp->d_sparespertrack = clp->sparespertrack; + lp->d_sparespercyl = clp->sparespercyl; + lp->d_acylinders = clp->acylinders; + lp->d_rpm = clp->rpm; + lp->d_interleave = clp->cfg_ilv; + lp->d_trackskew = clp->cfg_sof; + lp->d_cylskew = clp->cylskew; + lp->d_headswitch = clp->headswitch; + + /* this silly table is for winchester drives */ + switch (clp->cfg_ssr) { + case 0: + lp->d_trkseek = 0; + break; + case 1: + lp->d_trkseek = 6; + break; + case 2: + lp->d_trkseek = 10; + break; + case 3: + lp->d_trkseek = 15; + break; + case 4: + lp->d_trkseek = 20; + break; + default: + lp->d_trkseek = 0; + break; + } + lp->d_flags = clp->flags; + for (i = 0; i < NDDATA; i++) + lp->d_drivedata[i] = clp->drivedata[i]; + for (i = 0; i < NSPARE; i++) + lp->d_spare[i] = clp->spare[i]; + lp->d_magic2 = clp->magic2; + lp->d_checksum = clp->checksum; + lp->d_npartitions = clp->partitions; + lp->d_bbsize = clp->bbsize; + lp->d_sbsize = clp->sbsize; + bcopy(clp->vid_4, &(lp->d_partitions[0]), sizeof (struct partition) * 4); + bcopy(clp->cfg_4, &(lp->d_partitions[4]), sizeof (struct partition) * 12); +} diff --git a/sys/arch/mvme88k/stand/prtvid/prtvid b/sys/arch/mvme88k/stand/prtvid/prtvid Binary files differnew file mode 100644 index 00000000000..10a4f710289 --- /dev/null +++ b/sys/arch/mvme88k/stand/prtvid/prtvid diff --git a/sys/arch/mvme88k/stand/prtvid/prtvid.c b/sys/arch/mvme88k/stand/prtvid/prtvid.c new file mode 100644 index 00000000000..32784ff0dfa --- /dev/null +++ b/sys/arch/mvme88k/stand/prtvid/prtvid.c @@ -0,0 +1,132 @@ +#include <stdio.h> +#define __DBINTERFACE_PRIVATE +#include <db.h> +#include "vid.h" + +main(argc, argv) + int argc; + char *argv[]; +{ + struct vid *pvid; + struct cfg *pcfg; + + pvid = (struct vid *) malloc(sizeof (struct vid)); + + fread(pvid, sizeof(struct vid), 1, stdin); + + if (BYTE_ORDER != BIG_ENDIAN) + swabvid(pvid); + + printf("vid_id %s %x\n", pvid->vid_id, + (char *)&(pvid->vid_id[4]) - (char *)pvid); + printf("vid_oss %x %x\n", pvid->vid_oss, + (char *)&(pvid->vid_oss) - (char *)pvid); + printf("vid_osl %x %x\n", pvid->vid_osl, + (char *)&(pvid->vid_osl) - (char *)pvid); + printf("vid_osa_u %x %x\n", pvid->vid_osa_u, + (char *)&(pvid->vid_osa_u) - (char *)pvid); + printf("vid_osa_l %x %x\n", pvid->vid_osa_l, + (char *)&(pvid->vid_osa_l) - (char *)pvid); + printf("vid_vd %x\n", + (char *)&(pvid->vid_vd) - (char *)pvid); + printf("vid_cas %x %x\n", pvid->vid_cas, + (char *)&(pvid->vid_cas) - (char *)pvid); + printf("vid_cal %x %x\n", pvid->vid_cal, + (char *)&(pvid->vid_cal) - (char *)pvid); + printf("vid_moto %s %x\n", pvid->vid_mot, + (char *)&(pvid->vid_mot[0]) - (char *)pvid); + + free(pvid); + + pcfg = (struct cfg *) malloc(sizeof(struct cfg)); + + fread(pcfg, sizeof(struct cfg), 1, stdin); + + if (BYTE_ORDER != BIG_ENDIAN) + swabcfg(pcfg); + + printf("cfg_atm %x %x\n", pcfg->cfg_atm, + (char *)&(pcfg->cfg_atm) - (char *)(pcfg)); + printf("cfg_prm %x %x\n", pcfg->cfg_prm, + (char *)&(pcfg->cfg_prm) - (char *)(pcfg)); + printf("cfg_atw %x %x\n", pcfg->cfg_atw, + (char *)&(pcfg->cfg_atw) - (char *)(pcfg)); + printf("cfg_rec %x %x\n",(long)pcfg->cfg_rec, + (char *)&(pcfg->cfg_rec) - (char *)(pcfg)); + printf("cfg_spt %x %x\n", pcfg->cfg_spt, + (char *)&(pcfg->cfg_spt) - (char *)(pcfg)); + printf("cfg_hds %x %x\n", pcfg->cfg_hds, + (char *)&(pcfg->cfg_hds) - (char *)(pcfg)); + printf("cfg_trk %x %x\n", pcfg->cfg_trk, + (char *)&(pcfg->cfg_trk) - (char *)(pcfg)); + printf("cfg_ilv %x %x\n", pcfg->cfg_ilv, + (char *)&(pcfg->cfg_ilv) - (char *)(pcfg)); + printf("cfg_sof %x %x\n", pcfg->cfg_sof, + (char *)&(pcfg->cfg_sof) - (char *)(pcfg)); + printf("cfg_psm %x %x\n", pcfg->cfg_psm, + (char *)&(pcfg->cfg_psm) - (char *)(pcfg)); + printf("cfg_shd %x %x\n", pcfg->cfg_shd, + (char *)&(pcfg->cfg_shd) - (char *)(pcfg)); + printf("cfg_pcom %x %x\n", pcfg->cfg_pcom, + (char *)&(pcfg->cfg_pcom) - (char *)(pcfg)); + printf("cfg_ssr %x %x\n", pcfg->cfg_ssr, + (char *)&(pcfg->cfg_ssr) - (char *)(pcfg)); + printf("cfg_rwcc %x %x\n", pcfg->cfg_rwcc, + (char *)&(pcfg->cfg_rwcc) - (char *)(pcfg)); + printf("cfg_ecc %x %x\n", pcfg->cfg_ecc, + (char *)&(pcfg->cfg_ecc) - (char *)(pcfg)); + printf("cfg_eatm %x %x\n", pcfg->cfg_eatm, + (char *)&(pcfg->cfg_eatm) - (char *)(pcfg)); + printf("cfg_eprm %x %x\n", pcfg->cfg_eprm, + (char *)&(pcfg->cfg_eprm) - (char *)(pcfg)); + printf("cfg_eatw %x %x\n", pcfg->cfg_eatw, + (char *)&(pcfg->cfg_eatw) - (char *)(pcfg)); + printf("cfg_gpb1 %x %x\n", pcfg->cfg_gpb1, + (char *)&(pcfg->cfg_gpb1) - (char *)(pcfg)); + printf("cfg_gpb2 %x %x\n", pcfg->cfg_gpb2, + (char *)&(pcfg->cfg_gpb2) - (char *)(pcfg)); + printf("cfg_gpb3 %x %x\n", pcfg->cfg_gpb3, + (char *)&(pcfg->cfg_gpb3) - (char *)(pcfg)); + printf("cfg_gpb4 %x %x\n", pcfg->cfg_gpb4, + (char *)&(pcfg->cfg_gpb4) - (char *)(pcfg)); + printf("cfg_ssc %x %x\n", pcfg->cfg_ssc, + (char *)&(pcfg->cfg_ssc) - (char *)(pcfg)); + printf("cfg_runit %x %x\n", pcfg->cfg_runit, + (char *)&(pcfg->cfg_runit) - (char *)(pcfg)); + printf("cfg_rsvc1 %x %x\n", pcfg->cfg_rsvc1, + (char *)&(pcfg->cfg_rsvc1) - (char *)(pcfg)); + printf("cfg_rsvc2 %x %x\n", pcfg->cfg_rsvc2, + (char *)&(pcfg->cfg_rsvc2) - (char *)(pcfg)); +} + +swabvid(pvid) + struct vid *pvid; +{ + M_32_SWAP(pvid->vid_oss); + M_16_SWAP(pvid->vid_osl); + M_16_SWAP(pvid->vid_osa_u); + M_16_SWAP(pvid->vid_osa_l); + M_32_SWAP(pvid->vid_cas); +} + +swabcfg(pcfg) + struct cfg *pcfg; +{ + printf("swapping cfg\n"); + + M_16_SWAP(pcfg->cfg_atm); + M_16_SWAP(pcfg->cfg_prm); + M_16_SWAP(pcfg->cfg_atm); + M_16_SWAP(pcfg->cfg_rec); + M_16_SWAP(pcfg->cfg_trk); + M_16_SWAP(pcfg->cfg_psm); + M_16_SWAP(pcfg->cfg_shd); + M_16_SWAP(pcfg->cfg_pcom); + M_16_SWAP(pcfg->cfg_rwcc); + M_16_SWAP(pcfg->cfg_ecc); + M_16_SWAP(pcfg->cfg_eatm); + M_16_SWAP(pcfg->cfg_eprm); + M_16_SWAP(pcfg->cfg_eatw); + M_16_SWAP(pcfg->cfg_rsvc1); + M_16_SWAP(pcfg->cfg_rsvc2); +} |