summaryrefslogtreecommitdiff
path: root/emulators/simh
diff options
context:
space:
mode:
authorthorpej <thorpej@pkgsrc.org>2002-10-19 21:38:09 +0000
committerthorpej <thorpej@pkgsrc.org>2002-10-19 21:38:09 +0000
commit18ac973de01e786f570bd4575c83ca74ed94365a (patch)
tree927a3be0dbbeb82fb4b940524fb48e5a42f08bad /emulators/simh
parentd7ca9840df5e94aa9fe346ac5a40db7ac1fd3190 (diff)
downloadpkgsrc-18ac973de01e786f570bd4575c83ca74ed94365a.tar.gz
Add David Hittner's DELQA/DEQNA Ethernet module for SIMH (PDP11 and
VAX). Patches for the sim_ether module to support NetBSD, and a bug fix to the XQ module from me (both patches sent to author). Bump package revision to nb1. NOTE: To work, this requires a patch to libpcap recently posted to tech-net.
Diffstat (limited to 'emulators/simh')
-rw-r--r--emulators/simh/Makefile13
-rw-r--r--emulators/simh/PLIST3
-rw-r--r--emulators/simh/distinfo7
-rw-r--r--emulators/simh/patches/patch-aa24
-rw-r--r--emulators/simh/patches/patch-ab137
-rw-r--r--emulators/simh/patches/patch-ac17
6 files changed, 198 insertions, 3 deletions
diff --git a/emulators/simh/Makefile b/emulators/simh/Makefile
index f846750eea3..7c3abbaf3b0 100644
--- a/emulators/simh/Makefile
+++ b/emulators/simh/Makefile
@@ -1,13 +1,17 @@
-# $NetBSD: Makefile,v 1.7 2002/10/19 20:54:21 thorpej Exp $
+# $NetBSD: Makefile,v 1.8 2002/10/19 21:38:09 thorpej Exp $
#
DISTNAME= simhv210-0b2
PKGNAME= simh-2.10.0b2
+PKGREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://simh.trailing-edge.com/sources/
EXTRACT_SUFX= .zip
EXTRACT_CMD= unzip -aq ${DOWNLOADED_DISTFILE}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
+ xq_beta4${EXTRACT_SUFX}
+
MAINTAINER= packages@netbsd.org
HOMEPAGE= http://simh.trailing-edge.com/
COMMENT= Bob Supnik's historical computer simulator
@@ -19,6 +23,13 @@ post-extract:
${MV} ${WRKSRC}/makefile ${WRKSRC}/Makefile
${MV} ${WRKSRC}/AltairZ80/altairZ80_defs.h \
${WRKSRC}/AltairZ80/altairz80_defs.h
+ ${MV} ${WRKSRC}/SIMH/sim_ether.c ${WRKSRC}/sim_ether.c
+ ${MV} ${WRKSRC}/SIMH/sim_ether.h ${WRKSRC}/sim_ether.h
+ ${MV} ${WRKSRC}/SIMH/PDP11/pdp11_xq.c ${WRKSRC}/PDP11/pdp11_xq.c
+ ${MV} ${WRKSRC}/SIMH/PDP11/pdp11_xq.h ${WRKSRC}/PDP11/pdp11_xq.h
+ ${MV} ${WRKSRC}/SIMH/xq_README.txt ${WRKSRC}/xq_README.txt
+ ${RMDIR} ${WRKSRC}/SIMH/PDP11
+ ${RMDIR} ${WRKSRC}/SIMH
do-install:
(cd ${WRKSRC}/BIN && for BIN in *; do \
diff --git a/emulators/simh/PLIST b/emulators/simh/PLIST
index e143abaf944..bbf8849eadf 100644
--- a/emulators/simh/PLIST
+++ b/emulators/simh/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2002/10/19 21:06:04 thorpej Exp $
+@comment $NetBSD: PLIST,v 1.5 2002/10/19 21:38:09 thorpej Exp $
bin/simh-altair
bin/simh-altairz80
bin/simh-eclipse
@@ -49,4 +49,5 @@ share/doc/simh/simh_doc.txt
share/doc/simh/simh_swre.txt
share/doc/simh/system3.txt
share/doc/simh/vax_doc.txt
+share/doc/simh/xq_README.txt
@dirrm share/doc/simh
diff --git a/emulators/simh/distinfo b/emulators/simh/distinfo
index 9c53f59651b..88f7609f769 100644
--- a/emulators/simh/distinfo
+++ b/emulators/simh/distinfo
@@ -1,4 +1,9 @@
-$NetBSD: distinfo,v 1.4 2002/10/19 20:54:21 thorpej Exp $
+$NetBSD: distinfo,v 1.5 2002/10/19 21:38:10 thorpej Exp $
SHA1 (simhv210-0b2.zip) = 841669853d24f7b2b608442806eeaa083f2dd7ab
Size (simhv210-0b2.zip) = 1555874 bytes
+SHA1 (xq_beta4.zip) = 662c824c8b5d6bef947dadef3e8285130d400877
+Size (xq_beta4.zip) = 22487 bytes
+SHA1 (patch-aa) = 29fc614b64358b50e5181a186edf339cd18de17a
+SHA1 (patch-ab) = 438720c909897eae2203139e3f645bcecb700422
+SHA1 (patch-ac) = 9330161b91d2af6af60add660bc12532ec8e401a
diff --git a/emulators/simh/patches/patch-aa b/emulators/simh/patches/patch-aa
new file mode 100644
index 00000000000..e11d2183feb
--- /dev/null
+++ b/emulators/simh/patches/patch-aa
@@ -0,0 +1,24 @@
+$NetBSD: patch-aa,v 1.4 2002/10/19 21:38:10 thorpej Exp $
+
+--- Makefile.orig Sat Oct 19 14:23:26 2002
++++ Makefile Sat Oct 19 14:24:16 2002
+@@ -3,8 +3,8 @@
+ # Note: -O2 is sometimes broken in GCC when setjump/longjump is being
+ # used. Try -O2 only with released simulators.
+ #
+-CC = gcc -O2 -lm -I .
+-#CC = gcc -O2 -g -lm -I .
++CC = gcc -O2 -lm -lpcap -I .
++#CC = gcc -O2 -g -lm -lpcap -I .
+
+
+
+@@ -12,7 +12,7 @@
+ # Common Libraries
+ #
+ BIN = BIN/
+-SIM = scp.c scp_tty.c sim_sock.c sim_tmxr.c
++SIM = scp.c scp_tty.c sim_ether.c sim_sock.c sim_tmxr.c
+
+
+
diff --git a/emulators/simh/patches/patch-ab b/emulators/simh/patches/patch-ab
new file mode 100644
index 00000000000..3b72d453cd1
--- /dev/null
+++ b/emulators/simh/patches/patch-ab
@@ -0,0 +1,137 @@
+$NetBSD: patch-ab,v 1.1 2002/10/19 21:38:10 thorpej Exp $
+
+--- sim_ether.c.orig Sat Oct 19 14:26:01 2002
++++ sim_ether.c Sat Oct 19 14:26:10 2002
+@@ -70,6 +70,7 @@
+ msg, dst, src, *proto, packet->len);
+ }
+
++#ifndef __NetBSD__
+ char* eth_getname(int number, char* name)
+ {
+ #define ETH_SUPPORTED_DEVICES 10
+@@ -80,6 +81,7 @@
+ strcpy(name, list[number].name);
+ return name;
+ }
++#endif /* ! __NetBSD__ */
+
+ void eth_zero(ETH_DEV* dev)
+ {
+@@ -89,7 +91,7 @@
+
+ /* First, all the non-implemented versions */
+
+-#if !defined (WIN32) && !defined(linux)
++#if !defined (WIN32) && !defined(linux) && !defined(__NetBSD__)
+ t_stat eth_open (ETH_DEV* dev, char* name)
+ {return SCPE_NOFNC;}
+ t_stat eth_close (ETH_DEV* dev)
+@@ -110,9 +112,13 @@
+ #ifdef WIN32
+ #include <packet32.h>
+ #endif /*WIN32*/
+-#ifdef linux
++#ifdef __NetBSD__
++#include <sys/ioctl.h>
++#include <net/bpf.h>
++#endif /* __NetBSD__ */
++#if defined(linux) || defined(__NetBSD__)
+ #include <fcntl.h>
+-#endif /*linux*/
++#endif /*linux || __NetBSD__*/
+
+ t_stat eth_open(ETH_DEV* dev, char* name)
+ {
+@@ -124,22 +130,34 @@
+ /* initialize device */
+ eth_zero(dev);
+
++#ifndef __NetBSD__
+ /* translate name of type "ethX" */
+ if ((strlen(name) == 4) && isdigit(name[3])) {
+ num = atoi(&name[3]);
+ savname = eth_getname(num, temp);
+ }
++#endif /* ! __NetBSD__ */
+
+ /* attempt to connect device */
+- dev->handle = (void*) pcap_open_live(savname, BUFSIZ, ETH_PROMISC, /*ETH_TIMEOUT*/-1, errbuf);
++ dev->handle = (void*) pcap_open_live(savname, ETH_MAX_PACKET, ETH_PROMISC, /*ETH_TIMEOUT*/-1, errbuf);
+
+- if (!dev->handle) return SCPE_OPENERR; /* can't open device */
++ if (!dev->handle) {
++ printf("pcap_open_live: %s\n", errbuf);
++ return SCPE_OPENERR; /* can't open device */
++ }
+
+ /* save name of device */
+ dev->name = malloc(strlen(savname)+1);
+ strcpy(dev->name, savname);
+
+-#ifdef linux
++#ifdef __NetBSD__
++ /* tell the kernel that the header is fully-formed when it gets it. this
++ is required in order to fake the src address. */
++ i = 1;
++ ioctl(pcap_fileno(dev->handle), BIOCSHDRCMPLT, &i);
++#endif /* __NetBSD__ */
++
++#if defined(linux) || defined(__NetBSD__)
+ /* set file non-blocking */
+ fcntl(pcap_fileno(dev->handle), F_SETFL, fcntl(pcap_fileno(dev->handle), F_GETFL, 0) | O_NONBLOCK);
+ #endif /*linux*/
+@@ -373,4 +391,53 @@
+
+ #endif /*linux*/
+
++#ifdef __NetBSD__
++
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <net/if_dl.h>
++#include <net/if_types.h>
++#include <ifaddrs.h>
++#include <string.h>
++
++int pcap_sendpacket(pcap_t* handle, u_char* msg, int len)
++{
++ return (write(pcap_fileno(handle), msg, len) == len)?0:-1;
++}
++
++int PacketGetAdapterNames(char* buffer, int* size)
++{
++ const struct sockaddr_dl *sdl;
++ struct ifaddrs *ifap, *ifa;
++ char *p;
++ int ptr = 0;
++
++ if (getifaddrs(&ifap) != 0) {
++ *size = 0;
++ return (0);
++ }
++
++ p = NULL;
++ for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
++ if (ifa->ifa_addr->sa_family != AF_LINK)
++ continue;
++ if (p && strcmp(p, ifa->ifa_name) == 0)
++ continue;
++ sdl = (const struct sockaddr_dl *) ifa->ifa_addr;
++ if (sdl->sdl_type != IFT_ETHER)
++ continue;
++
++ strcpy(buffer+ptr, ifa->ifa_name);
++ ptr += strlen(ifa->ifa_name)+1;
++ }
++
++ freeifaddrs(ifap);
++
++ buffer[ptr++] = '\0';
++ buffer[ptr++] = '\0';
++ *size = ptr;
++
++ return (ptr);
++}
+
++#endif /* __NetBSD__ */
diff --git a/emulators/simh/patches/patch-ac b/emulators/simh/patches/patch-ac
new file mode 100644
index 00000000000..13f5904c89e
--- /dev/null
+++ b/emulators/simh/patches/patch-ac
@@ -0,0 +1,17 @@
+$NetBSD: patch-ac,v 1.1 2002/10/19 21:38:10 thorpej Exp $
+
+*** PDP11/pdp11_xq.c.orig Sat Oct 19 14:29:44 2002
+--- PDP11/pdp11_xq.c Sat Oct 19 14:30:00 2002
+***************
+*** 766,771 ****
+--- 766,775 ----
+ if (xq.xbdl_buf[1] & XQ_DSC_H) b_length -= 1;
+ if (xq.xbdl_buf[1] & XQ_DSC_L) b_length -= 1;
+
++ /* protect ourselves from a broken device driver... */
++ if ((xq.write_buffer.len + b_length) > sizeof(xq.write_buffer.msg))
++ b_length = sizeof(xq.write_buffer.msg) - xq.write_buffer.len;
++
+ /* add to transmit buffer */
+ Map_ReadB(address, b_length, &xq.write_buffer.msg[xq.write_buffer.len], NOMAP);
+ xq.write_buffer.len += b_length;