RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Sep 25, 2018 12:48 am

All times are UTC




Post new topic Reply to topic  [ 86 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: Mon Nov 07, 2016 8:00 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I took the PDP-8 design (from OpenCores.org - the PDP-8 Processor Core and System by RobD and JoeM) and compiled for my small lovely Spartan6 board.

The "minimal" PDP-8/A version got 32kWords of core ram I knit from small ferrite toroids I found in my junk-box during the last weekend, an old 4GB SdCard attached with following .rk05 images on it:

http://www.pdp8online.com/ftp/images/os8/multos8.rk05
http://www.pdp8online.com/ftp/images/os ... ermit.rk05
http://www.pdp8online.com/ftp/images/os8/diagpack2.rk05
http://www.rickmurphy.net/advent/advent.rk05

and a Console 9600 7M2 - TeraTerm.
As well as a Reset button (an important piece of HW here as the reset of the fpga alone does not give you the OS/8 "." dot prompt) :) .

The ram includes loaders (defined at specific locations in the ram), so no toggling with switches is required in order to boot the OS/8 (moreover, the "minimal" version does not have any switches or LEDs attached anyhow).

That is vsjo. ISE report shows max clock 59.8MHz (w/ default ISE 14.7 settings). FPGA resources spent are rather small - 50% slices, 7% slice regs, 36% slice LUTs. Ferrite core spent 75% of the FPGA's bram. Spartan6 clocks at 50MHz now. XPower reports 33mW power consumption.

And it worked THE FIRST TIME!! :ugeek:

Not really, I must admit.. :(
EDIT: The Console issue fixed with above terminal settings
.. as the Console works rather confusing. When typing a text I see garbage. But when I type "DIR", or "HELP" (frankly, only commands I know :P ..) I get perfect listings. So maybe a small bug somewhere.
Splash screen and "DIR":
Code:
 ¯ ?Óã?ìÔ¹ Õ²ÐÖâÏØ¢ÈúÐÐe?¢¦¦¦ÏĦ¤?§»ªº¢¢¦ÚéÐÛ°ÊîÑÐäÐÛ°ÆîÑâо

£ÂÁGÌÉÎÅ® ÊÏ ÁÂÏÒÔÅc

®
®ÄÉ?



DIRECT.SV   7            FRTS  .SV  26            BASIC .WS  11
PIP   .SV  11            PASS2 .SV  20            SET   .SV  20
FOTP  .SV   8            PASS2O.SV   5            RTFLOP.SV  15
HEADER.SV  14            PASS3 .SV   8            WPFLOP.SV  14

DIRECT.SV   7            FRTS  .SV  26            BASIC .WS  11
PIP   .SV  11            PASS2 .SV  20            SET   .SV  20
FOTP  .SV   8            PASS2O.SV   5            RTFLOP.SV  15
HEADER.SV  14            PASS3 .SV   8            WPFLOP.SV  14
BITMAP.SV   5            RALF  .SV  19            RESORC.SV  14
FUTIL .SV  27            LOAD  .SV  16            DECX8 .SV  43
....
K12ENC.SV   6            USR   .RA  46            RSPEAK.RL   2
K12DEC.SV   5            JUGGLE.RA   3            SEED  .RL   2
K12MIT.SV  33            RL2FMT.SV   8            SPEAK .RL   4
K12DJG.SV  33            LOAD  .BI   1            VOCAB .RL   3
K12DEB.SV   4            RXCOPY.SV   9            USR   .RL   4
K12ENB.SV   4            FLOP  .HN   3            ATEXT .DA 144
BRTS  .SV  15            LCSYS .BI   3            ADVENT.LD 145
F4    .SV  20            UCSYS .BI   3            LOAD  .LS   8

 162 Files in 2648 Blocks -  544 Free blocks

®Ò ÈÅÌÐ
ª


OS/8 MONITOR COMMANDS

CMD     PROG    EXPL

ASSIGN  KBM     ASSIGNS LOGICAL NAME
BACKSP  CAMP    BACKSPACES DEV
BASIC   BASIC   ENTERS BASIC SYSTEM
BOOT    BOOT    BOOTSTRAPS TO DEV
CCL     CCL     DISABLES CCL
COMPARE SRCCOM  COMPARES FILES
COMPILE PAL8    COMPILES PROG
        F4/FORT
        BASIC
        RALF
        SABR
COPY    FOTP    COPIES FILES
CREATE  EDIT    OPENS FILE FOR EDITING
...
-D      OUTPUT TO DUMP:
-N      OUTPUT TO NULL:
-LS     PRODUCE LISTING
-NB     NO BINARY YET
-MP     PRODUCE MAP
-EXT    SET DEFAULT EXTENSION

FEATURES:
/X      PASS SWITCH OPTION X TO PROGRAM
(XYZ)   PASS SWITCH OPTIONS TO PROGRAM
[N]     MAX OUTPUT SIZE
=NNN    PASS OCTAL NUMBER TO PROGRAM
#NNN    TAKE INTERNAL OCTAL FORM OF FILENAME
 @FILE  REPLACE IN CMD LINE BY FILE'S CONTENTS
$       COMPLEMENT DEFAULT ALTMODE SWITCH



®
®ÄÉ?



DIRECT.SV   7            FRTS  .SV  26            BASIC .WS  11
PIP   .SV  11            PASS2 .SV  20            SET   .SV  20
FOTP  .SV   8            PASS2O.SV   5            RTFLOP.SV  15
HEADER.SV  14            PASS3 .SV   8            WPFLOP.SV  14
...


After some messing with the Console it started to print out some texts about oil fields in the middle East.. So I decided rather go off my office in order to buy some sandwiches and coffee..

And the schematics:
Attachment:
PDP-8.JPG
PDP-8.JPG [ 113.63 KiB | Viewed 16456 times ]

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 07, 2016 10:32 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Adventure game in Fortran:
Simh:
Code:
.R FRTS
*ADVENT.LD
*$
WELCOME TO ADVENTURE!!  WOULD YOU LIKE INSTRUCTIONS?


Code:
®
®
®Ò ÆÒÔÓ
ªÁÄÖÅÎÔ®ÌÄ
ª¤
Welcome to Adventure!!  Would you like instructions?

¾ îï
You are standing at the end of a road before a small brick building.
Around you is a forest.  A small stream flows out of the building and
down a gully.

¾ åîôåò
You are inside a building, a well house for a large spring.

There are some keys on the ground here.

There is a shiny brass lamp nearby.

There is food here.

There is a bottle of water here.

¾ åîôåò
You're at end of road again.

¾ ÞÃ

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 07, 2016 10:41 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hmm, it seems the tx module sets 5th bit to 1 hard..
That makes the difference between "a" and "A" etc. in ASCII..
PDP-8 shall print only capital letters, imho.. :?
But it does not set it when printing dirs.. Weird.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 07, 2016 11:05 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
.R BASIC
Code:
®Ò ÂÁÓÉÍ
NEW OR OLD--OLD
FILE NAME--BASIC.BA

READY
LIST

BASIC   BA    7A

1 REMARKABLY TRANSLATED TO OS8 BASIC BY KAY R. FISHER ...DEC
2 PRINT PNT(0);PNT(0);PNT(0);PNT(29);PNT(0);
3 PRINT PNT(0);PNT(0);PNT(0);PNT(31);PNT(0);PNT(0);PNT(0);PNT(0);
4 DIM A$(26),D$(10)
10 PRINT "HELLO, MY NAME IS PETEY P. EIGHT."
20 PRINT\PRINT PNT(0);PNT(0);PNT(0);"WHAT'S YOUR NAME  ";\INPUT A$\PRINT
35 PRINT " HI THERE ";\GOSUB 500
36 PRINT ".  ARE YOU ENJOYING YOURSELF HERE"
40 PRINT"IN THIS WONDERFUL PLACE";
45 INPUT B$\PRINT
50 IF B$="YES" THEN 70
55 IF B$="NO" THEN 80
60 PRINT " ";\GOSUB 500
61 PRINT ", I DON'T UNDERSTAND YOUR ANSWER OF '";B$;"'."
..
375 PRINT "ME TO GO ON WITH MY PSYCHOLOGY STUDIES IF MY PATIENTS DON'T"
380 PRINT "PAY THEIR BILLS?"
385 PRINT\PRINT\PRINT "NOW LET ME TALK TO SOMEONE ELSE."
390 PRINT "NICE MEETING YOU ";\GOSUB 500
391 PRINT ". HAVE A NICE DAY!!"
400 FOR I=1 TO 3000
405 NEXT I
410 GO TO 2
500 PRINT A$;
510 RETURN
999 END
READY
RUN

BASIC   BA    7A
It crashes - you may see the "\" in the source..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 07, 2016 11:15 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
SPACWR.BA
Code:
®Ò ÂÁÓÉÍ
NEW OR OLD--old
FILE NAME--SPACWR.BA

READY
RUN

SPACWR  BA    7A


®
®Ò ÂÁÓÉÍ
NEW OR OLD--OLD
FILE NAME--SPACWR.BA

READY
LIST

SPACWR  BA    7A

100     REM *** PROGRAM SIMULATES TV PROGRAM STARTREK
110     REM *** WRITTEN BY MIKE MAYFIELD, CENTERLINE ENGINEERING
180     PRINT "                  * * *  STAR TREK  * * *"\PRINT
181 PRINT\PRINT
200 PRINT "        FOR INSTRUCTIONS USE OS-8 HELP COMMAND FOR 'SPACWR'  "
205 RANDOMIZE
235 DIM Z$(72),R$(72),Q$(72),S$(48),A$(3),O1$(24),D$(72)
236 DIM E$(20)
240 Q$="                                                  "
245 Q$=Q$&"                      "
250 Z$=Q$\R$=Q$\S$=SEG$(Q$,1,48)
260 DIM G(8,8),C(9,2),K(3,3),N(3),Z(8,8)
290 T=INT(RND(1)*20+20)*100\T0=T
300 T9=30\D0=0\E=3000\P=10\S9=200\S=0\H8=0\E0=3000\P0=10
360 DEF FND(D)=SQR((K(I,1)-S1)**2+(K(I,2)-S2)**2)
370 Q1=INT(RND(1)*8+1)
380 Q2=INT(RND(1)*8+1)
390 S1=INT(RND(1)*8+1)
400 S2=INT(RND(1)*8+1)
420 C(2,1)=-1\C(3,1)=-1\C(4,1)=-1\C(4,2)=-1\C(5,2)=-1\C(6,2)=-1
430 C(1,1)=0\C(3,2)=0\C(5,1)=0\C(7,2)=0\C(9,1)=0
440 C(1,2)=1\C(2,2)=1\C(6,1)=1\C(7,1)=1\C(8,1)=1\C(8,2)=1\C(9,2)=1
460 D$="WARP ENGINESS.R. SENSORSL.R. SENSORSPHASER CNTRL"
470 D$=D$&"PHOTON TUBESDAMAGE CNTRL"
480 E$="SHIELD CNTRLCOMPUTER"
490 K9=0\B9=0
491 REM *** SETS UP WHAT EXISTS IN GALAXY
500 FOR I=1TO8
510 FOR J=1TO8
..
5680 REM ***STRING COMPARISON IN QUADRANT ARRAY***
5690 S8=Z1*24+Z2*3-26\Z3=0\IF S8>72 THEN 5750
5720 IF SEG$(Q$,S8,S8+2)<>A$ THEN 5810
5730 Z3=1\GOTO 5810
5750 IF S8>144 THEN 5790
5760 IF SEG$(R$,S8-72,S8-70)<>A$ THEN 5810
5770 Z3=1\GOTO 5810
5790 IF SEG$(S$,S8-144,S8-142)<>A$ THEN 5810
5800 Z3=1
5810 RETURN
5820 END
READY

I've never ever seen such long programme in basic :).
It crashes.. :(
Hmm, it seems "\" is the ";" actually. Does it print it out wrongly, or does it read a mess from the disk??
Maybe 50MHz is too much for the PDP-8 :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 07, 2016 11:35 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
My first basic prog written on a PDP-8 :)
Code:
®
®Ò ÂÁÓÉÉ
NEW OR OLD--NEW
FILE NAME--MYBAS1.BA

READY
10 LET A=12345
20 LET B=0.2222
30 LET C=3.141592
40 LET R=A*B/C
50 PRINT R
60 END
SAVE

READY
LIST

MYBAS1  BA    7A

10 LET A=12345
20 LET B=0.2222
30 LET C=3.141592
40 LET R=A*B/C
50 PRINT R
60 END
READY
RUN

MYBAS1  BA    7A


®
®ÄÉ?



DIRECT.SV   7            PASS2 .SV  20            WPFLOP.SV  14
PIP   .SV  11            PASS2O.SV   5            RESORC.SV  14
..
K12DEB.SV   4            FLOP  .HN   3            LOAD  .LS   8
K12ENB.SV   4            LCSYS .BI   3            MYBAS2.BA   1
BRTS  .SV  15            UCSYS .BI   3            MYBAS1.BA   1   << IT HAS BEEN SAVED HERE !!!
F4    .SV  20            SET   .SV  20            BASIC .WS   1
FRTS  .SV  26            RTFLOP.SV  15

 164 Files in 2640 Blocks -  552 Free blocks

®Ò ÂÁÓÉÍ
NEW OR OLD--OLD
FILE NAME--MYBAS1.BA

READY
LIST

MYBAS1  BA    7A

10 LET A=12345
20 LET B=0.2222
30 LET C=3.141592
40 LET R=A*B/C
50 PRINT R
60 END
READY

So when in OS the Console input prints out a mess, while inside the Basic the Console prints just fine..
Not the same in Fortran, however.. Weird..

I've switched off the board for 20secs to verify the SdCard's based disk really remembers the information saved :)
And it does!
Code:
K12DEB.SV   4            FLOP  .HN   3            LOAD  .LS   8
K12ENB.SV   4            LCSYS .BI   3            MYBAS2.BA   1
BRTS  .SV  15            UCSYS .BI   3            MYBAS1.BA   1      <<< YES, STILL HERE!!
F4    .SV  20            SET   .SV  20            BASIC .WS   1
FRTS  .SV  26            RTFLOP.SV  15

 164 Files in 2640 Blocks -  552 Free blocks 

®Ò ÂÁÓÉÉÃ
ÂÁÓÉÉîÓÖ ÎÏ?ÆÏÕÎc
®
®Ò ÂÁÓÉÍ
NEW OR OLD--OLD
FILE NAME--MYBAS1.BA

READY
LIST

MYBAS1  BA    7A

10 LET A=12345
20 LET B=0.2222
30 LET C=3.141592
40 LET R=A*B/C
50 PRINT R
60 END
READY

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Nov 08, 2016 7:58 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I contacted Rob, the author of the above design.
Rob has answered to me kindly with a hint to use 9600 7M2 (Mark parity) (as this is how the original PDP-8 worked..)
It works!!!
Thanks! :)
Code:
.
.
.DIR



DIRECT.SV   7            PASS2 .SV  20            WPFLOP.SV  14
PIP   .SV  11            PASS2O.SV   5            RESORC.SV  14
FOTP  .SV   8            PASS3 .SV   8            DECX8 .SV  43
HEADER.SV  14            RALF  .SV  19            BUILD .SV  37
BITMAP.SV   5            LOAD  .SV  16            KL8E  .PA  53
FUTIL .SV  27            MOVE  .RA   4            RKUTIL.SV  15
SVDUMP.SV   4            PUT   .RA   3            RXREAD.SV   7
REMEM .SV   5            RSPEAK.RA   3            SPACWR.BA  39
..
K12DJG.SV  33            RXCOPY.SV   9            ADVENT.LD 145
K12DEB.SV   4            FLOP  .HN   3            LOAD  .LS   8
K12ENB.SV   4            LCSYS .BI   3            MYBAS2.BA   1
BRTS  .SV  15            UCSYS .BI   3            MYBAS1.BA   1
F4    .SV  20            SET   .SV  20            BASIC .WS   1
FRTS  .SV  26            RTFLOP.SV  15

 164 Files in 2640 Blocks -  552 Free blocks

.R BASIC
NEW OR OLD--OLD
FILE NAME--MYBAS1.BA

READY
LIST

MYBAS1  BA    7A

10 LET A=12345
20 LET B=0.2222
30 LET C=3.141592
40 LET R=A*B/C
50 PRINT R
60 END
READY
RUN


The next step is to get Basic etc working..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Nov 08, 2016 8:16 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Code:
.R FRTS
*ADVENT.LD
*$
Welcome to Adventure!!  Would you like instructions?

> yes
Somewhere nearby is Colossal Cave, where others have found fortunes
in treasure and gold,though it is rumored that some who enter are never
seen again. Magic is said to work in the cave.  I will be your eyes
and hands.  Direct me with commands of 1 or 2 words.  I should warn
you that I look at only the first four letters of each word,so you'll
have to enter "northeast" as "ne" to distinguish it from "north".
(Should you get stuck, type "help" for some general hints.  For
information on how to end your adventure, etc., type "INFO".)
      - - -
This program was originally developed by Willie Crowther. Most of
the features of the current program were added by Don Woods.
This version, for the PDP-8, was done by Dick Murphy. it is
based on a version for RT-11 done by Bob Supnik.

You are standing at the end of a road before a small brick building.
Around you is a forest.  A small stream flows out of the building and
down a gully.

> enter
You are inside a building, a well house for a large spring.

There are some keys on the ground here.

There is a shiny brass lamp nearby.

There is food here.

There is a bottle of water here.

> take keys
Taken.

> take food
Taken.

> drink water
The bottle of water is now empty.

>


But, when RUN Basic code the Console is lost (or the Basic crashes ??).
Maybe the Basic redirects the Console I/O to the another tty/lpt?? :?
Code:
.R BASIC
NEW OR OLD--old
FILE NAME--MYBAS2.BA

READY
LIST

MYBAS2  BA    7A

10 PRINT "HELLO WORLD"
20 END
READY
RUN

MYBAS2  BA    7A


A lots of fun :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Nov 08, 2016 9:07 am 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Pito,

Lots of fun :).

Somewhere I have some old PDP-8 tapes with lots of those games. I wonder if anyone still has a tape drive to read them?

I bet you could also run the PDP-8 stuff under RetroBSD and probably faster than the original CPU.

I really liked the instruction set. Simple and easy to use. I wonder if any CPU uses the auto-increment memory locations these days. It seems to me that the early PICs were pretty similar.

Any word on what Serge is doing with his new FPGA board?

I hope MicroChip does OK with their DDR PIC32, but it seems to me that everyone is trying to join that club. So what makes them better than so many others? Probably a VERY good question. I wonder what their answer[s] might be? It seems to me that that old DEC saw: "The network makes the difference." along with simple to use, might be what determines who becomes the eventual winner.

There are already some players with incredibly low prices probably to try to get market share so they don't fade into nothingness.

Nice piece of work:).

Wiz


Top
 Profile  
 
PostPosted: Tue Nov 08, 2016 9:32 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Code:
.R CHESS

CHEKMO-II
W. YOUR MOVE? PW
W. E2-E4
B. YOUR MOVE? BD

BR BN BB BQ BK BB BN BR
BP BP BP BP BP BP BP BP
-- ** -- ** -- ** -- **
** -- ** -- ** -- ** --
-- ** -- ** WP ** -- **
** -- ** -- ** -- ** --
WP WP WP WP -- WP WP WP
WR WN WB WQ WK WB WN WR

B. YOUR MOVE? C7-C6
W. D2-D4
B. YOUR MOVE? BD

BR BN BB BQ BK BB BN BR
BP BP ** BP BP BP BP BP
-- ** BP ** -- ** -- **
** -- ** -- ** -- ** --
-- ** -- WP WP ** -- **
** -- ** -- ** -- ** --
WP WP WP ** -- WP WP WP
WR WN WB WQ WK WB WN WR

B. YOUR MOVE?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Nov 08, 2016 10:33 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
@Wiz: https://www.pdp8online.com/images/images/os8.shtml

There are 4 images dd-ed onto the SdCard currently (see my first post), but I have absolutely no clue how to work with these images.. My current understanding is I work with an image defined somewhere and mounted upon boot as SYS.. :?
I've gone quickly through
https://www.grc.com/pdp-8/docs/OS8_Syst ... Manual.pdf
but still not much clever about it.. :?:

BTW - my current setup in highres (click-click for details):
Attachment:
20161108_120822.jpg
20161108_120822.jpg [ 1.35 MiB | Viewed 16396 times ]

And yes, I worked at DEC :)

The next step is the PDP-11/70 with BSD2.11 - not to be too much off-the-topic :P

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Nov 08, 2016 3:16 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
115K2 7M2 works as well
Code:
.DIR

DIRECT.SV   7            PASS2 .SV  20            WPFLOP.SV  14
PIP   .SV  11            PASS2O.SV   5            RESORC.SV  14
FOTP  .SV   8            PASS3 .SV   8            DECX8 .SV  43
HEADER.SV  14            RALF  .SV  19            BUILD .SV  37
BITMAP.SV   5            LOAD  .SV  16            KL8E  .PA  53
FUTIL .SV  27            MOVE  .RA   4            RKUTIL.SV  15
..
K12ENB.SV   4            LCSYS .BI   3            MYBAS .BA   1
BRTS  .SV  15            UCSYS .BI   3            MYBAS2.BA   1
F4    .SV  20            SET   .SV  20            MYBAS1.BA   1
FRTS  .SV  26            RTFLOP.SV  15            BASIC .WS   1

 165 Files in 2641 Blocks -  551 Free blocks

.


Now my intrinsic temptation to speed up the SdCard's SPI clock to max.. :P
When looking at the VHDL (a fantastic source, I recommend to see!) related to the SdCard, the state machine operates with slow and fast speed only. The fast uses a div_1, the slow div_63, where div is 1..63.
But when searching how the "fast op" command is used across the design it seems to me only slow is ever in action, as the fast mode is commented out and never assigned to spiOP elsewhere, see:
Code:
                -- stateINIT17:
                --  Send 8 clock cycles
                --

                when stateINIT17 =>
                    timeout <= timeout - 1;
                    if bytecnt = 0 then
                        spiOP   <= spiTR;
                        spiTXD  <= x"ff";
                        bytecnt <= 1;
                    elsif spiDONE = '1' then
                        bytecnt <= 0;
--                      spiOP   <= spiFAST;
                        state   <= stateIDLE;
                    end if;

So maybe un-commenting the above fast mode and setting the fast divider to say 4 (as my sdcard's flying wires are rather long, 20cm ) would speed up the card access a bit (as with 115k2 it is quite visible the sdcard reads slow). Unless the disk speed/acces_time is regulated to be somehow PDP-8 accurate (and it seems it is, when watching the RK code).

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Nov 08, 2016 6:23 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
:geek: Disks have got two sides here - A and B:
Code:
.DIR RKA0:

DIRECT.SV   7            PASS2 .SV  20            WPFLOP.SV  14
PIP   .SV  11            PASS2O.SV   5            RESORC.SV  14
FOTP  .SV   8            PASS3 .SV   8            DECX8 .SV  43
HEADER.SV  14            RALF  .SV  19            BUILD .SV  37
..
K12ENB.SV   4            LCSYS .BI   3            MYBAS .BA   1
BRTS  .SV  15            UCSYS .BI   3            MYBAS2.BA   1
F4    .SV  20            SET   .SV  20            MYBAS1.BA   1
FRTS  .SV  26            RTFLOP.SV  15            BASIC .WS   1

 165 Files in 2641 Blocks -  551 Free blocks

.DIR RKB0:

BABYEL.MU  11            WAR2  .BA   9            RKB   .RA  82
MUSIC5.MU   4            WEKDAY.BA  10            INITAD.FT  65
SCALE .MU   1            SIGNS .BA  19            TD8EA .BN   2
MUSIC2.MU  14            SNOOPY.BA  10            TD8EB .BN   2
MUSIC3.MU  14            HELLO .BA  11            TD8EC .BN   2
..
ROULET.BA  17            ADVENT.TX 200            DX    .SV 129
TICTAC.BA   7            ADVENT.SV 129            DIRECT.TS   6
WAR   .BA   7

 115 Files in 3002 Blocks -  190 Free blocks

.DIR RKA1:

ABSLDR.SV   6            RLPACK.BI   4            AIRXAE.DG  21
CCL   .SV  31            FLOP1 .BI   4            AIRXBF.DG  18
DIRECT.SV   7            FLOP2 .BI   4            AJEXCC.DG  12
..
ADRSTT.BX   4            RK8SES.BX   3            RKSALN.DG   2
DGPACK.BI   5            AHKLAB.DG  33            ALIGN .DG   3
CUSPAK.BI   3            AILABE.DG  16            CCBTCH.TM   1

 192 Files in 3168 Blocks -   24 Free blocks

.DIR RKB1:

ABSLDR.SV   6            RL2SY .BH   2            DHLAAB.DG  13
CCL   .SV  31            RL20  .BH   2            DHTAAC.DG  17
DIRECT.SV   7            RL21  .BH   2            DHTABC.DG  13
..
RLSY  .BH   2            DHKGAB.DG  14            RKSREL.DG   9
RL0   .BH   2            DHKLBB.DG  13            RKSLES.DG  16
RL1   .BH   2            DHKLCD.DG   8            RKCOPY.DG   5
RLC   .BH   2

 157 Files in 2762 Blocks -  430 Free blocks

.DIR RKA2:

ABSLDR.SV   5            TC01DT.BN   4            DHCRAA.SV  10
CCL   .SV  18            TD8EDT.BN   3            DIRXBD.SV  17
DIRECT.SV   7            TA8ECS.BN   4            DHRKDC.SV   9
PIP   .SV  11            TM8EMT.BN   4            DHKMCB.SV  12
..
RF08DS.BN   3            DHTMFB.SV  11            PASS3 .SV   8
DF32DS.BN   3            D5DB  .SV   4            RALF  .SV  19
RK8EDS.BN   3            DIRFAA.SV  11            LOAD  .SV  16
RK8DS .BN   3            D5FA  .SV   5            T     .FT   1

 195 Files in 2807 Blocks -  385 Free blocks

.DIR RKB2:

BABYEL.MU  11            CALNDR.BA   5            KING  .BA  23
MUSIC5.MU   4            CHECKR.BA  12            MONPLY.B1   6
SCALE .MU   1            CRAPS .BA   8            YAHTZE.IN   7
..
BLKJAC.BA  22            MONPLY.BA  22            ADVENT.DA 145
BLKJAK.BA   7            HOCKEY.BA  16            ADVENT.SV 129
BUNNY .BA   7            FOTBAL.BA  21

  74 Files in 2813 Blocks -  379 Free blocks

.DIR RKA3:
RKA3 Does not exist

.DIR RKB3:
RKB3 Does not exist

.


You may have 4 RK05 disks attached to the KL8E Disk Controller. I have to investigate why I see only 3. Probably I messed something when did dd (see the Quick start at the OpenCores).
Code:
dd if=advent.rk05            of=/dev/sdXX seek=0     count=6496
dd if=diagpack2.rk05         of=/dev/sdXX seek=8192  count=6496
dd if=diag-games-kermit.rk05 of=/dev/sdXX seek=16384 count=6496
dd if=multos8.rk05           of=/dev/sdXX seek=24576 count=6496


And a copy from A-side of the SYS disk (aka RK0) to B-side of the disk RK1 :
Code:
.COPY RKB1:<RKA0:MYBAS1.BA
Files copied:
MYBAS1.BA

.DIR RKB1:

ABSLDR.SV   6            RL2SY .BH   2            DHTAAC.DG  17
..
RL1   .BH   2            DHKLCD.DG   8            MYBAS1.BA   1      <<< HERE IT IS!!
RLC   .BH   2            DHLAAB.DG  13

 158 Files in 2763 Blocks -  429 Free blocks

.


:) When Basic from "A-side of the disk 2" runs the source from "B-side of the disk 1":
Code:
.RUN RKA2:BASIC
NEW OR OLD--OLD
FILE NAME--RKB1:MYBAS1.BA

READY
LIST

MYBAS1  BA    4A

10 LET A=12345
20 LET B=0.2222
30 LET C=3.141592
40 LET R=A*B/C
50 PRINT R
9999 END

READY
RUN

MYBAS1  BA    4A

 873.143

The result is correct, btw..
But the Console has crashed again.. Any trick how to get the Basic working??
PS: the Basic crashes in simh as well with advent.rk05 (the SYS here)..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Nov 09, 2016 12:29 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
:ugeek:
After several experiments it seems the BASIC works now :)
I've replaced the previous RK0/SYS with the image where BASIC is working and which boots under simh.
I've DD-ed the images in the new order to the sdcard, and booted..
Code:
FIELD SERVICE PDP-8 DIAGNOSTIC SYSTEM    . . .  VERSION 8.03

OS/8  V3D               DECX8   REV. D

RESTART ADDRESS =07600

TYPE <CTRL> C TO ABORT THIS PRINTOUT


TYPE:
        .R PROGNAME             -       TO RUN A SYSTEM PROGRAM
        .R PROGNAME.DG          -       TO RUN A DIAGNOSTIC PROGRAM
        .HELP FILENAME          -       TO TYPE A HELP FILE ON THE TERMINAL
        .HELP FILENAME - L      -       TO LIST A HELP FILE ON THE LINE PRINTER
        .SU BOOK                -       TO PRINT A COPY OF THE DIAG. HELP FILES


"FILENAME" / "PROGNAME"  = THE FILE OR PROGRAM TO LIST OR RUN

.DIR



ABSLDR.SV   5             TD8EDT.BN   3             DIRXBD.SV  17
CCL   .SV  18             TA8ECS.BN   4             DHRKDC.SV   9
DIRECT.SV   7             TM8EMT.BN   4             DHKMCB.SV  12
PIP   .SV  11             TC58MT.BN   4             DIRXAC.SV  20
FOTP  .SV   8             TC12LT.BN   3             DHRKCH.SV  12
..
FLOPPY.BN   3             DHTMFB.SV  11             RALF  .SV  19
RF08DS.BN   3             D5DB  .SV   4             LOAD  .SV  16
DF32DS.BN   3             DIRFAA.SV  11             T     .FT   1
RK8EDS.BN   3             D5FA  .SV   5             MY1   .BA   1
RK8DS .BN   3             DHCRAA.SV  10             BASIC .WS   1
TC01DT.BN   4

 405 FREE BLOCKS


.
.R BASIC
NEW OR OLD--OLD
FILE NAME--MY1.BA

READY
LIST

MY1     BA    4A

10 A=3
20 B=-2.333E8
30 C=A*B
40 PRINT C
50 END

READY
RUN

MY1     BA    4A

-.699900E+009

READY
35 D=-33.45E-12
37 R=A*B/(C*D)
40 PRINT R
LIST

MY1     BA    4A

10 A=3
20 B=-2.333E8
30 C=A*B
35 D=-33.45E-12
37 R=A*B/(C*D)
40 PRINT R
50 END

READY
SAVE

READY
RUN

MY1     BA    4A

-.298954E+011

READY

Code:
LIST

MY2     BA    4A

10 LET A=1.223E200
20 LET B=-3.222E-200
30 LET C=99.33E333
40 R=A*B/C
50 PRINT R
60 END

READY
SAVE

READY
RUN

MY2     BA    4A

-.396699E-334

READY

Code:
READY
RUN

SPACWR  BA    4A

                  * * *  STAR TREK  * * *



        FOR INSTRUCTIONS USE OS-8 HELP COMMAND FOR 'SPACWR'


YOU MUST DESTROY 17 KLINGONS IN 30 STARDATES WITH 4 STARBASES

------------------------

                                        STARDATE         3700
                  <*>                   CONDITION        GREEN
                                        QUADRANT         3 , 7
                                        SECTOR           3 , 7
                                        TOTAL ENERGY     3000
       *                                PHOTON TORPEDOES 10
                                        SHIELDS          0
------------------------

COMMAND:?


The new order:
Code:
dd if=diag-games-kermit.rk05  of=/dev/sdXX seek=0        count=6496
dd if=diagpack2.rk05          of=/dev/sdXX seek=8192     count=6496
dd if=advent.rk05             of=/dev/sdXX seek=16384    count=6496
dd if=multos8.rk05            of=/dev/sdXX seek=24576    count=6496


The BASIC actually always "compiles" the source - see the picture below (I did not find a modern pdf form) copied from https://www.grc.com/pdp-8/docs/OS8_BASIC_Reference.pdf
Attachment:
Basic_OS8.JPG
Basic_OS8.JPG [ 64.04 KiB | Viewed 16346 times ]


PS: It seems the OS/8 settings differ from image to image. The original SYS (advent.rk05) has a better setup as the diag-games-kermit.rk05.
So a better solution would be:
1. to go back to original image advent.rk05 as the SYS/RK0,
2. delete all the BASIC stuff from the SYS
3. copy the BASIC stuff to SYS from diag-games-kermit.rk05.
It may work provided the BASIC does not depend on something still hidden to us.. :evil:

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Nov 09, 2016 1:54 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Pito.

MOST IMPRESSIVE !!

I wonder if a reliable SIP client could be made this way?

Easy to understand and fix and really get running well?

GSM is maybe too complicated? But wouldn't it be nice to have a GSM
to wired telephone adapter that is easy to understand open source.
And also a really open source and easy to understand and fix GSM
to ethernet adapter for powering up local ethernet where ever I
happen to be.

So I buy a TracFone for $8/month and can finally get what I really
wanted. Cheap local telephone service with real phones and
anywhere ethernet IP web connectivity to check my e-mail.

Nice piece of work :).

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Wed Nov 09, 2016 2:13 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Did you get any joy from your extra memory? I have just been perusing the Wikipedia article on the PDP-8 and it has some interesting information about how the expanded memory works.

By all accounts it used a hardware memory expansion peripheral and it is down to the individual program to switch indirect (data) and direct (instruction) pointers to different pages to get at the extra memory. If a program hasn't been written to do that then it can only see the standard 4k words of the default memory map.

An enhanced version of the memory expansion peripheral included the ability to store multiple 4K programs in different pages to facilitate a time-share system. It even had a PDP-8 emulator in it to handle executing instructions from one page whilst flipping to another page or something - quite a bizarre situation by all accounts.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Wed Nov 09, 2016 3:16 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The enhanced memory Module is implemented in the above version.
So currently it runs 32kWords.
Code:
Configurable PDP-8 CPU (PDP-8/A/I/L/S/E..)
MS8C 32K-word memory
KC8E Front Panel
KE8 Extended Arithmetic Element
KM8E Extended Memory
KM8E Time Sharing
DK8EA/DK8EC/DK8EP Real Time Clock
KL8E Asynchronous Serial Interface (x2)
LS8E Printer Interface
PR8E Paper Tape Reader
KL8E Disk Controller with 4 RK05 Disks Attached

The "Minimal version" I play with is using KE8 and KM8E, MS8C, KL8E. The ISE really shows the 32kW of core ram is there (as well as I've seen the VHDL code - 4096 lines of 8x 12bit octal numbers mostly zeros, but at a few addresses it includes the loader code which boots the OS without the need to enter it via switches)..
Code:
architecture rtl of eMS8C is

    signal ramWr   : std_logic;
    signal xaddr   : xaddr_t;
    signal ramData : data_t;
    signal cpuData : data_t;

    type RAM_t is array (0 to 32767) of data_t;
    signal RAM : RAM_t := (
        --Boot Loaders
        o"0000", o"0000", o"0000", o"0000", o"0000", o"0000", o"0000", o"0000", -- 00000
        o"0000", o"0000", o"0000", o"0000", o"0000", o"0000", o"0000", o"0000", -- 00010
        o"0000", o"0000", o"0000", o"6007", o"6744", o"1032", o"6746", o"6743", -- 00020
        o"1032", o"5031", o"0000", o"0000", o"0000", o"0000", o"0000", o"0000", -- 00030

How the System actually uses the 32kW - I do not know yet.
The SpaceWars.bas is 600lines of a dense code and it works.. When I ran Focal in 4kW the largest source I was able to run was about 30lines. And Collosal Cave in Fortran works - that is an huge source with a lot of files to be loaded, moreover Fortran needs at least 8kW afaik.
If there were a command to inspect the system I would try it.. Any hint :) ?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Nov 09, 2016 3:26 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
I don't think the OS knows nor cares. It just provides the driver to the memory.

Quote:
Each 4K of memory was called a field. The Memory Extension Controller contained two three-bit registers: the DF (Data Field) and the IF (Instruction Field). These registers specified a field for each memory reference of the CPU, allowing a total of 15 bits of address. The IF register specified the field for instruction fetches and direct memory references; the DF register specified the field for indirect data accesses. A program running in one field could reference data in the same field by direct addressing, and reference data in another field by indirect addressing.

A set of IO instructions in the range 6200 through 6277 was handled by the Memory Extension Controller and gave access to the DF and IF registers. The 62X1 instruction (CDF, Change Data Field) set the data field to X. Similarly 62X2 (CIF) set the instruction field, and 62X3 set both. Pre-existing programs would never execute CIF or CDF; the DF and IF registers would both point to the same field, a single field to which these programs were limited. The effect of the CIF instruction was deferred to coincide with the next JMP or JMS instruction, so that executing CIF would not cause a jump.

It was more complicated for multiple-field programs to deal with field boundaries and the DF and IF registers than it would have been if they could simply generate 15-bit addresses, but the design provided backward compatibility and was consistent with the 12-bit architecture used throughout the PDP-8. Compare the later Intel 8086, whose 16-bit memory addresses are expanded to 20 bits by combining them with the contents of a specified or implied segment register.

The extended memory scheme let existing programs handle increased memory with minimal changes. For example, 4K FOCAL normally had about 3K of code with only 1K left over for user program and data. With a few patches, FOCAL could use a second 4K field for user program and data. Moreover, additional 4K fields could be allocated to separate users, turning 4K FOCAL into a multi-user timesharing system.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Wed Nov 09, 2016 3:36 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The diff between the C-code for the pdp instruction interpreter I run on stm32 (max 4kW) and the C-code for "simh-like-pdp8-interpreter-max-32kW" is there is on several places an #ifdef KM8E.. which includes 2 lines of code which ORs the two 3bit registers to some reg stuff with the 4kW regs version (PC, etc) at their MSBs side.

Now, I am happy to be able to run the stuff as-is, (btw you may do it in 20minutes as there should be a ready example for your deo-nano board), with some research I've done as depicted above.

But still, I am a newbie in the PDP-8 world, no idea which from the 1000 files on the rk0-rk3 double sided disks actually prints out some OS statistics.. :) I doubt it does, as we talk pre-C, pre-Unix world..

PS: you may download dozens of such disks, tapes, floppies.. You may attach those disks, tapes and floppies to the pdp under the SIMH, copy/build/generate new disks, and then dd them onto an Sdcard (max 4 disks at the specific blocks as stated above)..
Code:
pito@ubu1604:~$ cd pdp8
pito@ubu1604:~/pdp8$ ls
advent.rk05  diag-games-kermit.rk05  diagpack2.rk05  multos8.rk05
pito@ubu1604:~/pdp8$ pdp8

PDP-8 simulator V3.8-1
sim> set cpu 32K
sim> set cpu idle
sim> attach rk0 diag-games-kermit.rk05
sim> attach rk1 advent.rk05
sim> boot rk0



FIELD SERVICE PDP-8 DIAGNOSTIC SYSTEM    . . .  VERSION 8.03

OS/8  V3D      DECX8   REV. D

RESTART ADDRESS =07600

TYPE <CTRL> C TO ABORT THIS PRINTOUT


TYPE:
   .R PROGNAME      -   TO RUN A SYSTEM PROGRAM
   .R PROGNAME.DG      -   TO RUN A DIAGNOSTIC PROGRAM
   .HELP FILENAME      -   TO TYPE A HELP FILE ON THE TERMINAL
   .HELP FILENAME - L   -   TO LIST A HELP FILE ON THE LINE PRINTER
   .SU BOOK      -   TO PRINT A COPY OF THE DIAG. HELP FILES


"FILENAME" / "PROGNAME"  = THE FILE OR PROGRAM TO LIST OR RUN

.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Nov 09, 2016 6:33 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The first benchmarks:
PDP-8/A on: FPGA_clk=50MHz, CPU_clk=??, SD_SPI ~800kHz, Console 9k6 7m2
Code:
LIST

BEN1    BA    4A

10 LET A=0
15 PRINT "START"
20 FOR I=1 TO 100000
30 A=A+1
40 NEXT I
45 PRINT A
50 END

READY
RUN

BEN1    BA    4A

START
 100000

READY

Compilation ~1sec, calc 24secs.
Code:
LIST

BEN1    BA    4A

10 LET R=0.707
15 PRINT "START"
20 FOR I=1 TO 100000
30 LET A=SIN(R)
40 NEXT I
45 PRINT A
50 END

READY
RUN

BEN1    BA    4A

START
 0.649556

READY

72secs.
Hopefully the Basic does not optimize the sin() out.. :)

Below is a test I've found here:
http://www.bernhard-baehr.de/pdp8e/benchmarks.html
Test 1a - Basic
Code:
LIST

SHUDD   BA    4A

5  REM SHUDDER
10 N = 500
20 DIM A(4,500)
40 PRINT "START"
50 X = 0.01
60 J = 2
70 FOR I = 1 TO N
80 A(1,I) = X
90 Y = SQR(X)
100 A(J,I) = Y
110 Y = SIN(X)
120 A(J+1,I) = Y
130 Y = LOG(X)
140 A(J+2,I) = Y
150 X = X + 0.01
160 NEXT I
180 PRINT "END"
190 PRINT
195 PRINT " #";TAB(7);"X";TAB(22);"SQRT";TAB(37);"SIN";TAB(52);"N-LOG"
200 FOR I = 1 TO 17
210 PRINT I;TAB(5);A(1,I);TAB(20);A(2,I);TAB(35);A(3,I);TAB(50);A(4,I)
215 NEXT I
220 STOP
225 REM UNSHUDDER-1
230 END

READY
RUN

SHUDD   BA    4A

START
END

 #    X              SQRT           SIN            N-LOG
 1   0.0099999      0.099999       0.00999982    -4.60517
 2   0.02           0.141421       0.0199986     -3.91202
 3   0.03           0.173205       0.0299955     -3.50656
 4   0.04           0.2            0.0399893     -3.21888
 5   0.05           0.223607       0.0499791     -2.99573
 6   0.06           0.244949       0.0599639     -2.81341
 7   0.07           0.264575       0.0699427     -2.65926
 8   0.0799999      0.282843       0.0799146     -2.52573
 9   0.0899999      0.3            0.0898784     -2.40795
 10  0.0999999      0.316228       0.0998332     -2.30258
 11  0.11           0.331662       0.109778      -2.20727
 12  0.12           0.34641        0.119712      -2.12026
 13  0.13           0.360555       0.129634      -2.04022
 14  0.14           0.374166       0.139543      -1.96611
 15  0.15           0.387298       0.149438      -1.89712
 16  0.16           0.4            0.159318      -1.83258
 17  0.17           0.41231        0.169182      -1.77196

READY

~1second from START to END and another 2secs to print the stuff out..
The benchmark results in the link above are for the time measured between START and END..
:shock: :shock: :P :geek: :ugeek:

Code:
20 DIM A(4,500)  of floating points - 3 Words per FP number in PDP8

That means we store somewhere 2000 x 3 = 6000 Words of data.
So we are well above 4kW, sure.. :)

With:
Code:
5  REM SHUDDER
10 N=1500
20 DIM A(4,1500)

it takes 4secs, with N=2000 (24kW) it throws up an "TB" error (BCOMP.SV: "PROGRAM TOO BIG").

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission