Shop OBEX P1 Docs P2 Docs Learn Events
Toward a Self-Hosting Propeller - Page 3 — Parallax Forums

Toward a Self-Hosting Propeller

13

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-06-20 22:07
    I was looking at the conversion of KyeDOS to TV this weekend.. No issues there..

    You know the one thing we don't have yet.. An ICON based system. Not necessarily a GUI, but maybe something along the lines of Windows 1.0 could be done with the Propeller.

    Yes I'd like to get Kyedos onto a TV as well. I wonder which text driver would be best? I am thinking 40 columns might be on the limit of readability on a 3.5" TV, but ideally we would want the flexibility to drop in a variety of text drivers. So define pins at the beginning, use a common interface to all the drivers (which is pretty much how they all work) and then with one line change, you could use different spin objects?

    Second = icons. Well that is a brilliant suggestion.

    Ok - every time a .binary file is compiled using F8 on the proptool, we also create a .ico file. Maybe two - a 16x16 and a 32x32?

    On the startup screen, instead of text, we have some icons, and instead of typing "help" you click on the "?" icon. Maybe if the mouse is at the edge of the screen you scroll the screen in that direction, so creating a larger virtual desktop?

    This sounds like fun!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-21 06:30
    Dr_Acula wrote: »
    Yes I'd like to get Kyedos onto a TV as well. I wonder which text driver would be best? I am thinking 40 columns might be on the limit of readability on a 3.5" TV, but ideally we would want the flexibility to drop in a variety of text drivers. So define pins at the beginning, use a common interface to all the drivers (which is pretty much how they all work) and then with one line change, you could use different spin objects?

    Working on it right now...

    OBC
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-22 20:28
    Here's a copy of KyeDOS3 with very minimal alterations to add the options of both TV & WebTV_keyboard drivers.

    I've left the bulk of the code in-tact so that all of the existing features are still there.

    KyeDOS3_tv.zip

    OBC
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-06-22 23:48
    Wow, this is great!

    I was just in the middle of writing my own version and finding I needed about 3000 more longs. So I'm more than impressed with your code.

    I made a few mods - hope this is ok?

    1) at the beginning, add the TV parameters same as the VGA
      _TV_Enabled = true ' TV display on
      _TV_Pin = 16 ' group of 3 pins starting at pin 16
    
      _VGA_Enabled = false ' VGA display on
      _VGA_PinGroup = 2
    
      _LCD_Enabled = false ' false or true for 20x4 LCD display
      _Serial_Enabled = false ' send output to serial port 
    

    Then _TV_Pin replaces your VideoPin variable.

    2) I commented out the LCD display in the Obj, then commented out all instances where it wouldn't compile (a quick way to find them all). The TV can emulate a 20x4 LCD display using a big font so no need for an 20x4 LCD display any more.

    3) My dracblade SD pin group starts at 16 and yours at 0. My keyboard is 26 and yours is 5. So just change these at the beginning. I'm mentioning these in case I post some code later and it won't run on your setup.

    4) For some reason your keyboard driver isn't working so I have this in the Obj section
      fat: "SD3.01_FATEngine.spin"
      taf: "SD3.01_FATEngine.spin"
      rtc: "DS1307_RTCEngine.spin"
      'com: "RS232_COMEngine.spin"
      str: "ASCII0_STREngine.spin"
      'adc: "PCM2.1_ADCEngine.spin"
      'dac: "PCM2.1_DACEngine.spin"
      'bmp: "VGA64_BMPEngine.spin"
      'text: "VGA_1024_VT100"       ' VGA VT100 Terminal Driver
      text:  "aigeneric_driver"
      key : "Pocketerm_Keyboard"           ' pocketerm keyboard
      'key : "webtv_keyboard"
    '  lcd : "DracLCD"                     ' 20x4 LCD driver for dracblade
      delay: "Timing"                     ' for millisecond delays
      sio     : "pcFullDuplexSerial2FC" 
    

    I left in the commented out objects so it can be changed more easily.

    5) The printstring and printchr PUBs now look like this, with bits you can comment in and out as needed. (one might think about removing the serial driver?)
    PUB PrintString(pstring)' sends pstring to the vga and serial port with no CRLF
        if (_TV_Enabled)
          text.str(pstring)
    '    if (_VGA_Enabled)  
    '      vt100.str(pstring)                                 ' send to vga screen
        if (_Serial_Enabled)   
        sio.str(0,pstring)                                 ' send to com port
    '    if (_lcd_Enabled)
    '       lcd.str(pstring)                                   ' send to 20x4 lCD display
    
    PUB PrintChar(c) ' sends c to vga and serial port
        if (_TV_Enabled)
          text.out(c)
    '    if (_VGA_Enabled)
    '      vt100.out(c)                                        ' send to vga
        if (_Serial_Enabled)
          sio.tx(0,c)                                         ' send to com port
    '    if (_lcd_Enabled)
    '      LCD.out(c)                                          ' send to LCD display   
    


    6) What is your color command? In your code is the vga command, changed to text. so
      text.color(%00001000_11111100)                       ' Blue_White  blue =3/4 power 10, white =full  
    
    But I think it works differently. I'd like to experiment with other colors. Does your driver have background/foreground or is it always something on black?
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 06:46
    @Dr_A:

    Those changes sound fine! I'm working on a stripped down version as a PropDOS replacement as well.

    The color command is different in the AIGeneric driver, but it wasn't causing errors so I left it alone.

    OBC
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-06-23 07:17
    This is brilliant. We now have an operating system that is possible to be portable and battery powered. The biggest component of such a system is the keyboard.

    I see quite a few things we can do.

    1) Get sphinx working. I never was able to get sphinx to talk to my TV display - probably a timing setting or something. I wonder if sphinx could be recompiled using your text driver?

    2) Experiment with icons. I see that this TV kyedos pretty much fills the memory, but that is the beauty of kyedos, it does not matter because you can run other programs. As a simple demo, I put the original Palatte demo onto the sd card, and if I type "Palatte" it runs that program.

    So you can 'run' an icon driven program as a separate program under kyedos. Now you have all the memory free again. It is a bit like the original windows program that run from DOS. It is a stepwise way of doing things.

    I'm playing around with graphics drivers, and in particular, looking at writing a vb.net program to translate bitmaps into the closest propeller colors. I'm hoping this could be useful as something that could create icons easily.

    3) Do you have a larger font driver? This one is 40x25 and it is just at the size it is getting hard to read on a 3.5" TV. Maybe I should go up to the next size LCD TV? But if you have a larger font, that would be great.

    4) I'm also slowly writing a proper GUI program in Catalina. It is up to 200k in size now and keeps growing. I need to get the TV graphics driver working so I can port it over from VGA to TV. It has the beginnings of text boxes and richtextboxes, and I think these could be a key part of getting a self contained propeller system working, as they would be the workhorse part of a word processor/IDE environment.

    I do see though that sphinx has a text editor. Maybe the next part of getting self hosting working is to get this sphinx text editor working on your 40x25 character display?
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-06-23 07:36
    any development towards using C3 in this?

    can somebody give me an overview what has to be changed to make any of the DOS'es run on a C3-board?

    best regards

    Stefan
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 07:38
    @Dr_A:

    1) Sphinx has it's own low hub memory text driver. While I'd love to convert it to AIGeneric, I really doubt it would work. This is the reason I've been looking at dual-prop solutions for this. If we use Sphinx with the Serial driver, then the video driver that is used (TV or VGA) will be a non-issue. Run Sphinx on the second prop, with a terminal booted from KyeDOS on the first.

    2) I'm still toying with what can be done with icons. It might mean an entirely different program. (IE: icon based program launcher) I'm thinking the VGA tile driver for this. I've started working on it, but it's been slow going.

    3) We could switch from the AIGeneric to Dougs newer text driver. It'll run at 20x25 IIRC. I'll look at it after the show.

    The text editor that Casslan wrote (linked somewhere in this thread) should be perfect for our needs. Perhaps we could use the adjusted text driver for those who the font is too big. :)

    OBC
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-23 07:56
    I've posted a Sphinx modified for the C3. Here it is again. The directory SphinxDrive can be copied to the root directory of your SD card to get started. The .webarchive files are produced by Safari on a Mac when saving web pages. You can ignore them if you're using something else.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 08:04
    The funny part about this thread is that between several of us, we actually have all of the pieces for this project.

    It'll be interested to watch this come together as a "product" of sorts when everyone plugs their piece of the puzzle in. :)

    @Dr_A: I'm thinking "entire kit" here: We should do a C3 version, and GG/Demoboard version with all the pieces connected together. { DOS, Editor, BASIC } What is the I/O configuration (detailed) of what you are running?

    OBC
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 08:05
    @Mike

    Thanks! Another time saving piece. :)

    OBC
  • yetiyeti Posts: 819
    edited 2011-06-23 09:02
    I'll prefer a Sphinx or something like that communicating to a terminal instead of needing a mobile TV because I nearly always have something in my pockets with USB or a serial port and terminal software but definitively never a TV.

    Ariba's "Sphinx-PC" (Sphinx talking serially over pins 30/31) looks fine for me and I'll take a closer look at it.
    ...ok... I already am looking...

    Optionally combined with a second propeller to manage TV or VGA and keyboard as a terminal, a self hosted system in two parts would meet all my potential needs in a modular and flexible way.

    A bit of RAM and flash would be nice too (hello C3!), but I did not look at the C3 version of sphinx yet because serial communication is the top priority on my wishlist.
  • BeanBean Posts: 8,129
    edited 2011-06-23 10:05
    The funny part about this thread is that between several of us, we actually have all of the pieces for this project.
    It'll be interested to watch this come together as a "product" of sorts when everyone plugs their piece of the puzzle in. :)
    @Dr_A: I'm thinking "entire kit" here: We should do a C3 version, and GG/Demoboard version with all the pieces connected together. { DOS, Editor, BASIC } What is the I/O configuration (detailed) of what you are running?
    OBC

    OBC,
    I'm interested in helping with the BASIC if you need any. You may use PE-Basic for we can start from scratch. But I'm "in" to help with the BASIC.

    Bean
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-06-23 10:16
    I was going to suggest PE-Basic when this thread first started, but it seemed to go in a different direction. I think a stand-alone system with PE-Basic and a simple OS like CPM would be great.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 10:39
    Yeah, I'm really leaning toward two propellers for this.. Gotta get UPEC stuff finished so I can do a little more work on this tonight.

    OBC
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 10:40
    @Bean:

    Another piece arrives! :) Thanks, yes I'll collaborate with you as well on BASIC.

    OBC
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-06-23 11:42
    Hello Mike,

    thank you very much for pointing me on the Sphinx-C3-version.

    As in the other thread mentioned I don't have a TV on my desk.

    So I tried the PropTerminal-Sphinx-version on my C3.
    I added the Select SPI-channel methodvand changed SD-pin to 9. But this did not work.
    It hangs up at codeline sxfs.start( sdPins )

    What do I have to change to make the C3-sphinx version usable with a PC-terminal-software using the prop-IO-pins 31,30?

    best regards

    Stefan
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-23 12:13
    The SD card I/O routines had to be changed to work with the C3. You'll need to take the sdspiq.spin file from the C3 version and substitute that for the one in your PropTerminal version. You'll also have to modify Sphinx.spin in your PropTerminal version to use the sdPins constant definition from the C3 version.

    If you're going to recompile Sphinx using itself, you'll need to use the sdspiq.spn file from the C3 version and make the same change in Sphinx.spn to the sdPins definition.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 13:36
    I'm posted this to the thread more for future reference..

    I think I'm the only one using the IR keyboard setup, but here's a copy of the driver with some additions to make it compatible with Sphinx. (RCA "UltimateTV" keyboard: WKN10WB1)

    Don't judge me.. the forum is sometimes a great backup. :)webtv_sxkb.spin

    OBC
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-06-23 13:41
    Hello Mike,

    thank you very much for guiding me.
    I made some progress.
    Now I get the prompt ">"

    If I go on like described in the file Installing Sphinx.pdf
    1. Boot up your Propeller. On the screen you should see something like this:
    ============ Sphinx xxxxxx ============
    video @ pin 24
    keyboard @ pin 13
    SD @ pin 16
    >_
    2. Time to build the editor. Most of the editor's sub-objects are already compiled, but you have
    to compile a couple to get some practice. Enter the following commands:
    c tvtexted (this will compile the editor's video driver)

    I get a message TV.SOB could not open
    then the message disapears and the start message is shown again.

    What does that mean?
    Am I assuming right that this TV.SOB-file is a sub-objectfile that is created while compiling?
    Or does it have to be already on the SD-card?

    (if I'm allowed to comment on that: this is an adventure and how it seems with a lot of hills and rocks to climb up instead of textguided tour through the city on flat streets)

    best regards

    Stefan
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 13:52
    @Stefan,

    Is is possible you missed Step 2? http://www.sphinxcompiler.com/Home/installation

    Did you copy the files from sphinx1 into the SD card?

    OBC
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-06-23 14:21
    Yes I copied the files from the sphinx1-folder onto the SD-card.

    After these tests I looked up the content of the SD-card on my PC and this is stored onto it
    01.01.2001  00:00                18 ARGS.D8A
    01.01.2001  00:00             9.591 TVTEXTED.TOK
    01.01.2001  18:22                 4 TIMESTMP.D8A
    28.11.2010  22:58             6.148 .DS_Store
    01.02.2010  13:36            16.532 codegen.bin
    20.06.2009  09:58               489 cogcheck.spn
    24.06.2009  09:12             1.659 copy.spn
    21.11.2010  15:56             6.336 del.spn
    08.08.2009  15:03             5.576 dir.spn
    20.06.2009  09:59               707 echo.spn
    01.02.2010  10:14            16.065 ed.spn
    04.05.2009  08:52             7.917 gr_demo.spn
    04.05.2009  10:27            62.812 graphics.spn
    25.06.2009  00:05               208 hello1.spn
    25.06.2009  00:17               174 hello2.spn
    01.01.2001  17:06             9.552 lex.bin
    01.01.2001  16:33             3.808 link.bin
    20.06.2009  10:15             8.493 tvtexted.spn
    01.12.2010  13:23             1.968 wcopyto.spn
    28.11.2010  22:49             3.022 wdel.spn
    29.11.2010  00:07             3.133 wdir.spn
    02.12.2010  13:08             1.941 wrun.spn
    01.01.2001  00:00            33.862 ED.TOK
    
    The *.TOK-files seem to be added from the compiling process.

    Are these the right files or am I missing something?

    Edit: I guess there is something wrong with the PropTerminal-versions of some files.
    After typing c tvtexted.spn the system comes back. But if I type on the keyboard nothing happens
    Only if I hit enter randomised characters appear.

    best regards

    Stefan
  • mparkmpark Posts: 1,305
    edited 2011-06-23 15:36
    StefanL38 wrote: »
    Yes I copied the files from the sphinx1-folder onto the SD-card.
    ...
    Are these the right files or am I missing something?

    There are several files in sphinx1 that aren't in your list (and vice versa).
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 16:09
    @mpark,

    Do you have Propeller Tool compatible version of all of the Sphinx programs available somewhere? It would make it easier to do the keyboard driver switchout that I'm attempting.

    OBC
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-06-23 17:22
    This thread really is looking exciting.

    For me, sphinx is giving a rolling display on the TV - I need to try changing a few parameters with the display settings.

    In general terms, it would be great to have a package of files that you can unzip and put on an SD card. Sphinx, text editor, some graphics demos, Propbasic etc. These can be both source and compiled.

    It would also be great to be able to run these programs on multiple platforms. For instance, your SD card is on pin 0 and mine is on pin 16. There are a few solutions eg
    1) Use BST and have multiple #ifdefs for each platform
    2) Define a variable at the beginning of code, and if this is true then run certain drivers. Comment out various objects
    3) Build multiple versions of files for various platforms and put all these on the SD card. These are 'executables' - maybe rename .binary files with extensions based on what platform they run on eg .c3, or .dra, or .dem.
    4) Have a single text file on the sd card with platform parameters, and every program reads this at startup.
    5) In the spirit of self hosting, try to simplify different platform parameters to just a few line changes, so they can be recompiled on the board itself


    I can see advantages and disadvantages for each of these and maybe a solution can incorporate all of them?

    For the purpose of this thread topic, I guess getting sphinx working on multiple platforms might be the next goal, and then if we all have it working on whatever our platform is, then we can all contribute to the project.

    Can sphinx be changed between TV and VGA easily?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-23 17:33
    "Can Sphinx be changed between TV and VGA easily?" No

    The display driver is written for TV video and has the display buffer kept in the cog's memory to make as much hub memory available as possible. I don't think there are any VGA drivers written to do the same thing although it shouldn't be hard, particularly since the driver would have TV-like resolution (640 x 384).
  • yetiyeti Posts: 819
    edited 2011-06-23 20:44
    Dr_Acula wrote: »
    In general terms, it would be great to have a package of files that you can unzip and put on an SD card. Sphinx, text editor, some graphics demos, Propbasic etc. These can be both source and compiled.

    It would also be great to be able to run these programs on multiple platforms. For instance, your SD card is on pin 0 and mine is on pin 16.
    Sphinx can start programs in two ways: a) replace only the "main" program but leave the cogs driving the peripheral components alone or b) start a program that takes control over evrything.

    In my experiments with Ariba's modified Sphinx I was able to run the essential binaries that came precompiled with the original TV-ish Sphinx zip because of this.

    It is like in CP/M: You dont need to recompile e.g. Turbo-Pascal on each new system just because it drives the keyboard differently.

    The "drivers" (sxkb.spn and friends) must know the peripheral setup... thay need to be rebuilt matching the platform... like writing a new BIOS for CP/M.

    This may be breakable into handy modular pieces which would be doable on another Sphinx system or on any box where .NET or Mono is available (thinking of homespun now) and for owners of a PC with a mainstream OS it'll be no problem at all because of well known IDEs :-)
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-06-23 21:32
    Dr_Acula wrote: »

    In general terms, it would be great to have a package of files that you can unzip and put on an SD card. Sphinx, text editor, some graphics demos, Propbasic etc. These can be both source and compiled.


    That is exactly what I'm shooting for here..
    Can sphinx be changed between TV and VGA easily?

    If I understand correctly, the only way we are going to pull of other displays is the dual-propeller setup.

    OBC
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-06-24 00:46
    If I understand correctly, the only way we are going to pull of other displays is the dual-propeller setup.

    I wonder if one way to do that might be to have a propeller running Sphinx, and outputting to a serial port, and then take an "off the shelf" propeller pocketterm board by Vince Briel, and use that as the display?

    I'm thinking about this for another reason, and that is that I do not seem to be having any luck getting the Sphinx TV driver to work. I have a working TV driver (eg your kyedos program, and the original palatte demo from the obex, with pins changed to long %010_0000 'pins ), but the sphinx driver has a rapidly rolling display which sometimes is in sync and sometimes not. When in sync, it does display the text signon message.

    I've got the TV driver code open alongside the Palatte driver code, and there are some similarities. The pin selection is done in spin, but the end result is binary 0100000 so that is the same. The "initialized data" section of pasm seems to be the same.

    But there do seem to be a lot of changes within the sphinx TV driver code compared with that older TV demo code. I'm not quite sure where to start.

    The sphinx TV driver seems to have two major changes from the older demo code - there are (probably) some parameter changes, and also, the cog ram seems to be recycled for a text buffer. So it does not seem as simple as just dropping in another object to replace the sphinx TV driver.

    I'm not quite sure where to take this next. I have a gut feeling that a self hosted propeller solution can be written on one propeller. But without a screen working for sphinx and with sphinx unable to do VGA, I can't see any solution other than to use sphinx in 'serial port' mode and use another propeller for the display.

    So close, yet so far...

    I wonder if I need to take it back a step and work out which video driver sphinx came from, and see if I can get that original video driver to work?
  • yetiyeti Posts: 819
    edited 2011-06-24 00:58
    Dr_Acula wrote: »
    I wonder if one way to do that might be to have a propeller running Sphinx, and outputting to a serial port, and then take an "off the shelf" propeller pocketterm board by Vince Briel, and use that as the display?
    For exactly that have a look at Ariba's Sphinx-PC: http://forums.parallax.com/showthread.php?114023&p=872792&viewfull=1#post872792
Sign In or Register to comment.