[Simh] Simulated PDP-7 Unix V0?
Rhialto
rhialto at falu.nl
Sat Sep 15 14:02:05 EDT 2018
On Wed 05 Sep 2018 at 04:24:20 -0700, Al Kossow wrote:
>
> https://www.ioccc.org/2018/mills/hint.text
I had to make some changes to prog.c to get this to work on NetBSD 8.
As-is, it sets the baud rate of its controlling terminal to 0 and
thereby hangs it up. (Is that feature disappeared from Linux, that
nobody noticed this rather fatal bug?)
--- prog.c.orig 2018-09-12 19:41:32.934592869 +0200
+++ prog.c 2018-09-12 21:19:52.179421018 +0200
@@ -3,13 +3,22 @@
#include<termios.h>
#include <sys/time.h>
#include <sys/mman.h>
+#include<string.h>
# define L } if(!i -- ){
struct timeval F,G; struct termios H,U={ T} ; enum{ N=64,a=N<<7,b=a-1,c=a*32,d
=c-1, e=c/ 2,f= a*2, g=a/2,h =g/2,j =h/ 2,Q=V*j*5} ; char*s=P,K,M;
int* p, l[ a] ,m,n,J,o=A, O=j,E,R,i,k,t,r,q,u,v,w,x,y,z
,B,C, *D,Z ;int main (){ for(D=mmap(D,4*Q,3,W,open(I,2 ),K); *s; o
-++[ l]=k|=* s++%N){ k=* s++%N<<12; k|=*s++% N*N; } tcgetattr(q,& H); tcsetattr
-(y,2, &U); for( fcntl(B,4,4); ; o&=b){ if(k& c){ q=- --k%N; if(!q)
+++[ l]=k|=* s++%N){ k=* s++%N<<12; k|=*s++% N*N; }
+tcgetattr(q,& H);
+struct termios HH;
+HH=H;
+HH.c_iflag = U.c_iflag;
+//HH.c_oflag = U.c_oflag;
+//HH.c_cflag = U.c_cflag;
+HH.c_lflag = U.c_lflag;
+tcsetattr
+(y,2, &HH); for( fcntl(B,4,4); ; o&=b){ if(k& c){ q=- --k%N; if(!q)
k-=c ;i =k /N&7; { L L if(J&1) m+= t; J|=m%N*c; J/=2; m
/= 2; if(! q&&r ^n){ m^=d; J^= d; n=0; } L L J+=J; J|=m>=0; if(q){
m+=m; m|=J/c; m+=m<0?t:-t; } else{ m+=(m<0)*t; if(r)m^=d; if(n^r)J^= d; n=0; }
-Olaf.
--
___ Olaf 'Rhialto' Seibert -- Wayland: Those who don't understand X
\X/ rhialto/at/falu.nl -- are condemned to reinvent it. Poorly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20180915/31788206/attachment.sig>
More information about the Simh
mailing list