mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Another round of updates. Highlights:
(1) Merged i386/i386/sb.h, deleted pc98/pc98/sb.h. (2) pc98/conf/GENERIC8 looks more like i386/conf/GENERIC now. (3) Fixed display bug in pc98/boot/biosboot/io.c. (4) Prepare to merge memory allocation routines: pc98/i386/locore.s pc98/i386/machdep.c pc98/pc98/pc98_machdep.c pc98/pc98/pc98_machdep.h (5) Support new board "C-NET(98)": pc98/pc98/if_ed98.h pc98/pc98/if_ed.c (6) Make sure FPU is recognized for non-Intel CPUs: pc98/pc98/npx.c (7) Do not expect bss to be zero-allocated: pc98/pc98/pc98.c Submitted by: The FreeBSD(98) Development Team
This commit is contained in:
parent
04422105e3
commit
dffcea8d5f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18846
@ -3,7 +3,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.pc98,v 1.4 1996/09/03 10:23:11 asami Exp $
|
||||
# $Id: Makefile.pc98,v 1.5 1996/09/07 02:13:25 asami Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -40,8 +40,7 @@ CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
# of material assistance.
|
||||
#
|
||||
COPTFLAGS?=-O
|
||||
# Not ready for -I- yet. #include "foo.h" where foo.h is in the srcdir fails.
|
||||
INCLUDES= -nostdinc -I. -I$S -I$S/sys
|
||||
INCLUDES= -nostdinc -I- -I. -I$S
|
||||
# This hack is to allow kernel compiles to succeed on machines w/out srcdist
|
||||
.if exists($S/../include)
|
||||
INCLUDES+= -I$S/../include
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: options.pc98,v 1.3 1996/09/10 09:37:14 asami Exp $
|
||||
# $Id: options.pc98,v 1.4 1996/09/12 11:09:21 asami Exp $
|
||||
BOUNCEPAGES opt_bounce.h
|
||||
USER_LDT
|
||||
MATH_EMULATE opt_math_emulate.h
|
||||
@ -23,11 +23,15 @@ PCVT_FREEBSD opt_pcvt.h
|
||||
PCVT_SCANSET opt_pcvt.h
|
||||
XSERVER opt_pcvt.h
|
||||
|
||||
AHC_TAGENABLE opt_aic7xxx.h
|
||||
AHC_SCBPAGING_ENABLE opt_aic7xxx.h
|
||||
|
||||
CLK_CALIBRATION_LOOP opt_clock.h
|
||||
CLK_USE_I8254_CALIBRATION opt_clock.h
|
||||
CLK_USE_I586_CALIBRATION opt_clock.h
|
||||
|
||||
SC_KBD_PROBE_WORKS opt_syscons.h
|
||||
SC_SPLASH_SCREEN opt_syscons.h
|
||||
MAXCONS opt_syscons.h
|
||||
SLOW_VGA opt_syscons.h
|
||||
XT_KEYBOARD opt_syscons.h
|
||||
@ -37,3 +41,4 @@ ATAPI_STATIC opt_atapi.h
|
||||
|
||||
USERCONFIG opt_userconfig.h
|
||||
VISUAL_USERCONFIG opt_userconfig.h
|
||||
USERCONFIG_BOOT opt_userconfig.h
|
||||
|
@ -1,3 +1,17 @@
|
||||
#ifdef PC98
|
||||
#define DSP_RESET (sbc_base + 0x600)
|
||||
#define DSP_READ (sbc_base + 0xA00)
|
||||
#define DSP_WRITE (sbc_base + 0xC00)
|
||||
#define DSP_COMMAND (sbc_base + 0xC00)
|
||||
#define DSP_STATUS (sbc_base + 0xC00)
|
||||
#define DSP_DATA_AVAIL (sbc_base + 0xE00)
|
||||
#define DSP_DATA_AVL16 (sbc_base + 0xF00)
|
||||
#define MIXER_ADDR (sbc_base + 0x400)
|
||||
#define MIXER_DATA (sbc_base + 0x500)
|
||||
#define OPL3_LEFT (sbc_base + 0x000)
|
||||
#define OPL3_RIGHT (sbc_base + 0x200)
|
||||
#define OPL3_BOTH (sbc_base + 0x800)
|
||||
#else
|
||||
#define DSP_RESET (sbc_base + 0x6)
|
||||
#define DSP_READ (sbc_base + 0xA)
|
||||
#define DSP_WRITE (sbc_base + 0xC)
|
||||
@ -10,6 +24,7 @@
|
||||
#define OPL3_LEFT (sbc_base + 0x0)
|
||||
#define OPL3_RIGHT (sbc_base + 0x2)
|
||||
#define OPL3_BOTH (sbc_base + 0x8)
|
||||
#endif
|
||||
/* DSP Commands */
|
||||
|
||||
#define DSP_CMD_SPKON 0xD1
|
||||
|
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, [92/04/03 16:51:14 rvb]
|
||||
* $Id: boot.c,v 1.3 1996/08/31 15:06:21 asami Exp $
|
||||
* $Id: boot.c,v 1.4 1996/09/12 11:08:45 asami Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -64,6 +64,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#ifdef NAMEBLOCK
|
||||
char *dflt_name;
|
||||
#endif
|
||||
char *name;
|
||||
char namebuf[NAMEBUF_LEN];
|
||||
struct bootinfo bootinfo;
|
||||
int loadflags;
|
||||
@ -158,7 +159,7 @@ boot(int drive)
|
||||
} else
|
||||
#endif /*NAMEBLOCK*/
|
||||
loadstart:
|
||||
name = dflname; /* re-initialize in case of loop */
|
||||
name = "/kernel";
|
||||
/* print this all each time.. (saves space to do so) */
|
||||
/* If we have looped, use the previous entries as defaults */
|
||||
printf("\n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory\n"
|
||||
|
@ -24,21 +24,21 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:35:03 rpd
|
||||
* $Id: boot.h,v 1.1.1.1 1996/06/14 10:04:37 asami Exp $
|
||||
* $Id: boot.h,v 1.13 1996/09/14 07:38:14 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <ufs/ufs/quota.h>
|
||||
|
||||
#include <ufs/ffs/fs.h>
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <ufs/ufs/inode.h>
|
||||
|
||||
extern char *devs[], *iodest;
|
||||
extern char *name, dflname[];
|
||||
extern char *devs[];
|
||||
extern char *name;
|
||||
extern struct fs *fs;
|
||||
extern struct inode inode;
|
||||
extern int dosdev, unit, slice, part, maj, boff, poff, bnum, cnt;
|
||||
extern int dosdev, unit, slice, part, maj, boff, poff;
|
||||
extern unsigned long tw_chars;
|
||||
extern int loadflags;
|
||||
extern struct disklabel disklabel;
|
||||
|
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:35:49 rpd
|
||||
* $Id: disk.c,v 1.2 1996/07/23 07:45:36 asami Exp $
|
||||
* $Id: disk.c,v 1.3 1996/09/12 11:08:53 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -65,7 +65,7 @@ int spt, spc;
|
||||
|
||||
struct fs *fs;
|
||||
struct inode inode;
|
||||
int dosdev, unit, slice, part, maj, boff, poff;
|
||||
int dosdev, unit, slice, part, maj, boff;
|
||||
|
||||
/*#define EMBEDDED_DISKLABEL 1*/
|
||||
|
||||
@ -86,13 +86,14 @@ devopen(void)
|
||||
struct dos_partition *dptr;
|
||||
struct disklabel *dl;
|
||||
char *p;
|
||||
int i, sector = 0, di;
|
||||
int i, sector = 0, di, dosdev_copy;
|
||||
|
||||
di = get_diskinfo(dosdev);
|
||||
dosdev_copy = dosdev;
|
||||
di = get_diskinfo(dosdev_copy);
|
||||
spc = (spt = SPT(di)) * HEADS(di);
|
||||
|
||||
#ifndef RAWBOOT
|
||||
if ((dosdev & 0xf0) == 0x90)
|
||||
if ((dosdev_copy & 0xf0) == 0x90)
|
||||
{
|
||||
boff = 0;
|
||||
part = (spt == 15 ? 0 : 1);
|
||||
@ -103,8 +104,8 @@ devopen(void)
|
||||
dl = &disklabel;
|
||||
#else EMBEDDED_DISKLABEL
|
||||
#ifdef PC98
|
||||
p = Bread(dosdev, 1);
|
||||
dptr = (struct dos_partition *)0;
|
||||
p = Bread(dosdev_copy, 1);
|
||||
dptr = (struct dos_partition *)p;
|
||||
slice = WHOLE_DISK_SLICE;
|
||||
for (i = 0; i < NDOSPART; i++, dptr++)
|
||||
if (dptr->dp_mid == DOSPTYP_386BSD) {
|
||||
@ -112,11 +113,11 @@ devopen(void)
|
||||
sector = dptr->dp_scyl * spc;
|
||||
break;
|
||||
}
|
||||
Bread(dosdev, sector + LABELSECTOR);
|
||||
dl=((struct disklabel *)0);
|
||||
p = Bread(dosdev, sector + LABELSECTOR);
|
||||
dl=((struct disklabel *)p);
|
||||
disklabel = *dl; /* structure copy (maybe useful later)*/
|
||||
#else
|
||||
p = Bread(dosdev, 0);
|
||||
p = Bread(dosdev_copy, 0);
|
||||
dptr = (struct dos_partition *)(p+DOSPARTOFF);
|
||||
slice = WHOLE_DISK_SLICE;
|
||||
for (i = 0; i < NDOSPART; i++, dptr++)
|
||||
@ -125,7 +126,7 @@ devopen(void)
|
||||
sector = dptr->dp_start;
|
||||
break;
|
||||
}
|
||||
p = Bread(dosdev, sector + LABELSECTOR);
|
||||
p = Bread(dosdev_copy, sector + LABELSECTOR);
|
||||
dl=((struct disklabel *)p);
|
||||
disklabel = *dl; /* structure copy (maybe useful later)*/
|
||||
#endif /* PC98 */
|
||||
@ -184,7 +185,7 @@ devopen(void)
|
||||
do_bad144 = 0;
|
||||
do {
|
||||
/* XXX: what if the "DOS sector" < 512 bytes ??? */
|
||||
p = Bread(dosdev, dkbbnum + i);
|
||||
p = Bread(dosdev_copy, dkbbnum + i);
|
||||
dkbptr = (struct dkbad *) p;
|
||||
/* XXX why is this not in <sys/dkbad.h> ??? */
|
||||
#define DKBAD_MAGIC 0x4321
|
||||
@ -216,10 +217,12 @@ devread(char *iodest, int sector, int cnt)
|
||||
{
|
||||
int offset;
|
||||
char *p;
|
||||
int dosdev_copy;
|
||||
|
||||
for (offset = 0; offset < cnt; offset += BPS)
|
||||
{
|
||||
p = Bread(dosdev, badsect(dosdev, sector++));
|
||||
dosdev_copy = dosdev;
|
||||
p = Bread(dosdev_copy, badsect(dosdev_copy, sector++));
|
||||
bcopy(p, iodest+offset, BPS);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:35:57 rpd
|
||||
* $Id: io.c,v 1.19 1996/04/30 23:43:25 bde Exp $
|
||||
* $Id: io.c,v 1.3 1996/09/12 11:08:55 asami Exp $
|
||||
*/
|
||||
|
||||
#include "boot.h"
|
||||
@ -325,9 +325,12 @@ void putc(int c)
|
||||
}
|
||||
|
||||
if (crtat >= Crtat + col * row) {
|
||||
for (i = 1; i < row; i++)
|
||||
bcopy((void*)(Crtat+col*i), (void*)(Crtat+col*(i-1)), col*2);
|
||||
for (i = 0, cp = Crtat + col * (row - 1); i < col*2; i++) {
|
||||
cp = Crtat;
|
||||
for (i = 1; i < row; i++) {
|
||||
bcopy((void *)(cp+col), (void *)cp, col*2);
|
||||
cp += col;
|
||||
}
|
||||
for (i = 0; i < col; i++) {
|
||||
*cp++ = ' ';
|
||||
}
|
||||
crtat -= col;
|
||||
|
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:36:34 rpd
|
||||
* $Id: sys.c,v 1.3 1996/09/12 11:09:00 asami Exp $
|
||||
* $Id: sys.c,v 1.4 1996/09/12 11:36:09 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
#include "boot.h"
|
||||
#include <sys/dir.h>
|
||||
#include <sys/dirent.h>
|
||||
#include <sys/reboot.h>
|
||||
|
||||
#ifdef 0
|
||||
@ -51,6 +51,8 @@ char buf[BUFSIZE], fsbuf[BUFSIZE], iobuf[BUFSIZE];
|
||||
char mapbuf[MAPBUFSIZE];
|
||||
int mapblock;
|
||||
|
||||
int poff;
|
||||
|
||||
#ifdef RAWBOOT
|
||||
#define STARTBYTE 8192 /* Where on the media the kernel starts */
|
||||
#endif
|
||||
@ -135,7 +137,7 @@ find(char *path)
|
||||
{
|
||||
char *rest, ch;
|
||||
int block, off, loc, ino = ROOTINO;
|
||||
struct direct *dp;
|
||||
struct dirent *dp;
|
||||
char list_only;
|
||||
|
||||
list_only = (path[0] == '?' && path[1] == '\0');
|
||||
@ -167,12 +169,12 @@ find(char *path)
|
||||
devread(iobuf, fsbtodb(fs, block_map(block)) + boff,
|
||||
blksize(fs, &inode, block));
|
||||
}
|
||||
dp = (struct direct *)(iobuf + off);
|
||||
dp = (struct dirent *)(iobuf + off);
|
||||
loc += dp->d_reclen;
|
||||
if (dp->d_ino && list_only)
|
||||
if (dp->d_fileno && list_only)
|
||||
printf("%s ", dp->d_name);
|
||||
} while (!dp->d_ino || strcmp(path, dp->d_name));
|
||||
ino = dp->d_ino;
|
||||
} while (!dp->d_fileno || strcmp(path, dp->d_name));
|
||||
ino = dp->d_fileno;
|
||||
*(path = rest) = ch;
|
||||
goto loop;
|
||||
}
|
||||
@ -195,8 +197,8 @@ block_map(int file_block)
|
||||
int
|
||||
openrd(void)
|
||||
{
|
||||
char **devp, *cp = name;
|
||||
int biosdrive, ret;
|
||||
char **devp, *name0 = name, *cp = name0;
|
||||
int biosdrive, dosdev_copy, ret;
|
||||
|
||||
#ifdef PC98
|
||||
int i;
|
||||
@ -210,7 +212,7 @@ openrd(void)
|
||||
cp++;
|
||||
if (!*cp)
|
||||
{
|
||||
cp = name;
|
||||
cp = name0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -219,16 +221,16 @@ openrd(void)
|
||||
* by a colon).
|
||||
*/
|
||||
biosdrivedigit = '\0';
|
||||
if (*(name + 1) == ':' && *name >= '0' && *name <= '9') {
|
||||
biosdrivedigit = *name;
|
||||
name += 2;
|
||||
if (*(name0 + 1) == ':' && *name0 >= '0' && *name0 <= '9') {
|
||||
biosdrivedigit = *name0;
|
||||
name0 += 2;
|
||||
}
|
||||
|
||||
if (cp++ != name)
|
||||
if (cp++ != name0)
|
||||
{
|
||||
for (devp = devs; *devp; devp++)
|
||||
if (name[0] == (*devp)[0] &&
|
||||
name[1] == (*devp)[1])
|
||||
if (name0[0] == (*devp)[0] &&
|
||||
name0[1] == (*devp)[1])
|
||||
break;
|
||||
if (!*devp)
|
||||
{
|
||||
@ -271,29 +273,30 @@ openrd(void)
|
||||
{
|
||||
case 4: /* sd */
|
||||
#ifdef PC98
|
||||
dosdev = unit | 0xa0;
|
||||
dosdev_copy = unit | 0xa0;
|
||||
disk_equips = *(unsigned char *)0x11482;
|
||||
unit = 0;
|
||||
for (i = 0; i < unit; i++)
|
||||
unit += ((disk_equips >> i) & 0x01);
|
||||
#else /* IBM-PC */
|
||||
dosdev = biosdrive | 0x80;
|
||||
dosdev_copy = biosdrive | 0x80;
|
||||
#endif
|
||||
break;
|
||||
case 0:
|
||||
case 2:
|
||||
#ifdef PC98
|
||||
dosdev = (maj << 3) | unit | 0x80;
|
||||
dosdev_copy = (maj << 3) | unit | 0x80;
|
||||
#else
|
||||
dosdev = biosdrive;
|
||||
dosdev_copy = biosdrive;
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
printf("Unknown device\n");
|
||||
return 1;
|
||||
}
|
||||
printf("dosdev = %x, biosdrive = %d, unit = %d, maj = %d\n",
|
||||
dosdev, biosdrive, unit, maj);
|
||||
dosdev = dosdev_copy;
|
||||
printf("dosdev= %x, biosdrive = %d, unit = %d, maj = %d\n",
|
||||
dosdev_copy, biosdrive, unit, maj);
|
||||
|
||||
/***********************************************\
|
||||
* Now we know the disk unit and part, *
|
||||
|
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:36:43 rpd
|
||||
* $Id: table.c,v 1.10 1996/04/07 14:28:05 bde Exp $
|
||||
* $Id: table.c,v 1.1.1.1 1996/06/14 10:04:37 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -146,6 +146,4 @@ struct pseudo_desc Idtr_real = { 0x400 - 1, 0x0, 0x0 };
|
||||
* fragmentation.
|
||||
*/
|
||||
char *devs[] = { "wd", "dk", "fd", "wt", "sd", 0 };
|
||||
char dflname[] = "/kernel";
|
||||
char *name = dflname;
|
||||
unsigned long tw_chars = 0x5C2D2F7C; /* "\-/|" */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
|
||||
* $Id: pc98.h,v 1.3 1996/09/10 09:38:21 asami Exp $
|
||||
* $Id: pc98.h,v 1.4 1996/09/12 11:09:54 asami Exp $
|
||||
*/
|
||||
|
||||
#ifndef _PC98_PC98_PC98_H_
|
||||
@ -265,6 +265,8 @@ epson_outsw(u_int port, void *addr, size_t cnt)
|
||||
/*
|
||||
* Obtained from NetBSD/pc98
|
||||
*/
|
||||
#define MADDRUNK -1
|
||||
#define MADDRUNK -1
|
||||
#define IRQUNK 0
|
||||
#define DRQUNK -1
|
||||
|
||||
#endif /* !_PC98_PC98_PC98_H_ */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $
|
||||
* $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -46,13 +46,13 @@
|
||||
|
||||
/*
|
||||
* modified for PC98
|
||||
* $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $
|
||||
* $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Primitive clock interrupt routines.
|
||||
*/
|
||||
#include "opt_ddb.h"
|
||||
|
||||
#include "opt_clock.h"
|
||||
#include "opt_cpu.h"
|
||||
|
||||
@ -414,16 +414,18 @@ rtcintr(struct clockframe frame)
|
||||
}
|
||||
}
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#ifdef DDB
|
||||
static void
|
||||
DDB_printrtc(void)
|
||||
#include <ddb/ddb.h>
|
||||
|
||||
DB_SHOW_COMMAND(rtc, rtc)
|
||||
{
|
||||
printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n",
|
||||
rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY),
|
||||
rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC),
|
||||
rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR));
|
||||
}
|
||||
#endif
|
||||
#endif /* DDB */
|
||||
#endif /* for PC98 */
|
||||
|
||||
static int
|
||||
@ -768,7 +770,7 @@ startrtclock()
|
||||
if (bootverbose) {
|
||||
printf(
|
||||
"Press a key on the console to abort clock calibration\n");
|
||||
while (!cncheckc())
|
||||
while (cncheckc() == -1)
|
||||
calibrate_clocks();
|
||||
}
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $
|
||||
* $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -46,13 +46,13 @@
|
||||
|
||||
/*
|
||||
* modified for PC98
|
||||
* $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $
|
||||
* $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Primitive clock interrupt routines.
|
||||
*/
|
||||
#include "opt_ddb.h"
|
||||
|
||||
#include "opt_clock.h"
|
||||
#include "opt_cpu.h"
|
||||
|
||||
@ -414,16 +414,18 @@ rtcintr(struct clockframe frame)
|
||||
}
|
||||
}
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#ifdef DDB
|
||||
static void
|
||||
DDB_printrtc(void)
|
||||
#include <ddb/ddb.h>
|
||||
|
||||
DB_SHOW_COMMAND(rtc, rtc)
|
||||
{
|
||||
printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n",
|
||||
rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY),
|
||||
rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC),
|
||||
rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR));
|
||||
}
|
||||
#endif
|
||||
#endif /* DDB */
|
||||
#endif /* for PC98 */
|
||||
|
||||
static int
|
||||
@ -768,7 +770,7 @@ startrtclock()
|
||||
if (bootverbose) {
|
||||
printf(
|
||||
"Press a key on the console to abort clock calibration\n");
|
||||
while (!cncheckc())
|
||||
while (cncheckc() == -1)
|
||||
calibrate_clocks();
|
||||
}
|
||||
#endif
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.6 1996/09/10 09:38:34 asami Exp $
|
||||
* $Id: sio.c,v 1.7 1996/09/12 11:09:56 asami Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
@ -875,7 +875,7 @@ sioprobe(dev)
|
||||
* XXX what about the UART bug avoided by waiting in comparam()?
|
||||
* We don't want to to wait long enough to drain at 2 bps.
|
||||
*/
|
||||
outb(iobase + com_cfcr, CFCR_DLAB);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
|
||||
outb(iobase + com_dlbl, COMBRD(9600) & 0xff);
|
||||
outb(iobase + com_dlbh, (u_int) COMBRD(9600) >> 8);
|
||||
outb(iobase + com_cfcr, CFCR_8BITS);
|
||||
@ -1299,7 +1299,6 @@ determined_type: ;
|
||||
dev = makedev(CDEV_MAJOR, 0);
|
||||
cdevsw_add(&dev, &sio_cdevsw, NULL);
|
||||
#ifdef DEVFS
|
||||
/* devsw, minor, type, uid, gid, perm, fmt, ... */
|
||||
com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw,
|
||||
unit, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "ttyd%n", unit);
|
||||
@ -2401,6 +2400,8 @@ comparam(tp, t)
|
||||
int cflag;
|
||||
struct com_s *com;
|
||||
int divisor;
|
||||
u_char dlbh;
|
||||
u_char dlbl;
|
||||
int error;
|
||||
Port_t iobase;
|
||||
int s;
|
||||
@ -2562,8 +2563,18 @@ comparam(tp, t)
|
||||
#endif
|
||||
if (divisor != 0) {
|
||||
outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
|
||||
outb(iobase + com_dlbl, divisor & 0xFF);
|
||||
outb(iobase + com_dlbh, (u_int) divisor >> 8);
|
||||
/*
|
||||
* Only set the divisor registers if they would change,
|
||||
* since on some 16550 incompatibles (UMC8669F), setting
|
||||
* them while input is arriving them loses sync until
|
||||
* data stops arriving.
|
||||
*/
|
||||
dlbl = divisor & 0xFF;
|
||||
if (inb(iobase + com_dlbl) != dlbl)
|
||||
outb(iobase + com_dlbl, dlbl);
|
||||
dlbh = (u_int) divisor >> 8;
|
||||
if (inb(iobase + com_dlbh) != dlbh)
|
||||
outb(iobase + com_dlbh, dlbh);
|
||||
}
|
||||
outb(iobase + com_cfcr, com->cfcr_image = cfcr);
|
||||
#ifdef PC98
|
||||
@ -3035,6 +3046,8 @@ siocnopen(sp)
|
||||
struct siocnstate *sp;
|
||||
{
|
||||
int divisor;
|
||||
u_char dlbh;
|
||||
u_char dlbl;
|
||||
Port_t iobase;
|
||||
|
||||
/*
|
||||
@ -3047,12 +3060,22 @@ siocnopen(sp)
|
||||
outb(iobase + com_ier, 0); /* spltty() doesn't stop siointr() */
|
||||
siocntxwait();
|
||||
sp->cfcr = inb(iobase + com_cfcr);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
|
||||
sp->dlbl = inb(iobase + com_dlbl);
|
||||
sp->dlbh = inb(iobase + com_dlbh);
|
||||
/*
|
||||
* Only set the divisor registers if they would change, since on
|
||||
* some 16550 incompatibles (Startech), setting them clears the
|
||||
* data input register. This also reduces the effects of the
|
||||
* UMC8669F bug.
|
||||
*/
|
||||
divisor = ttspeedtab(comdefaultrate, comspeedtab);
|
||||
outb(iobase + com_dlbl, divisor & 0xFF);
|
||||
outb(iobase + com_dlbh, (u_int) divisor >> 8);
|
||||
dlbl = divisor & 0xFF;
|
||||
if (sp->dlbl != dlbl)
|
||||
outb(iobase + com_dlbl, dlbl);
|
||||
dlbh = (u_int) divisor >> 8;
|
||||
if (sp->dlbh != dlbh)
|
||||
outb(iobase + com_dlbh, dlbh);
|
||||
outb(iobase + com_cfcr, CFCR_8BITS);
|
||||
sp->mcr = inb(iobase + com_mcr);
|
||||
/*
|
||||
@ -3074,9 +3097,11 @@ siocnclose(sp)
|
||||
*/
|
||||
siocntxwait();
|
||||
iobase = siocniobase;
|
||||
outb(iobase + com_cfcr, CFCR_DLAB);
|
||||
outb(iobase + com_dlbl, sp->dlbl);
|
||||
outb(iobase + com_dlbh, sp->dlbh);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
|
||||
if (sp->dlbl != inb(iobase + com_dlbl))
|
||||
outb(iobase + com_dlbl, sp->dlbl);
|
||||
if (sp->dlbh != inb(iobase + com_dlbh))
|
||||
outb(iobase + com_dlbh, sp->dlbh);
|
||||
outb(iobase + com_cfcr, sp->cfcr);
|
||||
/*
|
||||
* XXX damp oscillations of MCR_DTR and MCR_RTS by not restoring them.
|
||||
@ -3128,7 +3153,7 @@ siocncheckc(dev)
|
||||
if (inb(iobase + com_lsr) & LSR_RXRDY)
|
||||
c = inb(iobase + com_data);
|
||||
else
|
||||
c = 0;
|
||||
c = -1;
|
||||
siocnclose(&sp);
|
||||
splx(s);
|
||||
return (c);
|
||||
|
@ -11,7 +11,7 @@
|
||||
# device lines is present in the ./LINT configuration file. If you are
|
||||
# in doubt as to the purpose or necessity of a line, check first in LINT.
|
||||
#
|
||||
# $Id: GENERIC98,v 1.4 1996/09/07 02:13:23 asami Exp $
|
||||
# $Id: GENERIC98,v 1.5 1996/09/12 11:09:16 asami Exp $
|
||||
|
||||
# GENERIC98 -- Generic PC98 machine with WD/SBIC55 disks
|
||||
|
||||
@ -25,7 +25,6 @@ maxusers 10
|
||||
|
||||
options "PC98" #PC98
|
||||
options MATH_EMULATE #Support for x87 emulation
|
||||
#options GPL_MATH_EMULATE #GPL-licensed emulator
|
||||
options INET #InterNETworking
|
||||
options FFS #Berkeley Fast Filesystem
|
||||
options NFS #Network Filesystem
|
||||
@ -33,18 +32,20 @@ options MSDOSFS #MSDOS Filesystem
|
||||
options "CD9660" #ISO 9660 Filesystem
|
||||
options PROCFS #Process filesystem
|
||||
options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
|
||||
options SYSVSHM
|
||||
options SYSVSEM
|
||||
options SYSVMSG
|
||||
options UCONSOLE #Allow users to grab the console
|
||||
options FAILSAFE #Be conservative
|
||||
options USERCONFIG #boot -c editor
|
||||
options VISUAL_USERCONFIG #visual boot -c editor
|
||||
options "MAXCONS=4" #4 virtual consoles
|
||||
options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device
|
||||
options BOUNCE_BUFFERS #include support for DMA bounce buffers
|
||||
options EPSON_BOUNCEDMA #use bounce buufer for 15-16M
|
||||
#options EPSON_MEMWIN #EPSON memory window support
|
||||
options UCONSOLE #Allow users to grab the console
|
||||
options "LINE30"
|
||||
options FAILSAFE #Be conservative
|
||||
options USERCONFIG #boot -c editor
|
||||
options VISUAL_USERCONFIG #visual boot -c editor
|
||||
|
||||
options SYSVSHM
|
||||
options SYSVSEM
|
||||
options SYSVMSG
|
||||
|
||||
options AUTO_CLOCK
|
||||
options COM_MULTIPORT
|
||||
|
||||
@ -102,6 +103,7 @@ device wcd #IDE CD-ROM
|
||||
# for any number of installed devices.
|
||||
controller ncr0
|
||||
controller ahc0
|
||||
|
||||
controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 vector sbicintr
|
||||
#controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0xff vector sbicintr
|
||||
controller aic0 at isa? port 0x1840 bio irq 5 vector aicintr
|
||||
@ -116,6 +118,8 @@ device cd0 #Only need one of these, the code dynamically grows
|
||||
|
||||
device od0
|
||||
|
||||
device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
|
||||
|
||||
controller matcd0 at isa? port? bio
|
||||
|
||||
# syscons is the default console driver, resembling an SCO console
|
||||
@ -161,18 +165,22 @@ device vx0
|
||||
# ed5: SIC-98
|
||||
# ed6: PC-9801-108
|
||||
# ed7: LA-98
|
||||
# ed8: C-NET(98)
|
||||
# ed9: C-NET(98)E/L
|
||||
#
|
||||
device ed0 at isa? port 0x00d0 net irq 6 vector edintr
|
||||
device ed1 at isa? port 0x00d8 net irq 6 flags 0x20000 vector edintr
|
||||
device ed2 at isa? port 0x00d8 net irq 6 flags 0x30000 vector edintr
|
||||
device ed3 at isa? port 0x00d8 net irq 6 flags 0x40000 vector edintr
|
||||
device ed4 at isa? port 0x56d0 net irq 5 flags 0x50000 vector edintr
|
||||
device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x60000 vector edintr
|
||||
device ed6 at isa? port 0x00d0 net irq 6 flags 0x80000 vector edintr
|
||||
device ed7 at isa? port 0x00d0 net irq 6 flags 0x90000 vector edintr
|
||||
device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
|
||||
device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
|
||||
device ed3 at isa? port 0x00d8 net irq 6 flags 0x400000 vector edintr
|
||||
device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
|
||||
device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
|
||||
device ed6 at isa? port 0x00d0 net irq 6 flags 0x800000 vector edintr
|
||||
device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
|
||||
device ed8 at isa? port 0x00d0 net irq 6 flags 0xa00000 vector edintr
|
||||
device ed9 at isa? port 0x00d0 net irq 6 flags 0xb00000 vector edintr
|
||||
|
||||
device fe0 at isa? port 0x00d0 net irq 3 vector feintr
|
||||
device zp0 at isa? port 0x0300 net irq 10 iomem 0xe0000 vector zpintr
|
||||
device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
|
||||
device ep0 at isa? port 0x00d0 net irq 6 vector epintr
|
||||
|
||||
#controller snd0
|
||||
@ -180,9 +188,7 @@ device ep0 at isa? port 0x00d0 net irq 6 vector epintr
|
||||
#device sbxvi0 at isa? drq 3
|
||||
#device sbmidi0 at isa? port 0x80d2
|
||||
#device opl0 at isa? port 0x28d2
|
||||
|
||||
#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
|
||||
|
||||
#device mss0 at isa? port 0xf40 irq12 drq 1 vectro adintr
|
||||
|
||||
pseudo-device loop
|
||||
|
@ -11,7 +11,7 @@
|
||||
# device lines is present in the ./LINT configuration file. If you are
|
||||
# in doubt as to the purpose or necessity of a line, check first in LINT.
|
||||
#
|
||||
# $Id: GENERIC98,v 1.4 1996/09/07 02:13:23 asami Exp $
|
||||
# $Id: GENERIC98,v 1.5 1996/09/12 11:09:16 asami Exp $
|
||||
|
||||
# GENERIC98 -- Generic PC98 machine with WD/SBIC55 disks
|
||||
|
||||
@ -25,7 +25,6 @@ maxusers 10
|
||||
|
||||
options "PC98" #PC98
|
||||
options MATH_EMULATE #Support for x87 emulation
|
||||
#options GPL_MATH_EMULATE #GPL-licensed emulator
|
||||
options INET #InterNETworking
|
||||
options FFS #Berkeley Fast Filesystem
|
||||
options NFS #Network Filesystem
|
||||
@ -33,18 +32,20 @@ options MSDOSFS #MSDOS Filesystem
|
||||
options "CD9660" #ISO 9660 Filesystem
|
||||
options PROCFS #Process filesystem
|
||||
options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
|
||||
options SYSVSHM
|
||||
options SYSVSEM
|
||||
options SYSVMSG
|
||||
options UCONSOLE #Allow users to grab the console
|
||||
options FAILSAFE #Be conservative
|
||||
options USERCONFIG #boot -c editor
|
||||
options VISUAL_USERCONFIG #visual boot -c editor
|
||||
options "MAXCONS=4" #4 virtual consoles
|
||||
options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device
|
||||
options BOUNCE_BUFFERS #include support for DMA bounce buffers
|
||||
options EPSON_BOUNCEDMA #use bounce buufer for 15-16M
|
||||
#options EPSON_MEMWIN #EPSON memory window support
|
||||
options UCONSOLE #Allow users to grab the console
|
||||
options "LINE30"
|
||||
options FAILSAFE #Be conservative
|
||||
options USERCONFIG #boot -c editor
|
||||
options VISUAL_USERCONFIG #visual boot -c editor
|
||||
|
||||
options SYSVSHM
|
||||
options SYSVSEM
|
||||
options SYSVMSG
|
||||
|
||||
options AUTO_CLOCK
|
||||
options COM_MULTIPORT
|
||||
|
||||
@ -102,6 +103,7 @@ device wcd #IDE CD-ROM
|
||||
# for any number of installed devices.
|
||||
controller ncr0
|
||||
controller ahc0
|
||||
|
||||
controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 vector sbicintr
|
||||
#controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0xff vector sbicintr
|
||||
controller aic0 at isa? port 0x1840 bio irq 5 vector aicintr
|
||||
@ -116,6 +118,8 @@ device cd0 #Only need one of these, the code dynamically grows
|
||||
|
||||
device od0
|
||||
|
||||
device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
|
||||
|
||||
controller matcd0 at isa? port? bio
|
||||
|
||||
# syscons is the default console driver, resembling an SCO console
|
||||
@ -161,18 +165,22 @@ device vx0
|
||||
# ed5: SIC-98
|
||||
# ed6: PC-9801-108
|
||||
# ed7: LA-98
|
||||
# ed8: C-NET(98)
|
||||
# ed9: C-NET(98)E/L
|
||||
#
|
||||
device ed0 at isa? port 0x00d0 net irq 6 vector edintr
|
||||
device ed1 at isa? port 0x00d8 net irq 6 flags 0x20000 vector edintr
|
||||
device ed2 at isa? port 0x00d8 net irq 6 flags 0x30000 vector edintr
|
||||
device ed3 at isa? port 0x00d8 net irq 6 flags 0x40000 vector edintr
|
||||
device ed4 at isa? port 0x56d0 net irq 5 flags 0x50000 vector edintr
|
||||
device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x60000 vector edintr
|
||||
device ed6 at isa? port 0x00d0 net irq 6 flags 0x80000 vector edintr
|
||||
device ed7 at isa? port 0x00d0 net irq 6 flags 0x90000 vector edintr
|
||||
device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
|
||||
device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
|
||||
device ed3 at isa? port 0x00d8 net irq 6 flags 0x400000 vector edintr
|
||||
device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
|
||||
device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
|
||||
device ed6 at isa? port 0x00d0 net irq 6 flags 0x800000 vector edintr
|
||||
device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
|
||||
device ed8 at isa? port 0x00d0 net irq 6 flags 0xa00000 vector edintr
|
||||
device ed9 at isa? port 0x00d0 net irq 6 flags 0xb00000 vector edintr
|
||||
|
||||
device fe0 at isa? port 0x00d0 net irq 3 vector feintr
|
||||
device zp0 at isa? port 0x0300 net irq 10 iomem 0xe0000 vector zpintr
|
||||
device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
|
||||
device ep0 at isa? port 0x00d0 net irq 6 vector epintr
|
||||
|
||||
#controller snd0
|
||||
@ -180,9 +188,7 @@ device ep0 at isa? port 0x00d0 net irq 6 vector epintr
|
||||
#device sbxvi0 at isa? drq 3
|
||||
#device sbmidi0 at isa? port 0x80d2
|
||||
#device opl0 at isa? port 0x28d2
|
||||
|
||||
#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
|
||||
|
||||
#device mss0 at isa? port 0xf40 irq12 drq 1 vectro adintr
|
||||
|
||||
pseudo-device loop
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.pc98,v 1.4 1996/09/03 10:23:11 asami Exp $
|
||||
# $Id: Makefile.pc98,v 1.5 1996/09/07 02:13:25 asami Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -40,8 +40,7 @@ CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
# of material assistance.
|
||||
#
|
||||
COPTFLAGS?=-O
|
||||
# Not ready for -I- yet. #include "foo.h" where foo.h is in the srcdir fails.
|
||||
INCLUDES= -nostdinc -I. -I$S -I$S/sys
|
||||
INCLUDES= -nostdinc -I- -I. -I$S
|
||||
# This hack is to allow kernel compiles to succeed on machines w/out srcdist
|
||||
.if exists($S/../include)
|
||||
INCLUDES+= -I$S/../include
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: options.pc98,v 1.3 1996/09/10 09:37:14 asami Exp $
|
||||
# $Id: options.pc98,v 1.4 1996/09/12 11:09:21 asami Exp $
|
||||
BOUNCEPAGES opt_bounce.h
|
||||
USER_LDT
|
||||
MATH_EMULATE opt_math_emulate.h
|
||||
@ -23,11 +23,15 @@ PCVT_FREEBSD opt_pcvt.h
|
||||
PCVT_SCANSET opt_pcvt.h
|
||||
XSERVER opt_pcvt.h
|
||||
|
||||
AHC_TAGENABLE opt_aic7xxx.h
|
||||
AHC_SCBPAGING_ENABLE opt_aic7xxx.h
|
||||
|
||||
CLK_CALIBRATION_LOOP opt_clock.h
|
||||
CLK_USE_I8254_CALIBRATION opt_clock.h
|
||||
CLK_USE_I586_CALIBRATION opt_clock.h
|
||||
|
||||
SC_KBD_PROBE_WORKS opt_syscons.h
|
||||
SC_SPLASH_SCREEN opt_syscons.h
|
||||
MAXCONS opt_syscons.h
|
||||
SLOW_VGA opt_syscons.h
|
||||
XT_KEYBOARD opt_syscons.h
|
||||
@ -37,3 +41,4 @@ ATAPI_STATIC opt_atapi.h
|
||||
|
||||
USERCONFIG opt_userconfig.h
|
||||
VISUAL_USERCONFIG opt_userconfig.h
|
||||
USERCONFIG_BOOT opt_userconfig.h
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
|
||||
* $Id: locore.s,v 1.2 1996/07/23 07:45:53 asami Exp $
|
||||
* $Id: locore.s,v 1.3 1996/10/09 19:47:37 bde Exp $
|
||||
*
|
||||
* originally from: locore.s, by William F. Jolitz
|
||||
*
|
||||
@ -46,6 +46,7 @@
|
||||
#include "apm.h"
|
||||
#include "opt_cpu.h"
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_userconfig.h"
|
||||
|
||||
#include <sys/errno.h>
|
||||
#include <sys/syscall.h>
|
||||
@ -196,6 +197,14 @@ NON_GPROF_ENTRY(btext)
|
||||
.org 0x400
|
||||
_pc98_system_parameter:
|
||||
.space 0x240 /* skip over warm boot shit */
|
||||
1:
|
||||
/* save SYSTEM PARAMETER for resume (NS/T or other) */
|
||||
movl $0xa1000,%esi
|
||||
movl $0x100000,%edi
|
||||
movl $0x0630,%ecx
|
||||
cld
|
||||
rep
|
||||
movsb
|
||||
#else /* IBM-PC */
|
||||
#ifdef BDE_DEBUGGER
|
||||
#ifdef BIOS_STEALS_3K
|
||||
@ -212,9 +221,6 @@ _pc98_system_parameter:
|
||||
movw $0x1234,0x472
|
||||
#endif /* PC98 */
|
||||
|
||||
#ifdef PC98
|
||||
1:
|
||||
#endif
|
||||
/* Set up a real frame in case the double return in newboot is executed. */
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
@ -223,16 +229,6 @@ _pc98_system_parameter:
|
||||
pushl $PSL_KERNEL
|
||||
popfl
|
||||
|
||||
#ifdef PC98
|
||||
/* save SYSTEM PARAMETER for resume (NS/T or other) */
|
||||
movl $0xa1000,%esi
|
||||
movl $0x100000,%edi
|
||||
movl $0x0630,%ecx
|
||||
cld
|
||||
rep
|
||||
movsb
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't trust what the BIOS gives for %fs and %gs. Trust the bootstrap
|
||||
* to set %cs, %ds, %es and %ss.
|
||||
@ -338,31 +334,6 @@ _pc98_system_parameter:
|
||||
|
||||
/* now running relocated at KERNBASE where the system is linked to run */
|
||||
begin:
|
||||
#ifdef PC98
|
||||
/* BIOS $401:available Protect Memory (/128KB)*/
|
||||
xorl %eax,%eax
|
||||
movb _pc98_system_parameter+0x401-0x400,%al
|
||||
shll $17,%eax
|
||||
addl $0x100000,%eax
|
||||
shrl $12,%eax
|
||||
movl %eax,_Maxmem /* Maxmem=(%ax*128K+1M)/4096 */
|
||||
movl %eax,_Maxmem_under16M
|
||||
/* BIOS $594:available Protect Memory over 16M (/1MB) */
|
||||
xorl %edx,%edx
|
||||
movw _pc98_system_parameter+0x594-0x400,%dx
|
||||
cmpl $0,%edx
|
||||
je 1f
|
||||
|
||||
addl $16,%edx
|
||||
shll $8,%edx
|
||||
movl %edx,_Maxmem /* Maxmem=(%dx*1M+16M)/4096 */
|
||||
1:
|
||||
|
||||
testb $8,_pc98_system_parameter+0x501-0x400 /* hireso check */
|
||||
jz 1f
|
||||
movb $0xff,_hireso /* set hireso */
|
||||
1:
|
||||
#endif /* PC98 */
|
||||
|
||||
/* set up bootstrap stack */
|
||||
movl $_kstack+UPAGES*PAGE_SIZE,%esp /* bootstrap stack end location */
|
||||
@ -719,6 +690,15 @@ olddiskboot:
|
||||
movl 12(%ebp),%eax
|
||||
movl %eax,R(_bootdev)
|
||||
|
||||
#if defined(USERCONFIG_BOOT) && defined(USERCONFIG)
|
||||
movl $0x10200, %esi
|
||||
movl $R(_userconfig_from_boot),%edi
|
||||
movl $512,%ecx
|
||||
cld
|
||||
rep
|
||||
movsb
|
||||
#endif /* USERCONFIG_BOOT */
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.7 1996/09/10 09:37:35 asami Exp $
|
||||
* $Id: machdep.c,v 1.8 1996/09/12 11:09:26 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -387,6 +387,10 @@ cpu_startup(dummy)
|
||||
for (i = 1; i < ncallout; i++)
|
||||
callout[i-1].c_next = &callout[i];
|
||||
|
||||
#if defined(USERCONFIG_BOOT) && defined(USERCONFIG)
|
||||
boothowto |= RB_CONFIG;
|
||||
#endif
|
||||
|
||||
if (boothowto & RB_CONFIG) {
|
||||
#ifdef USERCONFIG
|
||||
userconfig();
|
||||
@ -1000,7 +1004,7 @@ init386(first)
|
||||
/*
|
||||
* Initialize DMAC
|
||||
*/
|
||||
init_pc98_dmac();
|
||||
pc98_init_dmac();
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1096,9 +1100,7 @@ init386(first)
|
||||
#endif
|
||||
|
||||
#ifdef PC98
|
||||
#ifdef EPSON_MEMWIN
|
||||
init_epson_memwin();
|
||||
#endif
|
||||
pc98_getmemsize();
|
||||
biosbasemem = 640; /* 640KB */
|
||||
biosextmem = (Maxmem * PAGE_SIZE - 0x100000)/1024; /* extent memory */
|
||||
#else /* IBM-PC */
|
||||
@ -1226,12 +1228,6 @@ init386(first)
|
||||
pa_indx++;
|
||||
}
|
||||
|
||||
#ifdef PC98
|
||||
#ifdef notyet
|
||||
init_cpu_accel_mem();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (target_page = avail_start; target_page < ptoa(Maxmem); target_page += PAGE_SIZE) {
|
||||
int tmp, page_bad = FALSE;
|
||||
|
||||
@ -1245,7 +1241,7 @@ init386(first)
|
||||
* map page into kernel: valid, read/write, non-cacheable
|
||||
*/
|
||||
*(int *)CMAP1 = PG_V | PG_RW | PG_N | target_page;
|
||||
pmap_update();
|
||||
invltlb();
|
||||
|
||||
tmp = *(int *)CADDR1;
|
||||
/*
|
||||
@ -1315,7 +1311,7 @@ init386(first)
|
||||
}
|
||||
|
||||
*(int *)CMAP1 = 0;
|
||||
pmap_update();
|
||||
invltlb();
|
||||
|
||||
/*
|
||||
* XXX
|
||||
@ -1373,6 +1369,9 @@ init386(first)
|
||||
gdp->gd_p = 1;
|
||||
gdp->gd_hioffset = ((int) &IDTVEC(syscall)) >>16;
|
||||
|
||||
/* XXX does this work? */
|
||||
ldt[LBSDICALLS_SEL] = ldt[LSYS5CALLS_SEL];
|
||||
|
||||
/* transfer to user mode */
|
||||
|
||||
_ucodesel = LSEL(LUCODE_SEL, SEL_UPL);
|
||||
|
@ -39,7 +39,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
|
||||
* $Id: pmap.c,v 1.3 1996/09/12 11:09:34 asami Exp $
|
||||
* $Id: pmap.c,v 1.4 1996/10/09 19:47:39 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -294,7 +294,7 @@ pmap_bootstrap(firstaddr, loadaddr)
|
||||
virtual_avail = va;
|
||||
|
||||
*(int *) CMAP1 = *(int *) CMAP2 = *(int *) PTD = 0;
|
||||
pmap_update();
|
||||
invltlb();
|
||||
|
||||
}
|
||||
|
||||
@ -407,32 +407,28 @@ pmap_track_modified( vm_offset_t va) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The below are finer grained pmap_update routines. These eliminate
|
||||
* the gratuitious tlb flushes on non-i386 architectures.
|
||||
*/
|
||||
static PMAP_INLINE void
|
||||
pmap_update_1pg( vm_offset_t va) {
|
||||
#if defined(I386_CPU) || defined(CYRIX_486DLC)
|
||||
/* CYRIX Bug? */
|
||||
if (cpu_class == CPUCLASS_386 || cpu == CPU_486DLC)
|
||||
pmap_update();
|
||||
else
|
||||
#endif
|
||||
__asm __volatile(".byte 0xf,0x1,0x38": :"a" (va));
|
||||
}
|
||||
|
||||
static PMAP_INLINE void
|
||||
pmap_update_2pg( vm_offset_t va1, vm_offset_t va2) {
|
||||
#if defined(I386_CPU) || defined(CYRIX_486DLC)
|
||||
/* CYRIX Bug? */
|
||||
if (cpu_class == CPUCLASS_386 || cpu == CPU_486DLC) {
|
||||
pmap_update();
|
||||
invltlb_1pg( vm_offset_t va) {
|
||||
#if defined(I386_CPU)
|
||||
if (cpu_class == CPUCLASS_386) {
|
||||
invltlb();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__asm __volatile(".byte 0xf,0x1,0x38": :"a" (va1));
|
||||
__asm __volatile(".byte 0xf,0x1,0x38": :"a" (va2));
|
||||
invlpg(va);
|
||||
}
|
||||
}
|
||||
|
||||
static PMAP_INLINE void
|
||||
invltlb_2pg( vm_offset_t va1, vm_offset_t va2) {
|
||||
#if defined(I386_CPU)
|
||||
if (cpu_class == CPUCLASS_386) {
|
||||
invltlb();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
invlpg(va1);
|
||||
invlpg(va2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -501,7 +497,7 @@ get_ptbase(pmap)
|
||||
/* otherwise, we are alternate address space */
|
||||
if (frame != (((unsigned) APTDpde) & PG_FRAME)) {
|
||||
APTDpde = (pd_entry_t) (frame | PG_RW | PG_V);
|
||||
pmap_update();
|
||||
invltlb();
|
||||
}
|
||||
return (unsigned *) APTmap;
|
||||
}
|
||||
@ -527,9 +523,9 @@ pmap_pte(pmap, va)
|
||||
/*
|
||||
* Super fast pmap_pte routine best used when scanning
|
||||
* the pv lists. This eliminates many coarse-grained
|
||||
* pmap_update calls. Note that many of the pv list
|
||||
* invltlb calls. Note that many of the pv list
|
||||
* scans are across different pmaps. It is very wasteful
|
||||
* to do an entire pmap_update for checking a single mapping.
|
||||
* to do an entire invltlb for checking a single mapping.
|
||||
*/
|
||||
|
||||
unsigned *
|
||||
@ -549,7 +545,7 @@ pmap_pte_quick(pmap, va)
|
||||
newpf = pde & PG_FRAME;
|
||||
if ( ((* (unsigned *) PMAP1) & PG_FRAME) != newpf) {
|
||||
* (unsigned *) PMAP1 = newpf | PG_RW | PG_V;
|
||||
pmap_update_1pg((vm_offset_t) PADDR1);
|
||||
invltlb_1pg((vm_offset_t) PADDR1);
|
||||
}
|
||||
return PADDR1 + ((unsigned) index & (NPTEPG - 1));
|
||||
}
|
||||
@ -630,7 +626,7 @@ pmap_qenter(va, m, count)
|
||||
opte = *pte;
|
||||
*pte = npte;
|
||||
if (opte)
|
||||
pmap_update_1pg(tva);
|
||||
invltlb_1pg(tva);
|
||||
}
|
||||
}
|
||||
|
||||
@ -649,7 +645,7 @@ pmap_qremove(va, count)
|
||||
for (i = 0; i < count; i++) {
|
||||
pte = (unsigned *)vtopte(va);
|
||||
*pte = 0;
|
||||
pmap_update_1pg(va);
|
||||
invltlb_1pg(va);
|
||||
va += PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
@ -657,7 +653,7 @@ pmap_qremove(va, count)
|
||||
/*
|
||||
* add a wired page to the kva
|
||||
* note that in order for the mapping to take effect -- you
|
||||
* should do a pmap_update after doing the pmap_kenter...
|
||||
* should do a invltlb after doing the pmap_kenter...
|
||||
*/
|
||||
PMAP_INLINE void
|
||||
pmap_kenter(va, pa)
|
||||
@ -672,7 +668,7 @@ pmap_kenter(va, pa)
|
||||
opte = *pte;
|
||||
*pte = npte;
|
||||
if (opte)
|
||||
pmap_update_1pg(va);
|
||||
invltlb_1pg(va);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -686,7 +682,7 @@ pmap_kremove(va)
|
||||
|
||||
pte = (unsigned *)vtopte(va);
|
||||
*pte = 0;
|
||||
pmap_update_1pg(va);
|
||||
invltlb_1pg(va);
|
||||
}
|
||||
|
||||
static vm_page_t
|
||||
@ -755,11 +751,11 @@ pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m) {
|
||||
if ((((unsigned)pmap->pm_pdir[PTDPTDI]) & PG_FRAME) ==
|
||||
(((unsigned) PTDpde) & PG_FRAME)) {
|
||||
/*
|
||||
* Do a pmap_update to make the invalidated mapping
|
||||
* Do a invltlb to make the invalidated mapping
|
||||
* take effect immediately.
|
||||
*/
|
||||
pteva = UPT_MIN_ADDRESS + i386_ptob(m->pindex);
|
||||
pmap_update_1pg(pteva);
|
||||
invltlb_1pg(pteva);
|
||||
}
|
||||
|
||||
#if defined(PTPHINT)
|
||||
@ -1110,7 +1106,6 @@ pmap_release(pmap)
|
||||
kmem_free(kernel_map, (vm_offset_t) pmap->pm_pdir, PAGE_SIZE);
|
||||
}
|
||||
pmap->pm_pdir = 0;
|
||||
pmap_update();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1458,7 +1453,7 @@ pmap_remove_page(pmap, va)
|
||||
ptq = get_ptbase(pmap) + i386_btop(va);
|
||||
if (*ptq) {
|
||||
(void) pmap_remove_pte(pmap, ptq, va);
|
||||
pmap_update_1pg(va);
|
||||
invltlb_1pg(va);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1546,7 +1541,7 @@ pmap_remove(pmap, sva, eva)
|
||||
}
|
||||
|
||||
if (anyvalid) {
|
||||
pmap_update();
|
||||
invltlb();
|
||||
}
|
||||
pmap_unlock(pmap);
|
||||
}
|
||||
@ -1592,29 +1587,31 @@ pmap_remove_all(pa)
|
||||
while ((pv = TAILQ_FIRST(&ppv->pv_list)) != NULL) {
|
||||
pmap_lock(pv->pv_pmap);
|
||||
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
|
||||
if (tpte = *pte) {
|
||||
pv->pv_pmap->pm_stats.resident_count--;
|
||||
*pte = 0;
|
||||
if (tpte & PG_W)
|
||||
pv->pv_pmap->pm_stats.wired_count--;
|
||||
/*
|
||||
* Update the vm_page_t clean and reference bits.
|
||||
*/
|
||||
if (tpte & PG_M) {
|
||||
|
||||
pv->pv_pmap->pm_stats.resident_count--;
|
||||
|
||||
tpte = *pte;
|
||||
*pte = 0;
|
||||
if (tpte & PG_W)
|
||||
pv->pv_pmap->pm_stats.wired_count--;
|
||||
/*
|
||||
* Update the vm_page_t clean and reference bits.
|
||||
*/
|
||||
if (tpte & PG_M) {
|
||||
#if defined(PMAP_DIAGNOSTIC)
|
||||
if (pmap_nw_modified((pt_entry_t) tpte)) {
|
||||
printf("pmap_remove_all: modified page not writable: va: 0x%lx, pte: 0x%lx\n", pv->pv_va, tpte);
|
||||
}
|
||||
if (pmap_nw_modified((pt_entry_t) tpte)) {
|
||||
printf("pmap_remove_all: modified page not writable: va: 0x%lx, pte: 0x%lx\n", pv->pv_va, tpte);
|
||||
}
|
||||
#endif
|
||||
if (pmap_track_modified(pv->pv_va))
|
||||
ppv->pv_vm_page->dirty = VM_PAGE_BITS_ALL;
|
||||
}
|
||||
if (!update_needed &&
|
||||
((!curproc || (&curproc->p_vmspace->vm_pmap == pv->pv_pmap)) ||
|
||||
(pv->pv_pmap == kernel_pmap))) {
|
||||
update_needed = 1;
|
||||
}
|
||||
if (pmap_track_modified(pv->pv_va))
|
||||
ppv->pv_vm_page->dirty = VM_PAGE_BITS_ALL;
|
||||
}
|
||||
if (!update_needed &&
|
||||
((!curproc || (&curproc->p_vmspace->vm_pmap == pv->pv_pmap)) ||
|
||||
(pv->pv_pmap == kernel_pmap))) {
|
||||
update_needed = 1;
|
||||
}
|
||||
|
||||
TAILQ_REMOVE(&pv->pv_pmap->pm_pvlist, pv, pv_plist);
|
||||
TAILQ_REMOVE(&ppv->pv_list, pv, pv_list);
|
||||
--ppv->pv_list_count;
|
||||
@ -1624,7 +1621,7 @@ pmap_remove_all(pa)
|
||||
}
|
||||
|
||||
if (update_needed)
|
||||
pmap_update();
|
||||
invltlb();
|
||||
splx(s);
|
||||
return;
|
||||
}
|
||||
@ -1700,7 +1697,7 @@ pmap_protect(pmap, sva, eva, prot)
|
||||
}
|
||||
pmap_unlock(pmap);
|
||||
if (anychanged)
|
||||
pmap_update();
|
||||
invltlb();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1848,7 +1845,7 @@ pmap_enter(pmap, va, pa, prot, wired)
|
||||
if ((origpte & ~(PG_M|PG_A)) != newpte) {
|
||||
*pte = newpte;
|
||||
if (origpte)
|
||||
pmap_update_1pg(va);
|
||||
invltlb_1pg(va);
|
||||
}
|
||||
pmap_unlock(pmap);
|
||||
}
|
||||
@ -2206,7 +2203,7 @@ pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr)
|
||||
dst_frame = ((unsigned) dst_pmap->pm_pdir[PTDPTDI]) & PG_FRAME;
|
||||
if (dst_frame != (((unsigned) APTDpde) & PG_FRAME)) {
|
||||
APTDpde = (pd_entry_t) (dst_frame | PG_RW | PG_V);
|
||||
pmap_update();
|
||||
invltlb();
|
||||
}
|
||||
|
||||
for(addr = src_addr; addr < end_addr; addr = pdnxt) {
|
||||
@ -2300,7 +2297,7 @@ pmap_zero_page(phys)
|
||||
*(int *) CMAP2 = PG_V | PG_RW | (phys & PG_FRAME);
|
||||
bzero(CADDR2, PAGE_SIZE);
|
||||
*(int *) CMAP2 = 0;
|
||||
pmap_update_1pg((vm_offset_t) CADDR2);
|
||||
invltlb_1pg((vm_offset_t) CADDR2);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2324,7 +2321,7 @@ pmap_copy_page(src, dst)
|
||||
|
||||
*(int *) CMAP1 = 0;
|
||||
*(int *) CMAP2 = 0;
|
||||
pmap_update_2pg( (vm_offset_t) CADDR1, (vm_offset_t) CADDR2);
|
||||
invltlb_2pg( (vm_offset_t) CADDR1, (vm_offset_t) CADDR2);
|
||||
}
|
||||
|
||||
|
||||
@ -2384,12 +2381,14 @@ pmap_page_exists(pmap, pa)
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
#ifdef NOT_USED_YET
|
||||
#define PMAP_REMOVE_PAGES_CURPROC_ONLY
|
||||
/*
|
||||
* Remove all pages from specified address space
|
||||
* this aids process exit speeds. Also, this code
|
||||
* is special cased for current process only.
|
||||
* is special cased for current process only, but
|
||||
* can have the more generic (and slightly slower)
|
||||
* mode enabled. This is much faster than pmap_remove
|
||||
* in the case of running down an entire address space.
|
||||
*/
|
||||
void
|
||||
pmap_remove_pages(pmap, sva, eva)
|
||||
@ -2452,10 +2451,9 @@ pmap_remove_pages(pmap, sva, eva)
|
||||
free_pv_entry(pv);
|
||||
}
|
||||
splx(s);
|
||||
pmap_update();
|
||||
invltlb();
|
||||
pmap_unlock(pmap);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* pmap_testbit tests bits in pte's
|
||||
@ -2530,7 +2528,6 @@ pmap_changebit(pa, bit, setem)
|
||||
register pv_entry_t pv;
|
||||
pv_table_t *ppv;
|
||||
register unsigned *pte;
|
||||
vm_offset_t va;
|
||||
int changed;
|
||||
int s;
|
||||
|
||||
@ -2549,8 +2546,6 @@ pmap_changebit(pa, bit, setem)
|
||||
pv;
|
||||
pv = TAILQ_NEXT(pv, pv_list)) {
|
||||
|
||||
va = pv->pv_va;
|
||||
|
||||
/*
|
||||
* don't write protect pager mappings
|
||||
*/
|
||||
@ -2561,13 +2556,13 @@ pmap_changebit(pa, bit, setem)
|
||||
|
||||
#if defined(PMAP_DIAGNOSTIC)
|
||||
if (!pv->pv_pmap) {
|
||||
printf("Null pmap (cb) at va: 0x%lx\n", va);
|
||||
printf("Null pmap (cb) at va: 0x%lx\n", pv->pv_va);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
pmap_lock(pv->pv_pmap);
|
||||
pte = pmap_pte_quick(pv->pv_pmap, va);
|
||||
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
|
||||
if (pte == NULL) {
|
||||
pmap_unlock(pv->pv_pmap);
|
||||
continue;
|
||||
@ -2593,7 +2588,7 @@ pmap_changebit(pa, bit, setem)
|
||||
}
|
||||
splx(s);
|
||||
if (changed)
|
||||
pmap_update();
|
||||
invltlb();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2729,7 +2724,7 @@ pmap_ts_referenced(vm_offset_t pa)
|
||||
}
|
||||
splx(s);
|
||||
if (rtval) {
|
||||
pmap_update();
|
||||
invltlb();
|
||||
}
|
||||
return (rtval);
|
||||
}
|
||||
@ -2766,17 +2761,6 @@ pmap_clear_reference(vm_offset_t pa)
|
||||
pmap_changebit((pa), PG_A, FALSE);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
pmap_update_map(pmap_t pmap) {
|
||||
unsigned frame = (unsigned) pmap->pm_pdir[PTDPTDI] & PG_FRAME;
|
||||
if ((pmap == kernel_pmap) ||
|
||||
(frame == (((unsigned) PTDpde) & PG_FRAME))) {
|
||||
pmap_update();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Miscellaneous support routines follow
|
||||
*/
|
||||
@ -2838,7 +2822,7 @@ pmap_mapdev(pa, size)
|
||||
tmpva += PAGE_SIZE;
|
||||
pa += PAGE_SIZE;
|
||||
}
|
||||
pmap_update();
|
||||
invltlb();
|
||||
|
||||
return ((void *) va);
|
||||
}
|
||||
@ -2985,10 +2969,12 @@ static void
|
||||
pmap_pvdump(pa)
|
||||
vm_offset_t pa;
|
||||
{
|
||||
pv_table_t *ppv;
|
||||
register pv_entry_t pv;
|
||||
|
||||
printf("pa %x", pa);
|
||||
for (pv = TAILQ_FIRST(pa_to_pvh(pa));
|
||||
ppv = pa_to_pvh(pa);
|
||||
for (pv = TAILQ_FIRST(&ppv->pv_list);
|
||||
pv;
|
||||
pv = TAILQ_NEXT(pv, pv_list)) {
|
||||
#ifdef used_to_be
|
||||
|
@ -46,7 +46,7 @@
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
**
|
||||
** $Id: userconfig.c,v 1.5 1996/09/10 09:37:38 asami Exp $
|
||||
** $Id: userconfig.c,v 1.6 1996/09/12 11:09:38 asami Exp $
|
||||
**/
|
||||
|
||||
/**
|
||||
@ -79,28 +79,27 @@
|
||||
** - That the only tunable parameter for PCI devices are their flags.
|
||||
** - That flags are _always_ editable.
|
||||
**
|
||||
** Devices marked as disabled are imported as such. It is possible to move
|
||||
** a PCI device onto the inactive list, but it is not possible to actually
|
||||
** prevent the device from being probed. The ability to move is considered
|
||||
** desirable in that people will complain otherwise 8)
|
||||
** Devices marked as disabled are imported as such. PCI devices are
|
||||
** listed under a seperate heading for informational purposes only.
|
||||
** To date, there is no means for changing the behaviour of PCI drivers
|
||||
** from UserConfig.
|
||||
**
|
||||
** Note that some EISA devices probably fall into this category as well,
|
||||
** and in fact the actual bus supported by some drivers is less than clear.
|
||||
** A longer-term goal might be to list drivers by instance rather than
|
||||
** per bus-presence.
|
||||
**
|
||||
** For this tool to be useful, the list of devices below _MUST_ be updated
|
||||
** when a new driver is brought into the kernel. It is not possible to
|
||||
** extract this information from the drivers in the kernel, as the devconf
|
||||
** structure for the device is not registered until the device is probed,
|
||||
** which is too late.
|
||||
** extract this information from the drivers in the kernel.
|
||||
**
|
||||
** XXX - TODO:
|
||||
**
|
||||
** - FIX OPERATION WITH PCVT!
|
||||
**
|
||||
** - Display _what_ a device conflicts with.
|
||||
** - Implement page up/down (as what?)
|
||||
** - Wizard mode (no restrictions)
|
||||
** - Find out how to put syscons back into low-intensity mode so that the
|
||||
** !b escape is useful on the console.
|
||||
** - The min and max values used for editing parameters are probably
|
||||
** very bogus - fix?
|
||||
**
|
||||
** - Only display headings with devices under them. (difficult)
|
||||
**/
|
||||
@ -109,30 +108,56 @@
|
||||
* PC-9801 port by KATO Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
|
||||
*/
|
||||
|
||||
#include "opt_userconfig.h"
|
||||
#include "pci.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
|
||||
#include <machine/clock.h>
|
||||
#include <machine/cons.h>
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#include <i386/isa/isa_device.h>
|
||||
|
||||
#include <pci/pcivar.h>
|
||||
|
||||
#include <opt_userconfig.h>
|
||||
|
||||
static struct isa_device *isa_devlist; /* list read by dset to extract changes */
|
||||
|
||||
#ifdef USERCONFIG_BOOT
|
||||
char userconfig_from_boot[512] = "";
|
||||
|
||||
static int
|
||||
getchar(void)
|
||||
{
|
||||
static char *next = userconfig_from_boot;
|
||||
|
||||
if (next == userconfig_from_boot) {
|
||||
if (strncmp(next, "USERCONFIG\n", 11)) {
|
||||
next++;
|
||||
strcpy(next, "quit\n");
|
||||
} else {
|
||||
next += 11;
|
||||
}
|
||||
}
|
||||
if (*next) {
|
||||
return (*next++);
|
||||
} else {
|
||||
return cngetc();
|
||||
}
|
||||
}
|
||||
#else /* !USERCONFIG_BOOT */
|
||||
#define getchar() cngetc()
|
||||
#endif /* USERCONFIG_BOOT */
|
||||
|
||||
#define putchar(x) cnputc(x)
|
||||
|
||||
#ifdef VISUAL_USERCONFIG
|
||||
static struct isa_device *devtabs[] = { isa_devtab_bio, isa_devtab_tty, isa_devtab_net,
|
||||
isa_devtab_null, NULL };
|
||||
|
||||
|
||||
#define putchar(x) cnputc(x)
|
||||
#define getchar() cngetc()
|
||||
|
||||
|
||||
#ifndef FALSE
|
||||
@ -164,6 +189,7 @@ typedef struct
|
||||
#define CLS_COMMS 3 /* serial, parallel ports */
|
||||
#define CLS_INPUT 4 /* user input : mice, keyboards, joysticks etc */
|
||||
#define CLS_MMEDIA 5 /* "multimedia" devices (sound, video, etc) */
|
||||
#define CLS_PCI 254 /* PCI devices */
|
||||
#define CLS_MISC 255 /* none of the above */
|
||||
|
||||
|
||||
@ -179,6 +205,7 @@ static DEVCLASS_INFO devclass_names[] = {
|
||||
{ "Communications : ", CLS_COMMS},
|
||||
{ "Input : ", CLS_INPUT},
|
||||
{ "Multimedia : ", CLS_MMEDIA},
|
||||
{ "PCI : ", CLS_PCI},
|
||||
{ "Miscellaneous : ", CLS_MISC},
|
||||
{ "",0}};
|
||||
|
||||
@ -187,9 +214,10 @@ static DEVCLASS_INFO devclass_names[] = {
|
||||
|
||||
/** Notes :
|
||||
**
|
||||
** - PCI devices should be marked FLG_FIXED, not FLG_IMMUTABLE. Whilst
|
||||
** it's impossible to disable them, it should be possible to move them
|
||||
** from one list to another for peace of mind.
|
||||
** - PCI devices should be marked FLG_IMMUTABLE. They should not be movable
|
||||
** or editable, and have no attributes. This is handled in getdevs() and
|
||||
** devinfo(), so drivers that have a presence on busses other than PCI
|
||||
** should have appropriate flags set below.
|
||||
** - Devices that shouldn't be seen or removed should be marked FLG_INVISIBLE.
|
||||
** - XXX The list below should be reviewed by the driver authors to verify
|
||||
** that the correct flags have been set for each driver, and that the
|
||||
@ -206,14 +234,22 @@ static DEV_INFO device_info[] = {
|
||||
{"ncr", "NCR 53C810 SCSI controller", FLG_FIXED, CLS_STORAGE},
|
||||
{"wdc", "IDE/ESDI/MFM disk controller", 0, CLS_STORAGE},
|
||||
{"fdc", "Floppy disk controller", FLG_FIXED, CLS_STORAGE},
|
||||
{"scd", "Sony CD-ROM", 0, CLS_STORAGE},
|
||||
{"mcd", "Mitsumi CD-ROM", 0, CLS_STORAGE},
|
||||
{"scd", "Sony CD-ROM", 0, CLS_STORAGE},
|
||||
{"matcdc", "Matsushita/Panasonic/Creative CDROM", 0, CLS_STORAGE},
|
||||
|
||||
{"ed", "NS8390 Ethernet adapters", 0, CLS_NETWORK},
|
||||
{"el", "3C501 Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"ep", "3C509 Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"fe", "Fujitsu MD86960A/MB869685A Ethernet adapters", 0, CLS_NETWORK},
|
||||
{"fea", "DEC DEFEA EISA FDDI adapter", 0, CLS_NETWORK},
|
||||
{"fxp", "Intel EtherExpress Pro/100B Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"ie", "AT&T Starlan 10 and EN100, 3C507, NI5210 Ethernet adapters",0,CLS_NETWORK},
|
||||
{"ix", "Intel EtherExpress Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"le", "DEC Etherworks 2 and 3 Ethernet adapters", 0, CLS_NETWORK},
|
||||
{"lnc", "Isolan, Novell NE2100/NE32-VL Ethernet adapters", 0,CLS_NETWORK},
|
||||
{"vx", "3COM 3C590/3C595 Ethernet adapters", 0, CLS_NETWORK},
|
||||
{"ze", "IBM/National Semiconductor PCMCIA Ethernet adapter",0, CLS_NETWORK},
|
||||
{"zp", "3COM PCMCIA Etherlink III Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"de", "DEC DC21040 Ethernet adapter", FLG_FIXED, CLS_NETWORK},
|
||||
{"fpa", "DEC DEFPA PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
|
||||
@ -221,6 +257,7 @@ static DEV_INFO device_info[] = {
|
||||
{"sio", "8250/16450/16550 Serial port", 0, CLS_COMMS},
|
||||
|
||||
{"lpt", "Parallel printer port", 0, CLS_COMMS},
|
||||
|
||||
{"mse", "PC-9801 Bus Mouse", 0, CLS_INPUT},
|
||||
{"sc", "Syscons console driver", FLG_FIXED, CLS_INPUT},
|
||||
|
||||
@ -261,10 +298,12 @@ static DEV_INFO device_info[] = {
|
||||
{"ep", "3C509 Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"fe", "Fujitsu MD86960A/MB869685A Ethernet adapters", 0, CLS_NETWORK},
|
||||
{"fea", "DEC DEFEA EISA FDDI adapter", 0, CLS_NETWORK},
|
||||
{"fxp", "Intel EtherExpress Pro/100B Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"ie", "AT&T Starlan 10 and EN100, 3C507, NI5210 Ethernet adapters",0,CLS_NETWORK},
|
||||
{"ix", "Intel EtherExpress Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"le", "DEC Etherworks 2 and 3 Ethernet adapters", 0, CLS_NETWORK},
|
||||
{"lnc", "Isolan, Novell NE2100/NE32-VL Ethernet adapters", 0,CLS_NETWORK},
|
||||
{"vx", "3COM 3C590/3C595 Ethernet adapters", 0, CLS_NETWORK},
|
||||
{"ze", "IBM/National Semiconductor PCMCIA Ethernet adapter",0, CLS_NETWORK},
|
||||
{"zp", "3COM PCMCIA Etherlink III Ethernet adapter", 0, CLS_NETWORK},
|
||||
{"de", "DEC DC21040 Ethernet adapter", FLG_FIXED, CLS_NETWORK},
|
||||
@ -377,7 +416,7 @@ static char spaces[] = "
|
||||
static void
|
||||
setdev(DEV_LIST *dev, int enabled)
|
||||
{
|
||||
if (!dev->device) /* PCI device */
|
||||
if (dev->iobase == -2) /* PCI device */
|
||||
return;
|
||||
dev->device->id_iobase = dev->iobase; /* copy happy */
|
||||
dev->device->id_irq = (u_short)(dev->irq < 16 ? 1<<dev->irq : 0); /* IRQ is bitfield */
|
||||
@ -428,23 +467,23 @@ getdevs(void)
|
||||
{
|
||||
if (pcidevice_set.ls_items[i])
|
||||
{
|
||||
if (((struct pci_device *)pcidevice_set.ls_items[i])->pd_name)
|
||||
if (((const struct pci_device *)pcidevice_set.ls_items[i])->pd_name)
|
||||
{
|
||||
strcpy(scratch.dev,((struct pci_device *)pcidevice_set.ls_items[i])->pd_name);
|
||||
strcpy(scratch.dev,((const struct pci_device *)pcidevice_set.ls_items[i])->pd_name);
|
||||
scratch.iobase = -2; /* mark as PCI for future reference */
|
||||
scratch.irq = -2;
|
||||
scratch.drq = -2;
|
||||
scratch.maddr = -2;
|
||||
scratch.msize = -2;
|
||||
scratch.flags = 0;
|
||||
scratch.conflict_ok = 0; /* shouldn't conflict */
|
||||
scratch.comment = DEV_DEVICE; /* is a device */
|
||||
scratch.unit = 0; /* arbitrary number of them */
|
||||
scratch.conflict_ok = 0; /* shouldn't conflict */
|
||||
scratch.comment = DEV_DEVICE; /* is a device */
|
||||
scratch.unit = 0; /* arbitrary number of them */
|
||||
scratch.conflicts = 0;
|
||||
scratch.device = NULL;
|
||||
scratch.changed = 0;
|
||||
|
||||
if (!devinfo(&scratch))
|
||||
if (!devinfo(&scratch)) /* look up name, set class and flags */
|
||||
insdev(&scratch,active); /* always active */
|
||||
}
|
||||
}
|
||||
@ -461,6 +500,9 @@ getdevs(void)
|
||||
**
|
||||
** If the device is marked "invisible", return nonzero; the caller should
|
||||
** not insert any such device into either list.
|
||||
**
|
||||
** PCI devices are always inserted into CLS_PCI, regardless of the class associated
|
||||
** with the driver type.
|
||||
**/
|
||||
static int
|
||||
devinfo(DEV_LIST *dev)
|
||||
@ -471,11 +513,16 @@ devinfo(DEV_LIST *dev)
|
||||
{
|
||||
if (!strcmp(dev->dev,device_info[i].dev))
|
||||
{
|
||||
if (device_info[i].attrib & FLG_INVISIBLE)
|
||||
if (device_info[i].attrib & FLG_INVISIBLE) /* forget we ever saw this one */
|
||||
return(1);
|
||||
strcpy(dev->name,device_info[i].name);
|
||||
dev->attrib = device_info[i].attrib;
|
||||
dev->class = device_info[i].class;
|
||||
strcpy(dev->name,device_info[i].name); /* get the name */
|
||||
if (dev->iobase == -2) { /* is this a PCI device? */
|
||||
dev->attrib = FLG_IMMUTABLE; /* dark green ones up the back... */
|
||||
dev->class = CLS_PCI;
|
||||
} else {
|
||||
dev->attrib = device_info[i].attrib; /* light green ones up the front */
|
||||
dev->class = device_info[i].class;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
@ -538,37 +585,42 @@ addev(DEV_LIST *dev, DEV_LIST **list)
|
||||
static DEV_LIST *
|
||||
findspot(DEV_LIST *dev, DEV_LIST *list)
|
||||
{
|
||||
DEV_LIST *ap;
|
||||
DEV_LIST *ap = NULL;
|
||||
|
||||
for (ap = list; ap; ap = ap->next)
|
||||
/* search for a previous instance of the same device */
|
||||
if (dev->iobase != -2) /* avoid PCI devices grouping with non-PCI devices */
|
||||
{
|
||||
if (ap->comment != DEV_DEVICE) /* ignore comments */
|
||||
continue;
|
||||
if (!strcmp(dev->dev,ap->dev)) /* same base device */
|
||||
for (ap = list; ap; ap = ap->next)
|
||||
{
|
||||
if ((dev->unit <= ap->unit) /* belongs before (equal is bad) */
|
||||
|| !ap->next) /* or end of list */
|
||||
if (ap->comment != DEV_DEVICE) /* ignore comments */
|
||||
continue;
|
||||
if (!strcmp(dev->dev,ap->dev)) /* same base device */
|
||||
{
|
||||
ap = ap->prev; /* back up one */
|
||||
break; /* done here */
|
||||
}
|
||||
if (ap->next) /* if the next item exists */
|
||||
{
|
||||
if (ap->next->comment != DEV_DEVICE) /* next is a comment */
|
||||
break;
|
||||
if (strcmp(dev->dev,ap->next->dev)) /* next is a different device */
|
||||
break;
|
||||
if ((dev->unit <= ap->unit) /* belongs before (equal is bad) */
|
||||
|| !ap->next) /* or end of list */
|
||||
{
|
||||
ap = ap->prev; /* back up one */
|
||||
break; /* done here */
|
||||
}
|
||||
if (ap->next) /* if the next item exists */
|
||||
{
|
||||
if (ap->next->comment != DEV_DEVICE) /* next is a comment */
|
||||
break;
|
||||
if (strcmp(dev->dev,ap->next->dev)) /* next is a different device */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ap)
|
||||
if (!ap) /* not sure yet */
|
||||
{
|
||||
/* search for a class that the device might belong to */
|
||||
for (ap = list; ap; ap = ap->next)
|
||||
{
|
||||
if (ap->comment != DEV_DEVICE) /* look for simlar devices */
|
||||
continue;
|
||||
if (dev->class != ap->class) /* of same class too 8) */
|
||||
if (dev->class != ap->class) /* of same class too 8) */
|
||||
continue;
|
||||
if (strcmp(dev->dev,ap->dev) < 0) /* belongs before the current entry */
|
||||
{
|
||||
@ -637,7 +689,7 @@ movedev(DEV_LIST *dev, DEV_LIST *list)
|
||||
dev->prev = ap; /* point new to current */
|
||||
ap->next = dev; /* and current to new */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** Initlist
|
||||
@ -813,12 +865,17 @@ findconflict(DEV_LIST *list)
|
||||
{
|
||||
if (dp->comment != DEV_DEVICE) /* comments don't usually conflict */
|
||||
continue;
|
||||
if (dp->iobase == -2) /* it's a PCI device, not interested */
|
||||
continue;
|
||||
|
||||
dp->conflicts = 0; /* assume the best */
|
||||
for (sp = list; sp; sp = sp->next) /* scan the entire list for conflicts */
|
||||
{
|
||||
if (sp->comment != DEV_DEVICE) /* likewise */
|
||||
continue;
|
||||
if (dp->iobase == -2) /* it's a PCI device, not interested */
|
||||
continue;
|
||||
|
||||
if (sp == dp) /* always conflict with itself */
|
||||
continue;
|
||||
if (sp->conflict_ok && dp->conflict_ok)
|
||||
@ -1403,7 +1460,11 @@ showparams(DEV_LIST *dev)
|
||||
{
|
||||
sprintf(buf,"Port address : 0x%x",dev->iobase);
|
||||
putxy(1,18,buf);
|
||||
} else {
|
||||
if (dev->iobase == -2) /* a PCI device */
|
||||
putmsg(" PCI devices are automatically configured.");
|
||||
}
|
||||
|
||||
if (dev->irq > 0)
|
||||
{
|
||||
sprintf(buf,"IRQ number : %d",dev->irq);
|
||||
@ -1565,6 +1626,8 @@ editval(int x, int y, int width, int hex, int min, int max, int *val, int ro)
|
||||
VetRet(KEY_UP);
|
||||
break;
|
||||
|
||||
case '\r':
|
||||
case '\n':
|
||||
case 596:
|
||||
VetRet(KEY_DOWN);
|
||||
break;
|
||||
@ -2036,12 +2099,14 @@ visuserconfig(void)
|
||||
{
|
||||
if (dp->comment == DEV_DEVICE) /* can't edit comments, zoom? */
|
||||
{
|
||||
masterhelp(" [!bTAB!n] Change fields [!bQ!n] Save device parameters");
|
||||
editparams(dp);
|
||||
masterhelp(" [!bTAB!n] Change fields [!bQ!n] Save and Exit");
|
||||
putxy(0,17,lines);
|
||||
conflicts = findconflict(active); /* update conflict tags */
|
||||
|
||||
if (dp->iobase != -2) /* can't edit PCI devices */
|
||||
{
|
||||
masterhelp(" [!bTAB!n] Change fields [!bQ!n] Save device parameters");
|
||||
editparams(dp);
|
||||
masterhelp(" [!bTAB!n] Change fields [!bQ!n] Save and Exit");
|
||||
putxy(0,17,lines);
|
||||
conflicts = findconflict(active); /* update conflict tags */
|
||||
}
|
||||
}else{ /* DO on comment = zoom */
|
||||
switch(dp->comment) /* Depends on current state */
|
||||
{
|
||||
@ -2163,8 +2228,8 @@ visuserconfig(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* VISUAL_USERCONFIG */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
@ -2207,7 +2272,7 @@ visuserconfig(void)
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: userconfig.c,v 1.5 1996/09/10 09:37:38 asami Exp $
|
||||
* $Id: userconfig.c,v 1.6 1996/09/12 11:09:38 asami Exp $
|
||||
*/
|
||||
|
||||
#include "scbus.h"
|
||||
@ -2241,7 +2306,7 @@ static void lsscsi(void);
|
||||
static int list_scsi(CmdParm *);
|
||||
#endif
|
||||
|
||||
static void lsdevtab(struct isa_device *);
|
||||
static int lsdevtab(struct isa_device *);
|
||||
static struct isa_device *find_device(char *, int);
|
||||
static struct isa_device *search_devtable(struct isa_device *, char *, int);
|
||||
static void cngets(char *, int);
|
||||
@ -2261,6 +2326,9 @@ static int set_device_enable(CmdParm *);
|
||||
static int set_device_disable(CmdParm *);
|
||||
static int quitfunc(CmdParm *);
|
||||
static int helpfunc(CmdParm *);
|
||||
#if defined(USERCONFIG_BOOT) && defined(VISUAL_USERCONFIG)
|
||||
static int introfunc(CmdParm *);
|
||||
#endif
|
||||
|
||||
static int lineno;
|
||||
|
||||
@ -2289,6 +2357,9 @@ static Cmd CmdList[] = {
|
||||
{ "ex", quitfunc, NULL }, /* exit (quit) */
|
||||
{ "f", set_device_flags, int_parms }, /* flags dev mask */
|
||||
{ "h", helpfunc, NULL }, /* help */
|
||||
#if defined(USERCONFIG_BOOT) && defined(VISUAL_USERCONFIG)
|
||||
{ "intro", introfunc, NULL }, /* intro screen */
|
||||
#endif
|
||||
{ "iom", set_device_mem, addr_parms }, /* iomem dev addr */
|
||||
{ "ios", set_device_iosize, int_parms }, /* iosize dev size */
|
||||
{ "ir", set_device_irq, int_parms }, /* irq dev # */
|
||||
@ -2312,16 +2383,15 @@ userconfig(void)
|
||||
int rval;
|
||||
Cmd *cmd;
|
||||
|
||||
#ifdef PC98
|
||||
printf("\nFreeBSD(98) Kernel Configuration Utility - Version 1.0\n"
|
||||
" Type \"help\" for help or \"visual\" to go to the visual\n"
|
||||
" configuration interface.\n");
|
||||
#else
|
||||
printf("\nFreeBSD Kernel Configuration Utility - Version 1.0\n"
|
||||
" Type \"help\" for help or \"visual\" to go to the visual\n"
|
||||
printf("\nFreeBSD Kernel Configuration Utility - Version 1.1\n"
|
||||
" Type \"help\" for help"
|
||||
#ifdef VISUAL_USERCONFIG
|
||||
" or \"visual\" to go to the visual\n"
|
||||
" configuration interface (requires MGA/VGA display or\n"
|
||||
" serial terminal capable of displaying ANSI graphics).\n");
|
||||
" serial terminal capable of displaying ANSI graphics)"
|
||||
#endif
|
||||
".\n");
|
||||
|
||||
|
||||
while (1) {
|
||||
printf("config> ");
|
||||
@ -2429,10 +2499,10 @@ static int
|
||||
list_devices(CmdParm *parms)
|
||||
{
|
||||
lineno = 0;
|
||||
lsdevtab(&isa_devtab_bio[0]);
|
||||
lsdevtab(&isa_devtab_tty[0]);
|
||||
lsdevtab(&isa_devtab_net[0]);
|
||||
lsdevtab(&isa_devtab_null[0]);
|
||||
if (lsdevtab(&isa_devtab_bio[0])) return 0;
|
||||
if (lsdevtab(&isa_devtab_tty[0])) return 0;
|
||||
if (lsdevtab(&isa_devtab_net[0])) return 0;
|
||||
if (lsdevtab(&isa_devtab_null[0])) return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2544,13 +2614,53 @@ helpfunc(CmdParm *parms)
|
||||
printf("disable <devname>\tDisable device (will not be probed)\n");
|
||||
printf("quit\t\t\tExit this configuration utility\n");
|
||||
printf("reset\t\t\tReset CPU\n");
|
||||
#ifdef VISUAL_USERCONFIG
|
||||
printf("visual\t\t\tGo to fullscreen mode.\n");
|
||||
#endif
|
||||
printf("help\t\t\tThis message\n\n");
|
||||
printf("Commands may be abbreviated to a unique prefix\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(USERCONFIG_BOOT) && defined(VISUAL_USERCONFIG)
|
||||
|
||||
static void
|
||||
center(int y, char *str)
|
||||
{
|
||||
putxy((80 - strlen(str)) / 2, y, str);
|
||||
}
|
||||
|
||||
static int
|
||||
introfunc(CmdParm *parms)
|
||||
{
|
||||
int y = 3;
|
||||
|
||||
clear();
|
||||
center(y, "!iKernel Configuration Editor!n");
|
||||
y += 2;
|
||||
putxy(2, y++, "In this next screen, you will be shown a full list of all the device");
|
||||
putxy(2, y++, "drivers which are available in this copy of the OS kernel. This is");
|
||||
putxy(2, y++, "!inot!n a list of devices which you necessarily have, simply those");
|
||||
putxy(2, y++, "which this kernel is capable of supporting.");
|
||||
++y;
|
||||
putxy(2, y++, "You should go through each device category and delete all entries");
|
||||
putxy(2, y++, "(using the DELETE key) for devices that you do not have. This is an");
|
||||
putxy(2, y++, "important step since it minimizes the chance of conflicts and also");
|
||||
putxy(2, y++, "makes the kernel boot faster since there's no time wasted in trying to");
|
||||
putxy(2, y++, "detect non-existant hardware. If you see an entry for a device which you");
|
||||
putxy(2, y++, "you !ido!n have and it's not a PCI device (which will be auto-configured),");
|
||||
putxy(2, y++, "be sure that its configuration parameters match your actual hardware.");
|
||||
putxy(2, y++, "To edit a device's configuration, simply press ENTER while over it.");
|
||||
putxy(2, y++, "Once you are satisfied with your device configuration, press Q to");
|
||||
putxy(2, y++, "proceed with the booting process.");
|
||||
++y;
|
||||
center(y, "!iPress a key to continue!n");
|
||||
cngetc();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
lsdevtab(struct isa_device *dt)
|
||||
{
|
||||
for (; dt->id_id != 0; dt++) {
|
||||
@ -2559,7 +2669,10 @@ lsdevtab(struct isa_device *dt)
|
||||
|
||||
if (lineno >= 23) {
|
||||
printf("<More> ");
|
||||
(void)cngetc();
|
||||
if (getchar() == 'q') {
|
||||
printf("quit\n");
|
||||
return (1);
|
||||
}
|
||||
printf("\n");
|
||||
lineno = 0;
|
||||
}
|
||||
@ -2594,6 +2707,7 @@ lsdevtab(struct isa_device *dt)
|
||||
printf("%s\n", line);
|
||||
++lineno;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static struct isa_device *
|
||||
@ -2629,7 +2743,7 @@ cngets(char *input, int maxin)
|
||||
int c, nchars = 0;
|
||||
|
||||
while (1) {
|
||||
c = cngetc();
|
||||
c = getchar();
|
||||
/* Treat ^H or ^? as backspace */
|
||||
if ((c == '\010' || c == '\177')) {
|
||||
if (nchars) {
|
||||
|
@ -38,7 +38,7 @@
|
||||
*
|
||||
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
|
||||
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
|
||||
* $Id: vm_machdep.c,v 1.3 1996/09/03 10:23:21 asami Exp $
|
||||
* $Id: vm_machdep.c,v 1.4 1996/09/12 11:09:41 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -779,7 +779,7 @@ cpu_reset() {
|
||||
bzero((caddr_t) PTD, PAGE_SIZE);
|
||||
|
||||
/* "good night, sweet prince .... <THUNK!>" */
|
||||
pmap_update();
|
||||
invltlb();
|
||||
#endif
|
||||
/* NOTREACHED */
|
||||
while(1);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
|
||||
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
|
||||
* $Id: diskslice_machdep.c,v 1.20 1996/04/07 17:32:09 bde Exp $
|
||||
* $Id: atcompat_diskslice.c,v 1.1.1.1 1996/06/14 10:04:42 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -47,6 +47,7 @@
|
||||
#include <stddef.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/conf.h>
|
||||
#ifdef PC98
|
||||
#undef PC98
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $
|
||||
* $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -46,13 +46,13 @@
|
||||
|
||||
/*
|
||||
* modified for PC98
|
||||
* $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $
|
||||
* $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Primitive clock interrupt routines.
|
||||
*/
|
||||
#include "opt_ddb.h"
|
||||
|
||||
#include "opt_clock.h"
|
||||
#include "opt_cpu.h"
|
||||
|
||||
@ -414,16 +414,18 @@ rtcintr(struct clockframe frame)
|
||||
}
|
||||
}
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#ifdef DDB
|
||||
static void
|
||||
DDB_printrtc(void)
|
||||
#include <ddb/ddb.h>
|
||||
|
||||
DB_SHOW_COMMAND(rtc, rtc)
|
||||
{
|
||||
printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n",
|
||||
rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY),
|
||||
rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC),
|
||||
rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR));
|
||||
}
|
||||
#endif
|
||||
#endif /* DDB */
|
||||
#endif /* for PC98 */
|
||||
|
||||
static int
|
||||
@ -768,7 +770,7 @@ startrtclock()
|
||||
if (bootverbose) {
|
||||
printf(
|
||||
"Press a key on the console to abort clock calibration\n");
|
||||
while (!cncheckc())
|
||||
while (cncheckc() == -1)
|
||||
calibrate_clocks();
|
||||
}
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
|
||||
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
|
||||
* $Id: diskslice_machdep.c,v 1.1.1.1 1996/06/14 10:04:43 asami Exp $
|
||||
* $Id: diskslice_machdep.c,v 1.2 1996/07/23 07:46:09 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -45,6 +45,7 @@
|
||||
#include <stddef.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/disklabel.h>
|
||||
#ifndef PC98
|
||||
#define DOSPTYP_EXTENDED 5
|
||||
|
@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_ed.c,v 1.6 1996/09/07 02:13:48 asami Exp $
|
||||
* $Id: if_ed.c,v 1.7 1996/09/10 09:38:04 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -48,6 +48,7 @@
|
||||
* NEC PC-9801-108
|
||||
* MELCO LPC-TJ, LPC-TS, LGY-98, LGH-98, IND-SP, IND-SS, EGY-98
|
||||
* PLANET SMART COM CREDITCARD/2000 PCMCIA, EN-2298
|
||||
* Contec C-NET(98), C-NET(98)E, C-NET(98)L, C-NET(98)E-A, C-NET(98)L-A
|
||||
*
|
||||
* Modified for FreeBSD(98) 2.2 by KATO T. of Nagoya University.
|
||||
*
|
||||
@ -181,6 +182,8 @@ static int ed_probe_Novell __P((struct isa_device *));
|
||||
static int ed_probe_Novell_generic __P((struct ed_softc *, int, int, int));
|
||||
#ifdef PC98
|
||||
static int ed_probe_SIC98 __P((struct isa_device *));
|
||||
static int ed_probe_CNET98 __P((struct isa_device *));
|
||||
static int ed_probe_CNET98EL __P((struct isa_device *));
|
||||
#endif
|
||||
static int ed_probe_HP_pclanp __P((struct isa_device *));
|
||||
|
||||
@ -404,6 +407,10 @@ ed_probe(isa_dev)
|
||||
{
|
||||
int nports;
|
||||
|
||||
#ifdef PC98
|
||||
ed_softc[isa_dev->id_unit].unit = isa_dev->id_unit;
|
||||
#endif
|
||||
|
||||
#if NCRD > 0
|
||||
/*
|
||||
* If PC-Card probe required, then register driver with
|
||||
@ -419,9 +426,8 @@ ed_probe(isa_dev)
|
||||
* PLANET SMART COM CREDITCARD/2000 PCMCIA
|
||||
* IO-DATA PCLA/T
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_LPC)) {
|
||||
ed_softc[isa_dev->id_unit].unit = isa_dev->id_unit;
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LPC)) {
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_LPC;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_LPC);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
@ -436,7 +442,7 @@ ed_probe(isa_dev)
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_GENERIC;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_GENERIC);
|
||||
|
||||
if (ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) {
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) {
|
||||
#endif
|
||||
nports = ed_probe_WD80x3(isa_dev);
|
||||
if (nports)
|
||||
@ -455,8 +461,8 @@ ed_probe(isa_dev)
|
||||
/*
|
||||
* Allied Telesis SIC-98
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_SIC)) {
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_SIC)) {
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_SIC;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_SIC);
|
||||
nports = ed_probe_SIC98(isa_dev);
|
||||
@ -468,8 +474,8 @@ ed_probe(isa_dev)
|
||||
* ELECOM LANEED LD-BDN
|
||||
* PLANET SMART COM 98 EN-2298
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_BDN)) {
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_BDN)) {
|
||||
/* LD-BDN */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_BDN;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_BDN);
|
||||
@ -482,8 +488,8 @@ ed_probe(isa_dev)
|
||||
* MELCO LGY-98, IND-SP, IND-SS
|
||||
* MACNICA NE2098
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_LGY)) {
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LGY)) {
|
||||
/* LGY-98 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_LGY;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_LGY);
|
||||
@ -496,8 +502,8 @@ ed_probe(isa_dev)
|
||||
* ICM DT-ET-25, DT-ET-T5, IF-2766ET, IF-2771ET
|
||||
* D-Link DE-298P, DE-298
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_ICM)) {
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_ICM)) {
|
||||
/* ICM */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_ICM;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_ICM);
|
||||
@ -508,9 +514,10 @@ ed_probe(isa_dev)
|
||||
|
||||
/*
|
||||
* MELCO EGY-98
|
||||
* Contec C-NET(98)E-A, C-NET(98)L-A
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_EGY)) {
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_EGY)) {
|
||||
/* EGY-98 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_EGY;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_EGY);
|
||||
@ -522,8 +529,8 @@ ed_probe(isa_dev)
|
||||
/*
|
||||
* IO-DATA LA/T-98
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_LA98)) {
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LA98)) {
|
||||
/* LA-98 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_LA98;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_LA98);
|
||||
@ -535,8 +542,8 @@ ed_probe(isa_dev)
|
||||
/*
|
||||
* NEC PC-9801-108
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev) == ED_TYPE98_108)) {
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_108)) {
|
||||
/* PC-9801-108 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_108;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_108);
|
||||
@ -544,6 +551,32 @@ ed_probe(isa_dev)
|
||||
if (nports)
|
||||
return (nports);
|
||||
}
|
||||
|
||||
/*
|
||||
* Contec C-NET(98)E/L
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_CNET98EL)) {
|
||||
/* C-NET(98)E/L */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_CNET98EL;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_CNET98EL);
|
||||
nports = ed_probe_CNET98EL(isa_dev);
|
||||
if (nports)
|
||||
return (nports);
|
||||
}
|
||||
|
||||
/*
|
||||
* Contec C-NET(98)
|
||||
*/
|
||||
if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) ||
|
||||
(ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_CNET98)) {
|
||||
/* C-NET(98) */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_CNET98;
|
||||
pc98_set_register(isa_dev, isa_dev->id_unit, ED_TYPE98_CNET98);
|
||||
nports = ed_probe_CNET98(isa_dev);
|
||||
if (nports)
|
||||
return (nports);
|
||||
}
|
||||
#endif
|
||||
|
||||
nports = ed_probe_HP_pclanp(isa_dev);
|
||||
@ -598,9 +631,11 @@ ed_probe_generic8390(sc)
|
||||
return (0);
|
||||
#ifdef PC98
|
||||
}
|
||||
#endif
|
||||
inb(sc->nic_addr + ED_P0_ISR);
|
||||
#else
|
||||
if ((inb(sc->nic_addr + ED_P0_ISR) & ED_ISR_RST) != ED_ISR_RST)
|
||||
return (0);
|
||||
#endif
|
||||
|
||||
return (1);
|
||||
}
|
||||
@ -2058,6 +2093,329 @@ static int ed_probe_SIC98(struct isa_device* pc98_dev)
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Probe and vendor-specific initialization routine for CNET98 boards
|
||||
*/
|
||||
static int
|
||||
ed_probe_CNET98(isa_dev)
|
||||
struct isa_device *isa_dev;
|
||||
|
||||
{
|
||||
struct ed_softc *sc = &ed_softc[isa_dev->id_unit];
|
||||
int i;
|
||||
u_char sum;
|
||||
|
||||
/*
|
||||
* Setup card RAM area and i/o addresses
|
||||
* Kernel Virtual to segment C0000-DFFFF?????
|
||||
*/
|
||||
|
||||
sc->isa16bit = 0; /* 16bit mode off = 0 */
|
||||
sc->cr_proto = ED_CR_RD2;
|
||||
sc->vendor = ED_VENDOR_MISC; /* vendor name */
|
||||
sc->asic_addr = isa_dev->id_iobase;
|
||||
sc->nic_addr = sc->asic_addr; /* 0xa3d0 */
|
||||
sc->is790 = 0; /* special chip */
|
||||
sc->mem_start = (caddr_t)isa_dev->id_maddr;
|
||||
sc->mem_end = sc->mem_start + isa_dev->id_msize;
|
||||
sc->mem_ring = sc->mem_start + (ED_PAGE_SIZE * ED_TXBUF_SIZE);
|
||||
sc->mem_size = isa_dev->id_msize; /* 16kbyte */
|
||||
sc->mem_shared = 1; /* sharedmemory on=1,off=0 */
|
||||
sc->txb_cnt = 1; /* tx buffer counter 1 */
|
||||
sc->tx_page_start = 0; /* page offset 0 */
|
||||
sc->rec_page_start = ED_TXBUF_SIZE; /* page offset 6 */
|
||||
sc->rec_page_stop = isa_dev->id_msize / ED_PAGE_SIZE;
|
||||
/* page offset 40 */
|
||||
|
||||
if (sc->asic_addr == 0xa3d0) {
|
||||
/*
|
||||
* reset card to force it into a known state.
|
||||
*/
|
||||
outb(ED_CNET98_INIT_ADDR, 0x00); /* Request */
|
||||
DELAY(5000);
|
||||
outb(ED_CNET98_INIT_ADDR, 0x01); /* Cancel */
|
||||
DELAY(5000);
|
||||
/*
|
||||
* set i/o address and cpu type
|
||||
*/
|
||||
sc->asic_addr = (0xf000 & sc->asic_addr) >> 8;
|
||||
sc->asic_addr = sc->asic_addr & 0xf0;
|
||||
sc->asic_addr = sc->asic_addr | 0x09;
|
||||
/* debug printf(" Board status %x \n",sc->asic_addr); */
|
||||
outb((ED_CNET98_INIT_ADDR + 2), sc->asic_addr);
|
||||
DELAY(1000);
|
||||
sc->asic_addr = sc->nic_addr;
|
||||
/*
|
||||
* set window ethernet address area
|
||||
* board memory base 0x480000 data 256byte
|
||||
* window base 0xc40000
|
||||
*
|
||||
* FreeBSD address 0xf00c4000
|
||||
*/
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG0L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG0H),0x48);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG1L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG1H),0x41);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG2L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG2H),0x42);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG3L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG3H),0x43);
|
||||
DELAY(10);
|
||||
|
||||
outb((sc->asic_addr + ED_CNET98_WIN_REG),0xc4);
|
||||
DELAY(10);
|
||||
/*
|
||||
* CNET98 checksum code
|
||||
*
|
||||
* for (sum = 0, i = 0; i < ETHER_ADDR_LEN; ++i)
|
||||
* sum ^= *((caddr_t)(isa_dev -> id_maddr + i));
|
||||
* printf(" checkusum = %x \n",sum);
|
||||
*/
|
||||
|
||||
/*
|
||||
* Get station address from on-board ROM
|
||||
*/
|
||||
for (i = 0; i < ETHER_ADDR_LEN; ++i)
|
||||
sc->arpcom.ac_enaddr[i] = *((caddr_t)(isa_dev -> id_maddr + i));
|
||||
|
||||
outb((sc->asic_addr + ED_CNET98_WIN_REG),0x44);
|
||||
DELAY(10);
|
||||
|
||||
/*
|
||||
* set window buffer memory area
|
||||
* board memory base 0x400000 data 16kbyte
|
||||
* window base 0xc40000
|
||||
*
|
||||
* FreeBSD address 0xf00c4000
|
||||
*/
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG0L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG0H),0x40);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG1L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG1H),0x41);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG2L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG2H),0x42);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG3L),0x00);
|
||||
DELAY(10);
|
||||
outb((sc->asic_addr + ED_CNET98_MAP_REG3H),0x43);
|
||||
DELAY(10);
|
||||
|
||||
outb((sc->asic_addr + ED_CNET98_WIN_REG),0xc4);
|
||||
DELAY(10);
|
||||
|
||||
/*
|
||||
* clear interface memory, then sum to make sure its valid
|
||||
*/
|
||||
for (i = 0; i < sc->mem_size; ++i)
|
||||
sc->mem_start[i] = 0x0;
|
||||
for (sum = 0, i = 0; i < sc->mem_size; ++i)
|
||||
sum |= sc->mem_start[i];
|
||||
if (sum != 0x0) {
|
||||
printf("ed%d: CNET98 dual port RAM address error\n",
|
||||
isa_dev->id_unit);
|
||||
return (0);
|
||||
}
|
||||
/*
|
||||
* interrupt set
|
||||
* irq 12 set
|
||||
*/
|
||||
/* int 5 set */
|
||||
outb((sc->asic_addr + ED_CNET98_INT_MASK),0x7e);
|
||||
DELAY(1000);
|
||||
outb((sc->asic_addr + ED_CNET98_INT_LEV),0x20);
|
||||
DELAY(1000);
|
||||
|
||||
return (32); /* 0xa3d0 -- 0xa3df , 0xa7d0 -- 0xa7df */
|
||||
|
||||
} else {
|
||||
return(0); /* error no board */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int ed_probe_CNET98EL(struct isa_device* isa_dev)
|
||||
{
|
||||
struct ed_softc *sc = &ed_softc[isa_dev->id_unit];
|
||||
u_int memsize, n;
|
||||
u_char romdata[ETHER_ADDR_LEN * 2], tmp;
|
||||
static char test_pattern[32] = "THIS is A memory TEST pattern";
|
||||
char test_buffer[32];
|
||||
u_short init_addr = ED_CNET98EL_INIT;
|
||||
int unit = isa_dev->id_unit;
|
||||
|
||||
sc->asic_addr = isa_dev->id_iobase + ED_NOVELL_ASIC_OFFSET;
|
||||
sc->nic_addr = isa_dev->id_iobase + ED_NOVELL_NIC_OFFSET;
|
||||
|
||||
/* Choice initial register address */
|
||||
if (ED_TYPE98SUB(isa_dev->id_flags) != 0) {
|
||||
init_addr = ED_CNET98EL_INIT2;
|
||||
}
|
||||
#ifdef ED_DEBUG
|
||||
printf("ed%d: initial register=%x\n", isa_dev->id_unit, init_addr);
|
||||
#endif
|
||||
|
||||
/* Check i/o address. CNET98E/L only allows ?3d0h */
|
||||
if ((sc->nic_addr & (u_short) 0x0fff) != 0x03d0) {
|
||||
printf("ed%d: Invalid i/o port configuration (%x) must be "
|
||||
"?3d0h for CNET98E/L\n",
|
||||
isa_dev->id_unit, sc->nic_addr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset the board to force it into a known state.
|
||||
*/
|
||||
outb(init_addr, 0x00); /* request */
|
||||
DELAY(5000);
|
||||
outb(init_addr, 0x01); /* cancel */
|
||||
|
||||
/*
|
||||
* Set i/o address(A15-12) and cpu type
|
||||
*/
|
||||
tmp = (sc->nic_addr & (u_short) 0xf000) >> 8;
|
||||
tmp |= (0x08 | 0x01);
|
||||
/*
|
||||
* bit0 is 1:above 80286 or 0:not.
|
||||
* But FreeBSD runs under i386 or higher.
|
||||
* Therefore bit0 must be 1.
|
||||
*/
|
||||
#ifdef ED_DEBUG
|
||||
printf("ed%d: outb(%x, %x)\n", isa_dev->id_unit, init_addr + 2, tmp);
|
||||
#endif
|
||||
outb(init_addr + 2, tmp);
|
||||
|
||||
/* Make sure that we really have a DL9800 board */
|
||||
outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2 | ED_CR_STP);
|
||||
DELAY(5000);
|
||||
tmp = inb(sc->nic_addr + ED_P0_CR);
|
||||
#ifdef ED_DEBUG
|
||||
printf("ed%d: inb(%x) = %x\n", isa_dev->id_unit, sc->nic_addr + ED_P0_CR,
|
||||
tmp);
|
||||
#endif
|
||||
if ((tmp & ~ED_CR_STA) != (ED_CR_RD2 | ED_CR_STP))
|
||||
return (0);
|
||||
if ((inb(sc->nic_addr + ED_P0_ISR) & ED_ISR_RST) != ED_ISR_RST)
|
||||
return (0);
|
||||
|
||||
sc->vendor = ED_VENDOR_NOVELL;
|
||||
sc->mem_shared = 0;
|
||||
sc->cr_proto = ED_CR_RD2;
|
||||
isa_dev->id_maddr = 0;
|
||||
|
||||
/* Test the ability to read and write to the NIC memory. */
|
||||
|
||||
/*
|
||||
* This prevents packets from being stored in the NIC memory when the
|
||||
* readmem routine turns on the start bit in the CR.
|
||||
*/
|
||||
outb(sc->nic_addr + ED_P0_RCR, ED_RCR_MON);
|
||||
|
||||
/* initialize DCR for word operations */
|
||||
outb(sc->nic_addr + ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS);
|
||||
|
||||
sc->isa16bit = 1;
|
||||
|
||||
/* CNET98E/L board has 16k of memory */
|
||||
memsize = 16384;
|
||||
|
||||
/* NIC memory start at zero on a CNET98E/L board */
|
||||
sc->mem_start = (char *) ED_CNET98EL_PAGE_OFFSET;
|
||||
sc->mem_end = sc->mem_start + memsize;
|
||||
sc->tx_page_start = ED_CNET98EL_PAGE_OFFSET / ED_PAGE_SIZE;
|
||||
|
||||
/*
|
||||
* Write a test pattern in word mode. If failure page is not 16k, then
|
||||
* we don't know what this board is.
|
||||
*/
|
||||
for (n = ED_CNET98EL_PAGE_OFFSET; n < 65536; n += 1024) {
|
||||
ed_pio_writemem(sc, test_pattern, n, sizeof(test_pattern));
|
||||
ed_pio_readmem(sc, n, test_buffer, sizeof(test_pattern));
|
||||
|
||||
if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)))
|
||||
break;
|
||||
}
|
||||
if (n != (ED_CNET98EL_PAGE_OFFSET + memsize)) {
|
||||
#ifdef ED_DEBUG
|
||||
printf("ed%d: CNET98E/L memory failure at %x\n", isa_dev->id_unit, n);
|
||||
#endif
|
||||
return (0); /* not a CNET98E/L */
|
||||
}
|
||||
|
||||
/*
|
||||
* Set IRQ. CNET98E/L only allows a choice of irq 3,5,6.
|
||||
*/
|
||||
switch (isa_dev->id_irq) {
|
||||
case IRQ3:
|
||||
outb(sc->asic_addr + ED_CNET98EL_ICR, ED_CNET98EL_ICR_IRQ3);
|
||||
break;
|
||||
case IRQ5:
|
||||
outb(sc->asic_addr + ED_CNET98EL_ICR, ED_CNET98EL_ICR_IRQ5);
|
||||
break;
|
||||
case IRQ6:
|
||||
outb(sc->asic_addr + ED_CNET98EL_ICR, ED_CNET98EL_ICR_IRQ6);
|
||||
break;
|
||||
#if 0
|
||||
case IRQ12:
|
||||
outb(sc->asic_addr + ED_CNET98EL_ICR, ED_CNET98EL_ICR_IRQ12);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
printf(
|
||||
"ed%d: Invalid irq configuration (%d) must be 3,5,6 for CNET98E/L\n",
|
||||
isa_dev->id_unit, ffs(isa_dev->id_irq) - 1);
|
||||
return (0);
|
||||
}
|
||||
outb(sc->asic_addr + ED_CNET98EL_IMR, 0x7e);
|
||||
|
||||
sc->type_str = "CNET98E/L";
|
||||
|
||||
#if 0 /* probably not useful - NE boards only come two ways */
|
||||
/* allow kernel config file overrides */
|
||||
if (isa_dev->id_msize)
|
||||
memsize = isa_dev->id_msize;
|
||||
#endif
|
||||
|
||||
sc->mem_size = memsize;
|
||||
|
||||
/*
|
||||
* Use one xmit buffer if < 16k, two buffers otherwise (if not told
|
||||
* otherwise).
|
||||
*/
|
||||
if ((memsize < 16384) || (isa_dev->id_flags & ED_FLAGS_NO_MULTI_BUFFERING))
|
||||
sc->txb_cnt = 1;
|
||||
else
|
||||
sc->txb_cnt = 2;
|
||||
|
||||
sc->rec_page_start = sc->tx_page_start + sc->txb_cnt * ED_TXBUF_SIZE;
|
||||
sc->rec_page_stop = sc->tx_page_start + memsize / ED_PAGE_SIZE;
|
||||
|
||||
sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE;
|
||||
|
||||
/*
|
||||
* Get station address from on-board ROM
|
||||
*/
|
||||
ed_pio_readmem(sc, 16384, romdata, sizeof(romdata));
|
||||
for (n = 0; n < ETHER_ADDR_LEN; n++)
|
||||
sc->arpcom.ac_enaddr[n] = romdata[n * (sc->isa16bit + 1)];
|
||||
|
||||
/* clear any pending interrupts that might have occurred above */
|
||||
outb(sc->nic_addr + ED_P0_ISR, 0xff);
|
||||
|
||||
return (ED_CNET98EL_IO_PORTS);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -3244,8 +3602,8 @@ ed_pio_readmem(sc, src, dst, amount)
|
||||
} else
|
||||
insb(sc->asic_addr + ED_NOVELL_DATA, dst, amount);
|
||||
#ifdef PC98
|
||||
if (sc->type == ED_TYPE98_LPC)
|
||||
LPCT_1d0_OFF();
|
||||
if (sc->type == ED_TYPE98_LPC)
|
||||
LPCT_1d0_OFF();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -3286,8 +3644,8 @@ ed_pio_writemem(sc, src, dst, len)
|
||||
outb(sc->nic_addr + ED_P0_CR, ED_CR_RD1 | ED_CR_STA);
|
||||
|
||||
#ifdef PC98
|
||||
if (sc->type == ED_TYPE98_LPC)
|
||||
LPCT_1d0_ON();
|
||||
if (sc->type == ED_TYPE98_LPC)
|
||||
LPCT_1d0_ON();
|
||||
#endif
|
||||
|
||||
if (sc->isa16bit)
|
||||
@ -3296,8 +3654,8 @@ ed_pio_writemem(sc, src, dst, len)
|
||||
outsb(sc->asic_addr + ED_NOVELL_DATA, src, len);
|
||||
|
||||
#ifdef PC98
|
||||
if (sc->type == ED_TYPE98_LPC)
|
||||
LPCT_1d0_OFF();
|
||||
if (sc->type == ED_TYPE98_LPC)
|
||||
LPCT_1d0_OFF();
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -77,16 +77,18 @@ static void pc98_set_register __P((struct isa_device *dev,
|
||||
* Card type
|
||||
*
|
||||
* Type Card
|
||||
* 0 Allied Telesis CenterCom LA-98-T
|
||||
* 1 MELCO LPC-TJ, LPC-TS / IO-DATA PCLA/T
|
||||
* 2 PLANET SMART COM 98 EN-2298 / ELECOM LANEED LD-BDN[123]A
|
||||
* 3 MELCO EGY-98
|
||||
* 4 MELCO LGY-98, IND-SP, IND-SS / MACNICA NE2098(XXX)
|
||||
* 5 ICM DT-ET-25, DT-ET-T5, IF-2766ET, IF-2771ET /
|
||||
* 0x00 Allied Telesis CenterCom LA-98-T
|
||||
* 0x10 MELCO LPC-TJ, LPC-TS / IO-DATA PCLA/T
|
||||
* 0x20 PLANET SMART COM 98 EN-2298 / ELECOM LANEED LD-BDN[123]A
|
||||
* 0x30 MELCO EGY-98 / Contec C-NET(98)E-A/L-A
|
||||
* 0x40 MELCO LGY-98, IND-SP, IND-SS / MACNICA NE2098(XXX)
|
||||
* 0x50 ICM DT-ET-25, DT-ET-T5, IF-2766ET, IF-2771ET /
|
||||
* D-Link DE-298P{T,CAT}, DE-298{T,TP,CAT}
|
||||
* 6 Allied Telesis SIC-98
|
||||
* 8 NEC PC-9801-108
|
||||
* 9 IO-DATA LA-98
|
||||
* 0x60 Allied Telesis SIC-98
|
||||
* 0x80 NEC PC-9801-108
|
||||
* 0x90 IO-DATA LA-98
|
||||
* 0xa0 Contec C-NET(98)
|
||||
* 0xb0 Contec C-NET(98)E/L
|
||||
*/
|
||||
#define ED_TYPE98_BASE 0x10
|
||||
|
||||
@ -99,8 +101,13 @@ static void pc98_set_register __P((struct isa_device *dev,
|
||||
#define ED_TYPE98_SIC 0x16
|
||||
#define ED_TYPE98_108 0x18
|
||||
#define ED_TYPE98_LA98 0x19
|
||||
#define ED_TYPE98_CNET98 0x1a
|
||||
#define ED_TYPE98_CNET98EL 0x1b
|
||||
#define ED_TYPE98_UE2212 0x1c
|
||||
|
||||
#define ED_TYPE98(x) (((x & 0xffff0000) >> 20) | ED_TYPE98_BASE)
|
||||
#define ED_TYPE98SUB(x) ((x & 0xf0000) >> 16)
|
||||
|
||||
#define ED_TYPE98(x) (((x->id_flags & 0xffff0000) >> 16) | ED_TYPE98_BASE)
|
||||
|
||||
/*
|
||||
* Page 0 register offsets
|
||||
@ -269,6 +276,68 @@ static void pc98_set_register __P((struct isa_device *dev,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* C-NET(98)
|
||||
*/
|
||||
#define ED_CNET98_INIT_ADDR 0xaaed /* 0xaaed reset register */
|
||||
/* 0xaaef i/o address set */
|
||||
/* offset NIC address */
|
||||
#define ED_CNET98_MAP_REG0L 1 /* MAPPING register0 Low */
|
||||
#define ED_CNET98_MAP_REG1L 3 /* MAPPING register1 Low */
|
||||
#define ED_CNET98_MAP_REG2L 5 /* MAPPING register2 Low */
|
||||
#define ED_CNET98_MAP_REG3L 7 /* MAPPING register3 Low */
|
||||
#define ED_CNET98_MAP_REG0H 9 /* MAPPING register0 Hi */
|
||||
#define ED_CNET98_MAP_REG1H 11 /* MAPPING register1 Hi */
|
||||
#define ED_CNET98_MAP_REG2H 13 /* MAPPING register2 Hi */
|
||||
#define ED_CNET98_MAP_REG3H 15 /* MAPPING register3 Hi */
|
||||
#define ED_CNET98_WIN_REG (0x400 + 1) /* window register */
|
||||
#define ED_CNET98_INT_LEV (0x400 + 3) /* init level register */
|
||||
#define ED_CNET98_INT_REQ (0x400 + 5) /* init request register */
|
||||
#define ED_CNET98_INT_MASK (0x400 + 7) /* init mask register */
|
||||
#define ED_CNET98_INT_STAT (0x400 + 9) /* init status register */
|
||||
#define ED_CNET98_INT_CLR (0x400 + 9) /* init clear register */
|
||||
#define ED_CNET98_RESERVE1 (0x400 + 11)
|
||||
#define ED_CNET98_RESERVE2 (0x400 + 13)
|
||||
#define ED_CNET98_RESERVE3 (0x400 + 15)
|
||||
|
||||
|
||||
/*
|
||||
* C-NET(98)E/L
|
||||
*/
|
||||
/*
|
||||
* NIC Initial Register(on board JP1)
|
||||
*/
|
||||
#define ED_CNET98EL_INIT 0xaaed
|
||||
#define ED_CNET98EL_INIT2 0x55ed
|
||||
|
||||
#define ED_CNET98EL_NIC_OFFSET 0
|
||||
#define ED_CNET98EL_ASIC_OFFSET 0x400 /* offset to nic i/o regs */
|
||||
#define ED_CNET98EL_PAGE_OFFSET 0x0000 /* page offset for NIC access to mem */
|
||||
/*
|
||||
* XXX - The I/O address range is fragmented in the CNET98E/L; this is the
|
||||
* number of regs at iobase.
|
||||
*/
|
||||
#define ED_CNET98EL_IO_PORTS 16 /* # of i/o addresses used */
|
||||
/*
|
||||
* Interrupt Configuration Register (offset from ASIC base)
|
||||
*/
|
||||
#define ED_CNET98EL_ICR 0x02
|
||||
|
||||
#define ED_CNET98EL_ICR_IRQ3 0x01 /* Interrupt request 3 select */
|
||||
#define ED_CNET98EL_ICR_IRQ5 0x02 /* Interrupt request 5 select */
|
||||
#define ED_CNET98EL_ICR_IRQ6 0x04 /* Interrupt request 6 select */
|
||||
#define ED_CNET98EL_ICR_IRQ12 0x20 /* Interrupt request 12 select */
|
||||
/*
|
||||
* Interrupt Mask Register (offset from ASIC base)
|
||||
*/
|
||||
#define ED_CNET98EL_IMR 0x04
|
||||
/*
|
||||
* Interrupt Status Register (offset from ASIC base)
|
||||
*/
|
||||
#define ED_CNET98EL_ISR 0x05
|
||||
|
||||
|
||||
|
||||
/* register offsets */
|
||||
static unsigned int *edp[NED];
|
||||
static unsigned int pc98_io_skip[NED];
|
||||
@ -280,7 +349,7 @@ static int ed_pc_misc[NED];
|
||||
static int ed_pc_reset[NED];
|
||||
|
||||
|
||||
/* NE2000, LGY-98, ICM, LPC-T */
|
||||
/* NE2000, LGY-98, ICM, LPC-T, C-NET(98)E/L */
|
||||
static unsigned int edp_generic[16] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
};
|
||||
@ -315,6 +384,13 @@ static unsigned int edp_nec108[16] = {
|
||||
0x1000, 0x1002, 0x1004, 0x1006, 0x1008, 0x100a, 0x100c, 0x100e
|
||||
};
|
||||
|
||||
/* Contec C-NET(98) */
|
||||
static unsigned int edp_cnet98[16] = {
|
||||
0x0000, 0x0002, 0x0004, 0x0006, 0x0008, 0x000a, 0x000c, 0x000e,
|
||||
0x0400, 0x0402, 0x0404, 0x0406, 0x0408, 0x040a, 0x040c, 0x040e
|
||||
};
|
||||
|
||||
|
||||
static void pc98_set_register(struct isa_device *dev, int unit, int type)
|
||||
{
|
||||
int adj;
|
||||
@ -419,6 +495,26 @@ static void pc98_set_register(struct isa_device *dev, int unit, int type)
|
||||
ED_PC_MISC = 0x18;
|
||||
ED_PC_RESET = 0x1f;
|
||||
break;
|
||||
|
||||
case ED_TYPE98_CNET98EL:
|
||||
edp[unit] = edp_generic;
|
||||
pc98_io_skip[unit] = 1;
|
||||
ED_NOVELL_NIC_OFFSET = 0;
|
||||
ED_NOVELL_ASIC_OFFSET = 0x0400;
|
||||
ED_NOVELL_DATA = 0x000e;
|
||||
ED_NOVELL_RESET = 0x0000; /* dummy */
|
||||
ED_PC_RESET = 0x1f;
|
||||
break;
|
||||
|
||||
case ED_TYPE98_CNET98:
|
||||
edp[unit] = edp_cnet98;
|
||||
pc98_io_skip[unit] = 2;
|
||||
ED_NOVELL_NIC_OFFSET = 0;
|
||||
ED_NOVELL_ASIC_OFFSET = 0x0400;
|
||||
ED_NOVELL_DATA = 0x000e;
|
||||
ED_NOVELL_RESET = 0x0000; /* dummy */
|
||||
ED_PC_RESET = 0x1f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: if_fe.c,v 1.7 1996/09/10 09:38:08 asami Exp $
|
||||
* $Id: if_fe.c,v 1.8 1996/09/12 11:09:48 asami Exp $
|
||||
*
|
||||
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
|
||||
* To be used with FreeBSD 2.x
|
||||
@ -230,7 +230,6 @@ static struct fe_softc {
|
||||
u_short txb_free; /* free bytes in TX buffer */
|
||||
u_char txb_count; /* number of packets in TX buffer */
|
||||
u_char txb_sched; /* number of scheduled packets */
|
||||
u_char txb_padding; /* number of delayed padding bytes */
|
||||
|
||||
/* Multicast address filter management. */
|
||||
u_char filter_change; /* MARs must be changed ASAP. */
|
||||
@ -2822,14 +2821,6 @@ fe_get_packet ( struct fe_softc * sc, u_short len )
|
||||
* Packets shorter than Ethernet minimum are legal, and we pad them
|
||||
* before sending out. An exception is "partial" packets which are
|
||||
* shorter than mandatory Ethernet header.
|
||||
*
|
||||
* I wrote a code for an experimental "delayed padding" technique.
|
||||
* When employed, it postpones the padding process for short packets.
|
||||
* If xmit() occurred at the moment, the padding process is omitted, and
|
||||
* garbage is sent as pad data. If next packet is stored in the
|
||||
* transmission buffer before xmit(), write_mbuf() pads the previous
|
||||
* packet before transmitting new packet. This *may* gain the
|
||||
* system performance (slightly).
|
||||
*/
|
||||
static void
|
||||
fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
|
||||
@ -2841,6 +2832,8 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
|
||||
u_short savebyte; /* WARNING: Architecture dependent! */
|
||||
#define NO_PENDING_BYTE 0xFFFF
|
||||
|
||||
static u_char padding [ ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_HDR_LEN ];
|
||||
|
||||
#if FE_DEBUG >= 2
|
||||
/* First, count up the total number of bytes to copy */
|
||||
length = 0;
|
||||
@ -2863,9 +2856,9 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
|
||||
* it should be a bug of upper layer. We just ignore it.
|
||||
* ... Partial (too short) packets, neither.
|
||||
*/
|
||||
if ( ETHER_IS_VALID_LEN(length + ETHER_CRC_LEN)) {
|
||||
if ( ! ETHER_IS_VALID_LEN(length + ETHER_CRC_LEN)) {
|
||||
log( LOG_ERR,
|
||||
"fe%d: got a out-of-spes packet (%u bytes) to send\n",
|
||||
"fe%d: got an out-of-spec packet (%u bytes) to send\n",
|
||||
sc->sc_unit, length );
|
||||
sc->sc_if.if_oerrors++;
|
||||
return;
|
||||
@ -2931,6 +2924,11 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
|
||||
if ( savebyte != NO_PENDING_BYTE ) {
|
||||
outw( addr_bmpr8, savebyte );
|
||||
}
|
||||
|
||||
/* Pad to the Ethernet minimum length, if the packet is too short. */
|
||||
if ( length < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
|
||||
outsw( addr_bmpr8, padding, ( ETHER_MIN_LEN - ETHER_CRC_LEN - length ) >> 1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.7 1996/09/10 09:37:35 asami Exp $
|
||||
* $Id: machdep.c,v 1.8 1996/09/12 11:09:26 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -387,6 +387,10 @@ cpu_startup(dummy)
|
||||
for (i = 1; i < ncallout; i++)
|
||||
callout[i-1].c_next = &callout[i];
|
||||
|
||||
#if defined(USERCONFIG_BOOT) && defined(USERCONFIG)
|
||||
boothowto |= RB_CONFIG;
|
||||
#endif
|
||||
|
||||
if (boothowto & RB_CONFIG) {
|
||||
#ifdef USERCONFIG
|
||||
userconfig();
|
||||
@ -1000,7 +1004,7 @@ init386(first)
|
||||
/*
|
||||
* Initialize DMAC
|
||||
*/
|
||||
init_pc98_dmac();
|
||||
pc98_init_dmac();
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1096,9 +1100,7 @@ init386(first)
|
||||
#endif
|
||||
|
||||
#ifdef PC98
|
||||
#ifdef EPSON_MEMWIN
|
||||
init_epson_memwin();
|
||||
#endif
|
||||
pc98_getmemsize();
|
||||
biosbasemem = 640; /* 640KB */
|
||||
biosextmem = (Maxmem * PAGE_SIZE - 0x100000)/1024; /* extent memory */
|
||||
#else /* IBM-PC */
|
||||
@ -1226,12 +1228,6 @@ init386(first)
|
||||
pa_indx++;
|
||||
}
|
||||
|
||||
#ifdef PC98
|
||||
#ifdef notyet
|
||||
init_cpu_accel_mem();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (target_page = avail_start; target_page < ptoa(Maxmem); target_page += PAGE_SIZE) {
|
||||
int tmp, page_bad = FALSE;
|
||||
|
||||
@ -1245,7 +1241,7 @@ init386(first)
|
||||
* map page into kernel: valid, read/write, non-cacheable
|
||||
*/
|
||||
*(int *)CMAP1 = PG_V | PG_RW | PG_N | target_page;
|
||||
pmap_update();
|
||||
invltlb();
|
||||
|
||||
tmp = *(int *)CADDR1;
|
||||
/*
|
||||
@ -1315,7 +1311,7 @@ init386(first)
|
||||
}
|
||||
|
||||
*(int *)CMAP1 = 0;
|
||||
pmap_update();
|
||||
invltlb();
|
||||
|
||||
/*
|
||||
* XXX
|
||||
@ -1373,6 +1369,9 @@ init386(first)
|
||||
gdp->gd_p = 1;
|
||||
gdp->gd_hioffset = ((int) &IDTVEC(syscall)) >>16;
|
||||
|
||||
/* XXX does this work? */
|
||||
ldt[LBSDICALLS_SEL] = ldt[LSYS5CALLS_SEL];
|
||||
|
||||
/* transfer to user mode */
|
||||
|
||||
_ucodesel = LSEL(LUCODE_SEL, SEL_UPL);
|
||||
|
@ -32,7 +32,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: npx.c,v 1.5 1996/09/07 02:14:03 asami Exp $
|
||||
* $Id: npx.c,v 1.6 1996/09/10 09:38:17 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -307,6 +307,15 @@ npxprobe1(dvp)
|
||||
*/
|
||||
control &= ~(1 << 2); /* enable divide by 0 trap */
|
||||
fldcw(&control);
|
||||
#ifdef FPU_ERROR_BROKEN
|
||||
/*
|
||||
* FPU error signal doesn't work on some CPU
|
||||
* accelerator board.
|
||||
*/
|
||||
npx_ex16 = 1;
|
||||
dvp->id_irq = 0;
|
||||
return (-1);
|
||||
#endif
|
||||
npx_traps_while_probing = npx_intrs_while_probing = 0;
|
||||
fp_divide_by_0();
|
||||
if (npx_traps_while_probing != 0) {
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
|
||||
* $Id: pc98.c,v 1.6 1996/09/10 09:38:19 asami Exp $
|
||||
* $Id: pc98.c,v 1.7 1996/09/12 11:09:51 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -76,7 +76,7 @@
|
||||
#include "vector.h"
|
||||
|
||||
#ifdef PC98
|
||||
unsigned char hireso;
|
||||
unsigned char hireso = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
|
||||
* $Id: pc98.h,v 1.3 1996/09/10 09:38:21 asami Exp $
|
||||
* $Id: pc98.h,v 1.4 1996/09/12 11:09:54 asami Exp $
|
||||
*/
|
||||
|
||||
#ifndef _PC98_PC98_PC98_H_
|
||||
@ -265,6 +265,8 @@ epson_outsw(u_int port, void *addr, size_t cnt)
|
||||
/*
|
||||
* Obtained from NetBSD/pc98
|
||||
*/
|
||||
#define MADDRUNK -1
|
||||
#define MADDRUNK -1
|
||||
#define IRQUNK 0
|
||||
#define DRQUNK -1
|
||||
|
||||
#endif /* !_PC98_PC98_PC98_H_ */
|
||||
|
@ -50,9 +50,9 @@ void init_cpu_accel_mem __P((void));
|
||||
void init_pc98_dmac __P((void));
|
||||
|
||||
#ifdef EPSON_MEMWIN
|
||||
void init_epson_memwin __P((void));
|
||||
static void init_epson_memwin __P((void));
|
||||
|
||||
void init_epson_memwin(void)
|
||||
static void init_epson_memwin(void)
|
||||
{
|
||||
if (pc98_machine_type & M_EPSON_PC98) {
|
||||
if (Maxmem > 3840) {
|
||||
@ -122,7 +122,7 @@ void init_cpu_accel_mem(void)
|
||||
int tmp, page_bad = FALSE, OrigMaxmem = Maxmem;
|
||||
|
||||
*(int *)CMAP1 = PG_V | PG_RW | PG_N | target_page;
|
||||
pmap_update();
|
||||
invltlb();
|
||||
|
||||
tmp = *(int *)CADDR1;
|
||||
/*
|
||||
@ -161,30 +161,18 @@ void init_cpu_accel_mem(void)
|
||||
*/
|
||||
*(int *)CADDR1 = tmp;
|
||||
if (page_bad == TRUE) {
|
||||
if (target_page > ptoa(4096))
|
||||
Maxmem = atop(target_page);
|
||||
else
|
||||
Maxmem = OrigMaxmem;
|
||||
|
||||
Maxmem = atop(target_page) + 256;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
}
|
||||
*(int *)CMAP1 = 0;
|
||||
pmap_update();
|
||||
|
||||
/* XXX */
|
||||
if (Maxmem > 3840) {
|
||||
Maxmem_under16M = 3840;
|
||||
if (Maxmem < 4096) {
|
||||
Maxmem = 3840;
|
||||
}
|
||||
}
|
||||
invltlb();
|
||||
}
|
||||
}
|
||||
|
||||
int dma_init_flag = 1; /* dummy */
|
||||
|
||||
void init_pc98_dmac(void)
|
||||
void pc98_init_dmac(void)
|
||||
{
|
||||
outb(0x439, (inb(0x439) & 0xfb)); /* DMA Accsess Control over 1MB */
|
||||
outb(0x29, (0x0c | 0)); /* Bank Mode Reg. 16M mode */
|
||||
@ -193,3 +181,22 @@ void init_pc98_dmac(void)
|
||||
outb(0x29, (0x0c | 3)); /* Bank Mode Reg. 16M mode */
|
||||
outb(0x11, 0x50); /* PC98 must be 0x40 */
|
||||
}
|
||||
|
||||
|
||||
void pc98_getmemsize(void)
|
||||
{
|
||||
unsigned char under16, over16;
|
||||
|
||||
/* available protected memory size under 16MB / 128KB */
|
||||
under16 = PC98_SYSTEM_PARAMETER(0x401);
|
||||
/* available protected memory size over 16MB / 1MB */
|
||||
over16 = PC98_SYSTEM_PARAMETER(0x594);
|
||||
/* add conventional memory size (1024KB / 128KB = 8) */
|
||||
under16 += 8;
|
||||
|
||||
Maxmem = Maxmem_under16M = under16 * 128 * 1024 / PAGE_SIZE;
|
||||
Maxmem += (over16 * 1024 * 1024 / PAGE_SIZE);
|
||||
#ifdef EPSON_MEMWIN
|
||||
init_epson_memwin();
|
||||
#endif
|
||||
}
|
||||
|
@ -28,10 +28,7 @@
|
||||
#ifndef __PC98_PC98_PC98_MACHDEP_H__
|
||||
#define __PC98_PC98_PC98_MACHDEP_H__
|
||||
|
||||
#ifdef EPSON_MEMWIN
|
||||
void init_epson_memwin __P((void));
|
||||
#endif
|
||||
void init_cpu_accel_mem __P((void));
|
||||
void init_pc98_dmac __P((void));
|
||||
void pc98_init_dmac __P((void));
|
||||
void pc98_getmemsize __P((void));
|
||||
|
||||
#endif /* __PC98_PC98_PC98_MACHDEP_H__ */
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: pcaudio.c,v 1.4 1996/09/03 10:23:50 asami Exp $
|
||||
* $Id: pcaudio.c,v 1.5 1996/09/10 09:38:24 asami Exp $
|
||||
*/
|
||||
|
||||
#include "pca.h"
|
||||
@ -54,6 +54,7 @@
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/timerreg.h>
|
||||
|
||||
#define DSP_ULAW_NOT_WANTED
|
||||
#include <i386/isa/sound/ulaw.h>
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* random_machdep.c -- A strong random number generator
|
||||
*
|
||||
* $Id: random_machdep.c,v 1.5 1996/09/07 02:14:17 asami Exp $
|
||||
* $Id: random_machdep.c,v 1.6 1996/10/09 19:47:44 bde Exp $
|
||||
*
|
||||
* Version 0.95, last modified 18-Oct-95
|
||||
*
|
||||
@ -48,6 +48,8 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#include <machine/clock.h>
|
||||
#include <machine/random.h>
|
||||
@ -97,6 +99,7 @@ struct random_bucket {
|
||||
u_int entropy_count;
|
||||
int input_rotate;
|
||||
u_int32_t *pool;
|
||||
struct selinfo rsel;
|
||||
};
|
||||
|
||||
/* There is one of these per entropy source */
|
||||
@ -130,6 +133,8 @@ rand_initialize(void)
|
||||
random_state.entropy_count = 0;
|
||||
random_state.pool = random_pool;
|
||||
random_wait = NULL;
|
||||
random_state.rsel.si_flags = 0;
|
||||
random_state.rsel.si_pid = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -237,6 +242,9 @@ add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state,
|
||||
/* Prevent overflow */
|
||||
if (r->entropy_count > POOLBITS)
|
||||
r->entropy_count = POOLBITS;
|
||||
|
||||
if (r->entropy_count >= 8)
|
||||
selwakeup(&random_state.rsel);
|
||||
}
|
||||
|
||||
void
|
||||
@ -491,3 +499,24 @@ write_random(const char *buf, u_int nbytes)
|
||||
return nbytes;
|
||||
}
|
||||
#endif /* notused */
|
||||
|
||||
int
|
||||
random_select(dev_t dev, int rw, struct proc *p)
|
||||
{
|
||||
int s, ret;
|
||||
|
||||
if (rw == FWRITE)
|
||||
return 1; /* heh. */
|
||||
|
||||
s = splhigh();
|
||||
if (random_state.entropy_count >= 8)
|
||||
ret = 1;
|
||||
else {
|
||||
selrecord(p, &random_state.rsel);
|
||||
ret = 0;
|
||||
}
|
||||
splx(s);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/icu.h>
|
||||
#include <pc98/pc98/ic/i8237.h>
|
||||
#include <i386/isa/ic/i8237.h>
|
||||
#include <pc98/pc98/scsireg.h>
|
||||
#include <scsi/scsi_all.h>
|
||||
#include <scsi/scsiconf.h>
|
||||
|
@ -72,7 +72,7 @@
|
||||
#include <i386/isa/icu.h>
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <pc98/pc98/ic/i8237.h>
|
||||
#include <i386/isa/ic/i8237.h>
|
||||
#include <scsi/scsi_all.h>
|
||||
#include <scsi/scsiconf.h>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.6 1996/09/10 09:38:34 asami Exp $
|
||||
* $Id: sio.c,v 1.7 1996/09/12 11:09:56 asami Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
@ -875,7 +875,7 @@ sioprobe(dev)
|
||||
* XXX what about the UART bug avoided by waiting in comparam()?
|
||||
* We don't want to to wait long enough to drain at 2 bps.
|
||||
*/
|
||||
outb(iobase + com_cfcr, CFCR_DLAB);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
|
||||
outb(iobase + com_dlbl, COMBRD(9600) & 0xff);
|
||||
outb(iobase + com_dlbh, (u_int) COMBRD(9600) >> 8);
|
||||
outb(iobase + com_cfcr, CFCR_8BITS);
|
||||
@ -1299,7 +1299,6 @@ determined_type: ;
|
||||
dev = makedev(CDEV_MAJOR, 0);
|
||||
cdevsw_add(&dev, &sio_cdevsw, NULL);
|
||||
#ifdef DEVFS
|
||||
/* devsw, minor, type, uid, gid, perm, fmt, ... */
|
||||
com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw,
|
||||
unit, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "ttyd%n", unit);
|
||||
@ -2401,6 +2400,8 @@ comparam(tp, t)
|
||||
int cflag;
|
||||
struct com_s *com;
|
||||
int divisor;
|
||||
u_char dlbh;
|
||||
u_char dlbl;
|
||||
int error;
|
||||
Port_t iobase;
|
||||
int s;
|
||||
@ -2562,8 +2563,18 @@ comparam(tp, t)
|
||||
#endif
|
||||
if (divisor != 0) {
|
||||
outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
|
||||
outb(iobase + com_dlbl, divisor & 0xFF);
|
||||
outb(iobase + com_dlbh, (u_int) divisor >> 8);
|
||||
/*
|
||||
* Only set the divisor registers if they would change,
|
||||
* since on some 16550 incompatibles (UMC8669F), setting
|
||||
* them while input is arriving them loses sync until
|
||||
* data stops arriving.
|
||||
*/
|
||||
dlbl = divisor & 0xFF;
|
||||
if (inb(iobase + com_dlbl) != dlbl)
|
||||
outb(iobase + com_dlbl, dlbl);
|
||||
dlbh = (u_int) divisor >> 8;
|
||||
if (inb(iobase + com_dlbh) != dlbh)
|
||||
outb(iobase + com_dlbh, dlbh);
|
||||
}
|
||||
outb(iobase + com_cfcr, com->cfcr_image = cfcr);
|
||||
#ifdef PC98
|
||||
@ -3035,6 +3046,8 @@ siocnopen(sp)
|
||||
struct siocnstate *sp;
|
||||
{
|
||||
int divisor;
|
||||
u_char dlbh;
|
||||
u_char dlbl;
|
||||
Port_t iobase;
|
||||
|
||||
/*
|
||||
@ -3047,12 +3060,22 @@ siocnopen(sp)
|
||||
outb(iobase + com_ier, 0); /* spltty() doesn't stop siointr() */
|
||||
siocntxwait();
|
||||
sp->cfcr = inb(iobase + com_cfcr);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
|
||||
sp->dlbl = inb(iobase + com_dlbl);
|
||||
sp->dlbh = inb(iobase + com_dlbh);
|
||||
/*
|
||||
* Only set the divisor registers if they would change, since on
|
||||
* some 16550 incompatibles (Startech), setting them clears the
|
||||
* data input register. This also reduces the effects of the
|
||||
* UMC8669F bug.
|
||||
*/
|
||||
divisor = ttspeedtab(comdefaultrate, comspeedtab);
|
||||
outb(iobase + com_dlbl, divisor & 0xFF);
|
||||
outb(iobase + com_dlbh, (u_int) divisor >> 8);
|
||||
dlbl = divisor & 0xFF;
|
||||
if (sp->dlbl != dlbl)
|
||||
outb(iobase + com_dlbl, dlbl);
|
||||
dlbh = (u_int) divisor >> 8;
|
||||
if (sp->dlbh != dlbh)
|
||||
outb(iobase + com_dlbh, dlbh);
|
||||
outb(iobase + com_cfcr, CFCR_8BITS);
|
||||
sp->mcr = inb(iobase + com_mcr);
|
||||
/*
|
||||
@ -3074,9 +3097,11 @@ siocnclose(sp)
|
||||
*/
|
||||
siocntxwait();
|
||||
iobase = siocniobase;
|
||||
outb(iobase + com_cfcr, CFCR_DLAB);
|
||||
outb(iobase + com_dlbl, sp->dlbl);
|
||||
outb(iobase + com_dlbh, sp->dlbh);
|
||||
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
|
||||
if (sp->dlbl != inb(iobase + com_dlbl))
|
||||
outb(iobase + com_dlbl, sp->dlbl);
|
||||
if (sp->dlbh != inb(iobase + com_dlbh))
|
||||
outb(iobase + com_dlbh, sp->dlbh);
|
||||
outb(iobase + com_cfcr, sp->cfcr);
|
||||
/*
|
||||
* XXX damp oscillations of MCR_DTR and MCR_RTS by not restoring them.
|
||||
@ -3128,7 +3153,7 @@ siocncheckc(dev)
|
||||
if (inb(iobase + com_lsr) & LSR_RXRDY)
|
||||
c = inb(iobase + com_data);
|
||||
else
|
||||
c = 0;
|
||||
c = -1;
|
||||
siocnclose(&sp);
|
||||
splx(s);
|
||||
return (c);
|
||||
|
@ -480,7 +480,11 @@ static struct audio_operations ad1848_pcm_operations[MAX_AUDIO_DEV] =
|
||||
{
|
||||
{
|
||||
"Generic AD1848 codec",
|
||||
#ifdef PC98
|
||||
NEEDS_RESTART,
|
||||
#else
|
||||
DMA_AUTOMODE,
|
||||
#endif
|
||||
AFMT_U8, /* Will be set later */
|
||||
NULL,
|
||||
ad1848_open,
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <sys/proc.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/filio.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/syslog.h>
|
||||
|
@ -377,7 +377,11 @@ pas_pcm_prepare_for_output (int dev, int bsize, int bcount)
|
||||
static struct audio_operations pas_pcm_operations =
|
||||
{
|
||||
"Pro Audio Spectrum",
|
||||
#ifdef PC98
|
||||
NEEDS_RESTART,
|
||||
#else
|
||||
DMA_AUTOMODE,
|
||||
#endif
|
||||
AFMT_U8 | AFMT_S16_LE,
|
||||
NULL,
|
||||
pas_pcm_open,
|
||||
|
@ -1,43 +0,0 @@
|
||||
#ifdef PC98
|
||||
#define DSP_RESET (sbc_base + 0x600)
|
||||
#define DSP_READ (sbc_base + 0xA00)
|
||||
#define DSP_WRITE (sbc_base + 0xC00)
|
||||
#define DSP_COMMAND (sbc_base + 0xC00)
|
||||
#define DSP_STATUS (sbc_base + 0xC00)
|
||||
#define DSP_DATA_AVAIL (sbc_base + 0xE00)
|
||||
#define DSP_DATA_AVL16 (sbc_base + 0xF00)
|
||||
#define MIXER_ADDR (sbc_base + 0x400)
|
||||
#define MIXER_DATA (sbc_base + 0x500)
|
||||
#define OPL3_LEFT (sbc_base + 0x000)
|
||||
#define OPL3_RIGHT (sbc_base + 0x200)
|
||||
#define OPL3_BOTH (sbc_base + 0x800)
|
||||
#else
|
||||
#define DSP_RESET (sbc_base + 0x6)
|
||||
#define DSP_READ (sbc_base + 0xA)
|
||||
#define DSP_WRITE (sbc_base + 0xC)
|
||||
#define DSP_COMMAND (sbc_base + 0xC)
|
||||
#define DSP_STATUS (sbc_base + 0xC)
|
||||
#define DSP_DATA_AVAIL (sbc_base + 0xE)
|
||||
#define DSP_DATA_AVL16 (sbc_base + 0xF)
|
||||
#define MIXER_ADDR (sbc_base + 0x4)
|
||||
#define MIXER_DATA (sbc_base + 0x5)
|
||||
#define OPL3_LEFT (sbc_base + 0x0)
|
||||
#define OPL3_RIGHT (sbc_base + 0x2)
|
||||
#define OPL3_BOTH (sbc_base + 0x8)
|
||||
#endif
|
||||
/* DSP Commands */
|
||||
|
||||
#define DSP_CMD_SPKON 0xD1
|
||||
#define DSP_CMD_SPKOFF 0xD3
|
||||
#define DSP_CMD_DMAON 0xD0
|
||||
#define DSP_CMD_DMAOFF 0xD4
|
||||
|
||||
#define IMODE_NONE 0
|
||||
#define IMODE_OUTPUT 1
|
||||
#define IMODE_INPUT 2
|
||||
#define IMODE_INIT 3
|
||||
#define IMODE_MIDI 4
|
||||
|
||||
#define NORMAL_MIDI 0
|
||||
#define UART_MIDI 1
|
||||
|
@ -84,7 +84,11 @@ static void dsp_cleanup (void);
|
||||
static struct audio_operations sb16_dsp_operations =
|
||||
{
|
||||
"SoundBlaster 16",
|
||||
#ifdef PC98
|
||||
NEEDS_RESTART,
|
||||
#else
|
||||
DMA_AUTOMODE,
|
||||
#endif
|
||||
AFMT_U8 | AFMT_S16_LE,
|
||||
NULL,
|
||||
sb16_dsp_open,
|
||||
|
@ -33,6 +33,7 @@ static unsigned char ulaw_dsp[] = {
|
||||
129, 129, 129, 129, 128, 128, 128, 128,
|
||||
};
|
||||
|
||||
#ifndef DSP_ULAW_NOT_WANTED
|
||||
static unsigned char dsp_ulaw[] = {
|
||||
31, 31, 31, 32, 32, 32, 32, 33,
|
||||
33, 33, 33, 34, 34, 34, 34, 35,
|
||||
@ -67,3 +68,4 @@ static unsigned char dsp_ulaw[] = {
|
||||
163, 163, 162, 162, 162, 162, 161, 161,
|
||||
161, 161, 160, 160, 160, 160, 159, 159,
|
||||
};
|
||||
#endif /* !DSP_ULAW_NOT_WANTED */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.h,v 1.2 1996/07/23 07:46:42 asami Exp $
|
||||
* $Id: syscons.h,v 1.3 1996/09/04 09:52:31 asami Exp $
|
||||
*/
|
||||
|
||||
#ifndef _PC98_PC98_SYSCONS_H_
|
||||
@ -168,8 +168,10 @@ typedef struct scr_stat {
|
||||
#endif
|
||||
int xpos; /* current X position */
|
||||
int ypos; /* current Y position */
|
||||
int xsize; /* X size */
|
||||
int ysize; /* Y size */
|
||||
int xsize; /* X text size */
|
||||
int ysize; /* Y text size */
|
||||
int xpixel; /* X graphics size */
|
||||
int ypixel; /* Y graphics size */
|
||||
int font_size; /* fontsize in Y direction */
|
||||
int start; /* modified area start */
|
||||
int end; /* modified area end */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
|
||||
* $Id: wd.c,v 1.6 1996/09/03 10:24:02 asami Exp $
|
||||
* $Id: wd.c,v 1.7 1996/09/10 09:38:45 asami Exp $
|
||||
*/
|
||||
|
||||
/* TODO:
|
||||
@ -1952,7 +1952,7 @@ wddump(dev_t dev)
|
||||
static int wddoingadump = 0;
|
||||
|
||||
/* Toss any characters present prior to dump. */
|
||||
while (cncheckc())
|
||||
while (cncheckc() != -1)
|
||||
;
|
||||
|
||||
/* Check for acceptable device. */
|
||||
@ -2116,7 +2116,7 @@ wddump(dev_t dev)
|
||||
blknum = blknext;
|
||||
|
||||
/* Operator aborting dump? */
|
||||
if (cncheckc())
|
||||
if (cncheckc() != -1)
|
||||
return (EINTR);
|
||||
}
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user