Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Elf II — Parallax Forums

Propeller Elf II

HumanoidoHumanoido Posts: 5,770
edited 2012-09-29 20:13 in Propeller 1
Discussion about all things related to emulating the ELF II using the Propeller chip. Discussion includes memories, ideas on how to build and details of emulation along with sources for the project.

Propeller Elf II

This post marks the beginning of my pet project, the Propeller Elf II - new modern version that emulates and honors the nostalgic Elf II which is endearing to the hearts and minds that built these fun computers in the 1970s and 1980s. We will attempt to create our own Elf II using the very capable Propeller chip and the resources it commands. What will this new ELF kit include? The original spartan motherboard from the Netronics ELF II Kit used a hex keypad which upgraded to ASCII. The upgrades offered a lot more - more memory, TV, a cabinet, and a way to load Tom Pittman's version of Tiny BASIC. Using the Kansas City Tape Standard, one could enter HEX C0 F0 and 00 to begin downloading the source code to run the higher programming language from a cassette player. The language was truly a minimal integer version, but that was only where the fun began as a wide variety of software added on gave it many functions from various sorts to floating point routines. It's this upgraded version that will be considered, however, with a twist of including the binary switching panel made popular with the original PE article.
«1

Comments

  • Heater.Heater. Posts: 21,230
    edited 2012-03-06 01:35
    Are you intending to write an ELF instruction set interpreter for the Propeller?
    Interesting project.
  • Heater.Heater. Posts: 21,230
    edited 2012-03-06 03:30
    rwgast_logicdesign,

    Ouch!

    Any chance of some sentence and paragraph breaks in that post?
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-03-06 05:21
    ^---@Heater, the post above me, and anyone who is lost because of his post. I deleted my previous it was a bit long winded, its late i was rambling and the browser didn't submit so i had to copy and paste the message I guess when I did that it broke all my formatting and turned it into html tags and tab codes. Reformatting seemed boring and tedious so I decided to post a lot shorter version more to the point. So here it is.

    @Humanoido

    Well let me start with I am just getting into the prop chip and EE in general! I just looked at your blog because your avatar was so interesting looking, I think my project and your BigBrain have a lot in common just different goals I am going to send you a PM to keep this discussion more on topic. Maybe we could collaborate a bit, Im very excited about your Brain and this ELF.

    Ok so let me start by telling people how I even know what in the h*ll a COSMAC-ELF even is. About 6 years ago I decided I wanted to learn assembly language and had no where to start so I bought a book called Assembly Language Step by Step: Dos and Linux by [FONT=arial, sans-serif]Jeff Duntemann. This book changed my perspective on computers and programming, it sparked my passion for developing again after a long hyades after my Quake3 mod team bailed on me right after we got attention and passes to E3... pretty stupid. Anyways I used this book to use ASM, and unfourtantely soon after started working long hours and doing union schooling as an electrician (where thank god I learned a lot of basic DC Theory). Ok the point of that is if you want to learn to program to the metal that book is awesome and there is a new 3rd edition which I read a few months ago which tossed the DOS Smile and is even better. In the first part of this book its all a deep CS lesson, a hell of alot more CS than my community college class taught me. Well in the midst of the CS lesson he describes a computer he wire wrapped in the 70s his first micro, guess what that was...... a COSMAC-ELF. I got online checked it out and thought dang that thing is cool it would be neat to build one, unfourtantely I couldn't find any kits to build one and at that time was to timid to build one from the original popular science schematics, the most experience I had ever had building boards were a few FM transmitor kits. OOOKKKK a little more to the point now! By the time I had learned assembly I realized it was fun and not hard but x86 has all sorts of needless arcane gotchas for backwards compatibility. I really wanted to start a pet os until I looked into building a boot loader and had to learn about the A20 gate which is one of those x86 details that can make x86 ASM a tedious un-fun process, just like segmented memory modeling. After honing my low-level skills and learning more, I realized I would love to have something like an ELF, especially starting out.

    I belive every one who aspires to be a great coder needs assembly language and knowledge about computer architecture. People who believe ASM is not worth the time are ignorant point blank. The reality is that x86 is here to stay for a long time for legacy support and workstations at the office. The flip side to this reality is also that just because we have to live with x86 does not mean its going to play a big impact on computing from here on out. The way people compute is changing and the future is ARM and other lower powered alternatives hopefully the ATOM will die now that ARM is powering up! I personally use an AMD laptop because I have to, but Im hoping soon I will be ARM only via pandaboard and linux or something, the option for embedded developers to ditch x86 as there dev platform is becoming more viable every day. Chips like the ARM series, the Propeller, Mips are giving assembly a language a big way to comeback. ASM is fun when you can get back to the roots of the code and not worry about legacy hangups. As a youngster about 12 I learned gw-basic on a hand me down 8088 in my room, which got upgraded to a 386 with windows 3.1 and Qbasic fairly quickly. Then I moved on by the age of 16 i was contracted to write a point of sales system using SQL and VB when I walked in to a computer shop and bought a book on ActiveX. I spent 2 years doing this boring Smile, while learning C and the Quake engine in my spare time. When I quit the shady shop owner said he owned my code and would not give me a copy for a resume, which is why I took this coding for hardware job while in High School. So The 2 years of work experince I had were lost due to an under the table situation ran by a jerk who exploited cheap smart kids. BTW he makes shoes now that his store went under.

    Ok so thats my early history with code, I bet your saying what is this guy talking about, and why does any of this matter in an ELF clone thread. Well I have always been interested in EE and OS design, I dreamt of being on the windows team or working at Intel. I tried to read radio shack book and teach my self electronics as a kid but could never understand the transistor as a kid and put all my time into code. Looking back my problem was I wasted alot of time getting awesome at VB, right before c# came out and killed it. When I was young if i had an ELF Kit with some easy overview of how the board worked I think I would have gotten the transistor alot easier and how something could have 3 leads on it lol. I also would have been learning machine language and not that useless pile called QBasic! Right now theres the Raspberry PI project which is an ARM board with some GPIO pins 256mb ram and an ARM cpu. The foundation building this is pushing it as a 25 dollar box for kids to learn python. ARM ASM is alot simpler than x86 and a very profitable skill as the embedded/phone/tablet/umpc market starts to over shadow the pc. I love the idea give kids there own cheap box they can trash the filesystem on teach em a bit of linux and start them in a decent syntax like python, that will make the transition to real languages easier. I do not agree with this method of learning though now that I know the things I do. Start from the ground up!!! If you start with assembly you will be a better programmer with hi level languages be it on windows or android. People who can write assembly will always code circles around those that dont. I sont mean a kid who learns his TI calc instruction set, I mean the kid who starts off by learning assembly and how the machine works. The person who gets how a computer addresses memmory and how it reads a disk drive. Someone who knows assembly languages beyoned a set of memorized instructions tend to understand the machine well and grow into coders who understand exactly when to embed asm into there c with a bitshift in tight loop instead of dividing. Most C compilers will make better code than a good assembly coder but sometimes theres an exception and someone who has build a system and flipped in op codes with dip switches can recognize when they need to check the ASM there C compiler generates and make it a little better. The kid who started with a cosmac wont still wonder how to write hardware drivers 10 years after they started coding.

    If the ELF can be produced for a 20 or under kit, with some data sheets and explanation of the board for hobbyist and kids it will be an awesome tool to start making a generation of programmers who can code again. Kids today dont use a short or care about signed and unsigned they just declare int, or long. They dont profile there code or think about which statements translate to the least amount of machine codes that use the least cycles. The reason alot of older coders are just amazing is becuase they had to worry about space and machine cycles even back in DOS with doom. Today its 6 core phenoms core i7 extreme, hell if it were possible im sure drivers written in javascript or flash wouldn't show a notable difference in speed compared to there probably sloppy c++ counterparts using every windows API possible on top of the core win32api.

    I know what an elf 1 kit is, i looked at the elf 2 dont see to big of a difference. I totally support a kit that only uses 6 segment led displays and 8 dip switches to manually enter op-codes, into a very tiny small amount of ram. Id love to see kids have to write there programs on paper too im pretty sure the original didn't have any way to store code when powered off, that may make it so hard core that its tedious and eliminates the fun, maybe some storage for programs would be a good idea, id like to see a cassette tape interface. The keypad is an optional accessories right? the elf2 still uses dips by default for input. Anyways I would love to lend any help I can and collaborate on this with you. I belive if pushed hard in the right way this could be a highly usefull educational tool, maybe even cheaper and more exciting than the PI. I mean the I couldnt even order a PI we all ddos'ed there manufatures in 2 minutes trying to get the thing, and they had huge distributes in the UK equivalent to digi key and mouser here.[/FONT]
  • Mike GMike G Posts: 2,702
    edited 2012-03-06 05:36
    I think this is a fantastic project.

    H and rwgast_logicdesign, Please keep us updated on your progress.
  • localrogerlocalroger Posts: 3,451
    edited 2012-03-06 07:12
    Amusingly enough, I have an actual original COSMAC Elf II board which works. A few years ago I had it framed.

    Has anyone done an 1802 cog yet?
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-03-06 07:16
    Anyone working on an emulator for the Cosmac ELF or an 1802 core may find this group useful:

    http://groups.yahoo.com/group/cosmacelf/

    It is a very active group and I'm sure there are people there that can help.

    Robert
  • blittledblittled Posts: 681
    edited 2012-03-06 09:32
    I too have been toying with the idea of making an Elf II with a Propeller. When I was a teenager I was buying PE magazines when the articles were published. I was engrossed with the articles but my income from lawn mowing wasn't enough to get one :(. Even though I originally found the articles confusing since I had no prior experience with computers I was soon drawing out schematics of what I would add to the Elf II. Although I never had one I felt the articles were the start of my interest in computers. It would be great to have an Elf II clone! Keep up the good work.
  • LeonLeon Posts: 7,620
    edited 2012-03-06 10:24
    Here is the FPGA-Elf:

    http://whats.all.this.brouhaha.com/2010/07/30/fpga-elf-is-100-times-faster-than-original-cosmac-elf/

    It's 100 times faster than the original!

    The code doesn't appear to be available. Implementing the 1802 on an FPGA should be quite easy, though.

    Someone has even emulated it on a PIC:

    http://old.nabble.com/Retro-computing-with-PIC-processors-%28COSMAC-Elf-without-1802%29-to28610048.html#a28612340
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-03-06 10:26
    blittled wrote: »
    I too have been toying with the idea of making an Elf II with a Propeller. When I was a teenager I was buying PE magazines when the articles were published. I was engrossed with the articles but my income from lawn mowing wasn't enough to get one :(. Even though I originally found the articles confusing since I had no prior experience with computers I was soon drawing out schematics of what I would add to the Elf II. Although I never had one I felt the articles were the start of my interest in computers. It would be great to have an Elf II clone! Keep up the good work.

    If you want one that runs a real 1802 you can get a partial kit here:

    http://www.sparetimegizmos.com/Hardware/Elf2K.htm
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-06 10:35
    Elfen Magic!

    I didn't have an Elf but I did have a COSMAC 1802 development board that had a hex display and a hex keypad for input. It was the first thing on which I started writing Threaded Interpreted Languages which led to Forth which leads to programming like Yoda speaks.

    I had a lot of fun abusing that little board.

    The Elf2K looks like fun! Thanks for reminding me of that, Robert!!
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-03-06 12:10
    Going further and further back in time, there is bound to be a system that fits the Prop (without external resources)

    Along that thinking path, I have just throw together one of these -

    http://www.jcwolfram.de/projekte/avr/ax81/main.php

    (sorry, its one of those three letter words)
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-07 00:28
    My COSMAC ELF Story Part 1 of 2

    Prior to 74, I got the incentive to build a computer. Buying a $100,000 IBM was out of my range. I then got the idea to buy a broken computer and fix it. I searched "used computer" magazines and papers and discovered the lowest price non-functional mainframe computer was only $50,000.00. Again, it was out range of my small $100 budget. I then decided to build my own. Following that time, I built working computer circuits from big lights, switches, wires, etc. Word got out about what I was doing and instructors asked me to give demos to the Physics and Computer Math classes. Remarkably, everything worked perfect, the second time.

    This led to the time era when I took over the University IBM 360/50 mainframe. My programs were so big, they were carried around in boxes of cards, mostly shoeboxes, one for each program. They calculated Celestial Orbits, did the first Fortran IV graphics of a changing Comet Tail, mapped out planets in the solar system, predicted weather on Mars and Earth, did ray tracing, plotted optical lenses and light paths, designed big telescopes, performed utilities and did statistical programs for advanced physics lab, relativity class, etc. However, all this had a very bad side effect on the University computer -

    I was squeezing everyone out with my programs, and running the on-campus TSO terminal was not convenient as it was locked up at certain hours with no access. I really needed my own computer. Finally it happened. Rumor had it that someone purchased a large lot of 100,000 of those $100,000 processor chips and was able to reduce the cost to $100 each. It was the 1802 chip - I was in on this deal.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-03-07 00:38
    My Nascom 1 cost me one month's wages. Even though my father was into electronics, he thought I was mad to pay all of that just for a large bag of bits.
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-07 01:01
    Heater. wrote: »
    Are you intending to write an ELF instruction set interpreter for the Propeller?
    Interesting project.
    Heater, I think a COSMAC ELF II emulator will need to have some functionality in running some of the original COSMAC ELF programs. I cannot say the details because I don't know at this time. It could take me a very long time to do a full instruction implement detail for detail. Maybe someone more suited can parallel project develop it. Or could we implement a subset? I also have interest in duplicating the graphics and something similar the original Tom Pittman Tiny BASIC that ran on the Netronics ELF II. The panel could contain toggles and I think Parallax has 7-segment displays that will work well. The emulator will use SPIN to emulate the instructions. The prop is good at matching operating speed.
  • Heater.Heater. Posts: 21,230
    edited 2012-03-07 04:23
    Humanoido,
    ...a COSMAC ELF II emulator will need to have some functionality in running some of the original COSMAC ELF programs...

    Well, Tom Pittman's Tiny BASIC is one of those original COSMAL ELF programs. So you are going to need an op code level emulation to run that.

    The Elf must be about as complex as the Intel 8080 so you have a manageable task on your hands.

    Sadly I have little time for Prop projects for now and I did promise myself that "I'm done with emulations" at some point.
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-07 07:19
    Heater. wrote: »
    Humanoido, Well, Tom Pittman's Tiny BASIC is one of those original COSMAL ELF programs. So you are going to need an op code level emulation to run that. The Elf must be about as complex as the Intel 8080 so you have a manageable task on your hands. Sadly I have little time for Prop projects for now and I did promise myself that "I'm done with emulations" at some point.
    Indeed, sadly the highly skilled people who can churn out the core op codes easier than the rest of us are in demand with so many other projects. Why are you done with emulations at some point?

    We should ask the question to all, what are your favorite ELF programs?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-03-07 08:09
    Just hope that Pullmoll is listening, he seemed to put out emulation code as an astonishing rate.
  • Heater.Heater. Posts: 21,230
    edited 2012-03-07 08:21
    I'm not sure you have to be so highly skilled to create such an emulator. My first 8080 emulator was very crude and written in Spin. Damn slow but it proved I understood the 8080 opcodes enough to get something running and was my first Propeller program as a learning exercise. After that it was time to go to PASM and get all the help from the forumistas that could be had.

    As for being done with emulators: Just when the 8080 was running well enough to run CP/M and all it's applications on the Prop I was egged on to going for the full Z80. A ten times bigger project. After two or three versions of that, trying different approaches, it was up to building CP/M from source on the Prop itself.

    Then there was the 6809 emulator that is still languishing as it is a big thing that does not fit well in the Prop I.

    Then there was the Zog implementation of the ZPU instruction set. That works well but now we have propgcc there is not so much urgency to running GCC on the Prop via ZPU op codes.

    So that's enough for the emulators for now. They may get revisited for the Prop II.

    Just now all my attention is going into 3D graphics with webgl inside web pages along with websockets to get real-time data into them. Which will be the subject of my next little Prop project. A hot line from FullDuplexSerial on the Prop to 3D knobs, dials, graphs and other widgets inside the browser.
  • PublisonPublison Posts: 12,366
    edited 2012-03-07 08:22
    Just hope that Pullmoll is listening, he seemed to put out emulation code as an astonishing rate.

    Why did he disappear so suddenly? He could pump out some code!
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-07 08:44
    @ Heather

    I'm looking forward to your project. Is HTML 5.0 directly involved?

    Just now all my attention is going into 3D graphics with webgl inside web pages along with websockets to get real-time data into them. Which will be the subject of my next little Prop project. A hot line from FullDuplexSerial on the Prop to 3D knobs, dials, graphs and other widgets inside the browser.
  • Heater.Heater. Posts: 21,230
    edited 2012-03-07 09:06
    Bob,

    This is a topic for another thread but I will start that when I have something that starts to work.

    Thing is I have been avoiding any kind of WEB technology for ever now. All that HTML, CSS, Java script in the browsers and that mess of PHP or whatever on the servers is just plain ugly not to mention the need for WEB servers and the crappy HTTP request response protocol. I spent a year doing such development ten years ago and it was just ugly. For someone coming from the world of compiled code and languages with types this all seemed very clunky.

    But now I'm all fired up because of the HTML5 developments and the wonderful google-chrome browser.

    1. You can render 3D hardware accelerated graphics into a web page via the HTML5 canvas and webgl. The three.js library makes this very easy.
    2. You can get an almost normal socket connection back to your server via HTML5 web sockets.
    3. You can program all that browser stuff in Javascript. Javascript turns out to be a bigger and more powerful language than I ever imagined.
    4. With all that you can make apps on the browser that look more like native than any web page.
    5. Indeed in chrome you can run the thing in "app mode" where it just shows your app in a normal plain window with no surrounding browser controls. You'd never no you were working with a web app.
    6. You know longer need an Apache or other server to serve up your web app. With node.js you can create a web server and provide the socket connections to you web app in about 50 lines of code and run it locally on your machine. Yes that's java script as the server! It's amazingly fast.

    All that remains is a hop from your serial port where a Prop is connected into your node.js server. On Linux the ser2net program will do that nicely.

    There we have it, the hot line from Prop to 3d accelerated graphics, locally or on the net.

    I'm pursuing all this as a project at work but as soon as I have some free time the above will swing into action.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-03-07 09:26
    @Heather

    Ok thanks!. I'll follow your project and help if I can. I've been reading up on HTML 5 for the past few months. When I did a search to to see what WebGL was I found this on the Wiki:

    " WebGL is based on OpenGL ES 2.0 and provides an API for 3D graphics.[3] It uses the HTML5 canvas element and is accessed using Document Object Model interfaces. Automatic memory management is provided as part of the JavaScript language.[2] "

    Good idea about starting another thread.

    re: Javascript turns out to be a bigger and more powerful language than I ever imagined.

    Yes, it's come a long way. It's even starting to be fun to use. LOL
    .
    Bob
  • Heater.Heater. Posts: 21,230
    edited 2012-03-07 09:50
    webgl is still basically opengl in javascript. As such it is quite hard to use. Just now I'm using the three.js library which wraps all that in a much simpler API but is still capable of amazing things. I only really need 2D drawing on this current project but it needs to be able to move a lot of things around quickly in response to real time activity so having hardware accelerated graphics in the browser with webgl is great.

    We should not really hi jack this thread so let's continue another day.
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-11 08:02
    16 ideas are added to the list for the Propeller ELF II. To emulate the NETRONICS ELF II BIG BOARD, it looks like the Parallax HYDRA board has the features needed. One in particular is the small BUS. We may reserve the ELF II for other Propeller boards and go with the HYDRA to make a new ELF III. Questions remain about the degree of emulation and what extras can be added?

    http://humanoidolabs.blogspot.com/2012/03/propeller-elf-ii.html
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-14 23:02
    I've outlined more direction for the project here. However, regarding most emulation projects, is it common to add features or strictly stick to the original machine? For example, I recall one Apple II emulator that had some enhancements that were very nice.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-03-15 02:41
    I see no reason that extras shouldn't be added to keep up with the modern hardware. It would be tricky to get hold of a cassette recorder now (and having to implement a modem of some sorts), so a SD storage would be a welcome solution. This would lead to some some of file system, which we could have only been dreamed of, back in the day ...
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-16 00:19
    I see no reason that extras shouldn't be added to keep up with the modern hardware. It would be tricky to get hold of a cassette recorder now (and having to implement a modem of some sorts), so a SD storage would be a welcome solution. This would lead to some some of file system, which we could have only been dreamed of, back in the day ...
    It looks like the HYDRA board will fit as an emulator of the ELF II Big Board and has the bus built in for the SD card. The SD card will emulate the cassette I/O. It can swap out with the 512K card for other functions... I plan to go this route. There's also some EEPROM built in, at 128K which is useful. A lot of ELF II programs could store there, considering those programs were under 256 bytes (1/4th K) in size. Blogging some progress here. Some kind of Prop ELF OS would be useful.
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-22 03:54
    More updates on the COSMAC ELF II EMULATOR
    at the Propeller Elf II.

    I'm putting together a list of games
    that originally ran on the NETRONICS
    ELF II in Machine Language and in
    Tom Pittman's Tiny BASIC. So if you
    know of sources and listings for your favorite games
    and programs from that long ago, post here..
    We'll get these typed up and saved as text so
    they can be loaded into Prop EEPROMs and SD
    Cards for simulation of cassette I/O.
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-03-24 07:25
    This Propeller ELF II Project is now updated here

    http://humanoidolabs.blogspot.com/2012/03/propeller-elf-ii.html

    to include a more complete list of COSMAC ELF 1802 emulators and simulators
    inclusive of emulated Tiny BASIC versions, one of which includes Super Tiny BASIC.
    This section is a "must review" not only for nostalgic reasons but also technical merit
    for anyone reviewing or constructing their own Propeller ELF II.
  • ctwardellctwardell Posts: 1,716
    edited 2012-03-24 08:28
    I'm working on an 1802 core that uses the concept of a "bus" using hub ram where soft peripherals run in other cogs and communicate of that bus.
    I'm still not sure if I'm going to be able to squeeze it into the available cog memory and available cycles to get the timing right to support color burst /2 timing.
    I'll keep you updated on progess.

    C.W.
Sign In or Register to comment.