Shop OBEX P1 Docs P2 Docs Learn Events
Propeller OS — Parallax Forums

Propeller OS

Mike GreenMike Green Posts: 23,101
edited 2007-04-09 20:21 in Propeller 1
Here's the latest version of the Propeller OS. In addition to some bug fixes, these are the major features added/changes:
1) All 3 display versions are included. There are 4 modules currently that are display dependent and the display dependent versions are in folders labelled with the type of display desired (TV, lowres VGA, hires VGA). The different types of modules have the same names (OS_initialization, OS_dspText, OS_dspTextInit, OS_loader). Just copy the set you need into the top level folder and compile.
2) The keyboard lights work again
3) There are early versions of support for GHI Electronics' uALFAT-SD and USBwiz. The USBwiz version is for SPI, but will be changed to I2C. The OS compiles with the uALFAT-SD support which uses the TEST command and just allows you to type commands to the uALFAT and see the resulting messages. Like the editor, the App key (to the left of Ins) is used to exit from the TEST command. Eventually these devices will be integrated into the PROBE, LIST, COPY and RUN commands. For those that are not familiar with them, these support MMC/SD cards with standard FAT directories (compatible with Windows, Mac, and Linux). The USBwiz also supports USB flash drives and a slightly different uALFAT-USB device supports USB flash drives instead of the MMC/SD cards, but with essentially the same command set.
4) The initialization routine has been moved to its own object. This simplfies the process of writing your own program using the OS routines without the command interpreter. You only have to reference the initialization object and call its start routine as the first thing in your main program.

Other plans:
1) Add cursor capability to the TV and lores VGA drivers and eventually make all three drivers strictly compatible except for display size and color capability. As much as possible, the color display control sequences will be made compatible. The intention is to make the three drivers interchangable
2) There is an experimental version of a LOAD command intended to allow direct downloading from the Propeller Tool using a USB2SER adapter (to avoid the reset from the Propeller Tool). It doesn't work yet and I'm not sure why. We'll see if I can get it to work eventually.


The pre-Halloween update is attached. There's a ReadMe file and some more demo programs, some minor corrections and additions.

Post Edited (Mike Green) : 10/27/2006 11:09:51 PM GMT
«13

Comments

  • nutsonnutson Posts: 242
    edited 2006-10-07 08:14
    Mike, I cannot compile the OS, the prop IDE tells·me·I exceed the 32 object limit. After this·message the IDE crashes on exit. Commenting out·the EEprom loader and ALFAT objects is not enough,·also commenting out the Window·editor·results in succesfull compilation and run. Only I cannot enter commands of course. Can I adjust this 32 object limit, or do you have another version of the IDE?



    Nico Hattink
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-07 14:40
    Nico,
    I've got a newer version of the IDE. I don't remember if the fix for this has been posted yet. Do you have the 0.98.1 version?

    If it's not been posted yet, I'll have to post the compiled binaries for now so people don't have to compile.
    Mike
  • nutsonnutson Posts: 242
    edited 2006-10-07 15:03
    I run the 0.98.1 version as posted on the Parallax site. Are you working under OS-X running some kind of Windows emulator? Maybe that makes the difference. Anybody else working under XP have the same problem? What a shame, I had a G5 standing in my study that I donated away some days ago....

    Nico Hattink
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-07 15:22
    I use Virtual PC (or sometimes Guest PC). Both are PC emulators.

    I ran across this 32 object limit before, trimmed back the number of objects. Parallax did fix the IDE, but I had forgotten that it hadn't been released yet. In trying to fix other stuff in the OS, I guess I've crept across the 32 object boundary again. Sorry.

    I'll post the binaries this afternoon for each of the display types. You could try to embed the initialization routine back in the main program. That would eliminate one more object and might make it possible to compile. The editWindow object was put in a separate object because I expect it to get more complicated in the future. That could also be put back in the main program to eliminate another object.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-07 18:43
    Here's the Propeller OS archive with the pre-compiled binaries in each of the folders (for the specific display). You can load the binary into the Propeller Tool with the Open menu item and it can be downloaded that way to a Propeller.
  • nutsonnutson Posts: 242
    edited 2006-10-07 19:49
    Thanks Mike, I can work with the binaries. Good to support various display possibilities. I'll remain with version 1.031 for my own experiments till I hear about an IDE fix.

    Nico Hattink
  • NewzedNewzed Posts: 2,503
    edited 2006-10-08 21:05
    Mike, in the OS version I am using, the default display is yellow font on a blue background.· Is there any way to change the color of a line for emphasis, say cyan, green or white, then return to the default display?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-08 22:48
    Sid,
    In both the low resolution VGA version and the high resolution VGA version, there is an ability to affect the color of the display. In both cases, look at the list of control codes at the beginning of the display object (OS_vgaHiresText.spin or OS_vgaLoresText.spin). Most of these are the same in the different display versions, but the color ones are display dependent. The one you want is called "Color".

    For the high resolution VGA display, do a series of "dsp.out" calls like "dsp.out(dsp#Color)", then "dsp.out(row)" where "row" is the display row to be affected, then "dsp.out(foreground)" where "foreground" is a foreground color, and "dsp.out(background)" where "background" is a background color. There's a comment describing "colorPtr" which gives the format for each color byte. Essentially it's %RRGGBB00 where RR is the two bits for red intensity, GG is the same for green, and BB is the same for blue. You'll have to experiment. I think the high resolution VGA text display demo program that Chip wrote displays samples of each text color combination.

    For the low resolution VGA display, the color is set on a character by character basis with the same control code followed by a color number from 0 to 15 as in "dsp.out(dsp#Color)", then "dsp.out(color_code)". The default color codes are listed in a comment at the beginning of the OS_vgaLoresTextInit object and can be changed with a control code "SetColor". Again, this is based on Chip's video driver and the demo program for it does display text in different colors.
  • NewzedNewzed Posts: 2,503
    edited 2006-10-09 14:09
    Mike, I studied the vga_hirestext and I came across this line in the COB block:

    Color······ = $13········ ' change the colors of a row (Y, FG, BG follow)

    I finally figured out that Y was row, FG was foreground color and BG was background color.· I won't bore you with the details but after a couple of hours I wrote:

    · text.out($13)
    · text.out(6)
    · text.out(62)
    · text.out(10)
    · text.str(string("B - Red motor Off",13,13))

    and it turned the text string bright blue with the same background as the default.· Then I wrote:

    · text.str(string($13,6,62,10,"B - Red motor Off",13,13))·····

    Same result - pefect.· Exactly what I wanted, but not where I wanted it.

    So....I wrote in the DAT list:

    op4Desc··· byte 13,"' -- ' is the decrement operator, either pre or post.· Let's say X := 10",13,13

    byte $13,3,62,10,"Example of pre-decrement:· Y := --X + 2",13,13

    byte "In this case X is decremented by 1 before the calculation is performed",13

    byte "So...Y := --X + 2 = Y := 9 + 2 = 11.",13,13

    byte "Example of post-decrement:· Y := X-- + 2.",13,13

    byte "In this case, Y := 10 + 2 = 12, and then· X is decremented to 9",13

    byte "In both cases X becomes 9 and retains that value until otherwise changed", 13, 13,0

    and·the red·line changed to bright blue.· I tried to change color on the "post decrement" example but couldn't do it.· I could change it in combination with the previous line but never just by itself.· So finally I wrote:

    op4Desc··· byte 13,"' -- ' is the decrement operator......···········
    byte $13,3,62,10,"Example of pre-decrement:· Y := --X + 2",13,13
    byte $13,5,62,10,"In this case X is decremented by 1 before .....······ byte $13,7,62,10,"So...Y := --X + 2 = Y := 9 + 2
    byte $13,8,62,10,"Example of post-decrement:· Y := X-- + 2.",13,13
    byte $13,10,62,10,"In this case, Y := 10 + 2 = 12, and then..........
    byte $13,11,62,10,"In both cases X becomes 9 and retains........

    and all lines changed to bright blue.· I then deleted the color change from all lines except the example lines.· Both example lines changed color, PLUS the line before the post-decrement example.· Don't understand it.

    have a doctor's appointment.· Will post more when I return.

    Sid
    ·····

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-09 14:28
    In my previous post, I mention some comments in OS_vgaHiresText. Here they are:
    ''    colorPtr = Pointer to 64 words which define the foreground and background
    ''               colors for each row. The lower byte of each word contains the
    ''               foreground RGB data for that row, while the upper byte
    ''               contains the background RGB data. The RGB data in each byte is
    ''               arranged as %RRGGBB00 (4 levels each).
    ''
    ''               color word example: %%0020_3300 = gold on blue
    
    


    '' Control codes.  For convenience, supplying a # cols and # rows of zero will use the maximum
    '' allowable values (screen width - x, screen height - y).  Because of the limitations on colors
    '' (foreground and background for each row only), the Color command will set the colors for a
    '' specific row.  The colors do not scroll with the text.
    
    


    The VGA driver has only limited color capability and a row of text can have only one color pair (foreground and background). The Color command changes the colors of a line when it (the command) is output, not when the actual text is output. I hope this helps.
    Mike
  • NewzedNewzed Posts: 2,503
    edited 2006-10-09 16:16
    To continue, Mike.

    I read the portion you quoted above, but since I don't know what word calls
    up what color, nor how to call the pointer, it didn't really help.· I can make
    things work with the $13 command hopefully, but my question now is - in
    the DAT block, if I put the command at Line 8, why does it change Line 7 also?
    That part bugs me.

    In $13, 8, 62,10 - 62 is the foreground color (bright blue) and 10 is the back-
    ground color (dark blue)· 10 is just what I want for background, but do you
    have a list of what numbers yield what colors for the foreground?· If not,
    I can punch in all the numbers and jot down what color I get.

    Had an idea - changed Line 7 to $13,6,12,10, and left Line 8 alone.· Now Line
    7 changes to a different color and Line 8 changes to bright blue.· If I had the
    color number for yellow (or whatever the default is) I'd have it made.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-09 16:25
    Sid,
    The line number is zero-based as are all positioning commands and it doesn't matter what position the "cursor" is in when you do a "Color" command, the command contains the line number of the line to be affected. Do check out the hires VGA text demo that Chip wrote. I think it does demonstrate a variety of color combinations. I don't have a list of color codes.
    Mike
  • NewzedNewzed Posts: 2,503
    edited 2006-10-09 18:21
    Mike, type this little method into your OS program, call it, and see what
    you get.· Fascinating!

    PUB colorfile
    ··· text.out(0)
    ··· text.out(13)
    ··· text.str(string($13,1,62,10,"Color is 62",13,13))
    ··· text.str(string($13,3,180,10,"Color is 180",13,13))
    ··· text.str(string($13,5,200,10,"Color is 200",13,13))
    ··· text.str(string($13,7,230,10,"Color is 230",13,13))
    ··· text.str(string($13,9,240,10,"Color is 240",13,13))
    ··· text.str(string($13,11,254,10,"Color is 254",13,13))
    ··· text.str(string(13,13,$13,15,254,10,"Press any key to return to Menu",13))
    ··· key.getkey

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2006-10-09 21:15
    Mike, I augmented my colorfile method to include some background color changes.·
    I noticed that when I returned to the Menu screen, the background color changes
    carried over into the Menu screen.· In order to offset this, I had to add the
    following at the end of the colorfile method:

    key.getkey
    ··· text.str(string($13,19,240,10))
    ··· text.str(string($13,21,240,10))
    ··· text.str(string($13,23,240,10))
    ··· text.str(string($13,25,240,10))
    ··· text.str(string($13,27,240,10))
    ··· text.str(string($13,29,240,10))
    ··· start2

    This forced the offending lines back to the default colors, but I was wondering -
    is there a command I could enter just before the ShowMenu method that would
    reset all the rows back to the default color, thus negating the previous color
    changes.· I tried returning to "initialize" instead of "start2" but that did not solve
    the problem.· I can reset and everything goes back to normal but that is not an
    option I want to use.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-09 21:23
    The color table changes are permanent until otherwise changed or the video driver is stopped and restarted. By using text.out, you can set up a loop which would be easier, like this would set all lines to a foreground color of 240 and background color of 10:
    repeat i from 0 to 39
      text.out4($13,i,240,10)
    
    
  • NewzedNewzed Posts: 2,503
    edited 2006-10-09 21:35
    Mike, I had to change i to z because i is used by another method, but it works great.· Thank you.· What is the significance of the "4" following text.out?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-09 21:40
    FOr convenience, there is a set of multiple parameter calls to xxx.out() in the display object. out2(x,y) is defined as out(x), then out(y). Similarly, there's an out3 and out4. They're useful instead of using string() when one of the parameters is not a constant.
  • NewzedNewzed Posts: 2,503
    edited 2006-10-16 13:42
    Mike, I downloaded your revised OS system, extracted everything to a special
    folder, and renamed the keyboard and keyboardinit files to keyboardA and
    keyboardinitA.· Put them in the OBJ block of my current program and now
    all the keyboard lights work great.

    Tried to run your simple Demo but no display - looks like the VGA is never started.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2006-10-19 13:03
    Mike, some of the options in my program produce data on the screen.· Is
    there any way I can simultaneously display this data on Hyperterminal
    where it can be saved to an Excel file - perhaps use the existing "serialout"
    method and change the pin to 31?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-19 13:42
    Sid,
    You could use the existing serialout method. The biggest problem with using the existing serial/USB connection is that, on most boards, DTR transitions always causes a reset and, when Windows or the Mac OS open that serial port, they fiddle with DTR. If you can temporarily disconnect the reset line, then you could usefully use pin 31, otherwise use some other pin with a USB2SER or PropPlug adapter.
    Mike
  • NewzedNewzed Posts: 2,503
    edited 2006-10-19 18:46
    Mike, I sent the data to the Stamp and had Stamp send it to Hyperterminal.·
    Sneaky, eh what?

    Sid



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-19 20:12
    That's a great idea. The Stamp is already RS232 tolerant on the debugging port (16) and, as long as it has enough memory to do the job, is very good at simple serial I/O.

    Mike
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-10-20 17:04
    I just ordered one of Terry Hitt's SDcard reader/writers and am wanting to use it with the Propeller. It uses an RS-232 interface at 19200 baud and has a 32K SRAM buffer.

    Does anyone have any idea if this will easily fit into your Propeller OS scheme?


    Also, I am curious if you ever resolved the lack of a cursor in the opening posting.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-20 18:09
    Kramer,
    I'm trying to integrate another SD reader/writer (the GHI one), but the same code would apply with Terry's except that you can't delete or rewrite a file as far as I can tell. Ask me again in a couple of weeks.
    Mike
  • NewzedNewzed Posts: 2,503
    edited 2006-10-20 22:15
    Mike, do you by any chance have a graphics display program for OS?·
    Something like the Graphics_Demo for TV.

    Sid



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2006-10-21 15:16
    Mike, I wrote the following:

    ·text.str(string($02,j,21,"*",13))
    · text.str(string($02,j,22,"*",13))
    · text.str(string($02,j,23,"*",13))
    · text.str(string($02,j,24,"*",13))
    · text.str(string($02,j,25,"*",13))·

    j = X = a constant 10.· This prints 5 vertical " * " starting at X = 10, Y = 21.
    Is there a way to increment Y a given number of times without having to
    write a separate line for each Y position?· I wrote 21++ and
    that didn't work.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2006-10-21 15:44
    repeat y from 21 to 25
       text.str(string($02,j,y,"*",13))
    
    



    ?
  • NewzedNewzed Posts: 2,503
    edited 2006-10-21 16:15
    Graham, that won't work.· In the MoveXY command:

    $02,X,Y

    X and Y are both constants or a unary value.· It I stick a variable in place of X or Y it won't compile.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2006-10-21 17:38
      repeat y from 21 to 25
        text.out($0A)              'see tv_text out command
        text.out(x)
        text.out($0B)  
        text.out(y)
        text.str(string("*",13))
    
    



    That allows any x,y you like. I'd make a function if I were you set_xy
  • NewzedNewzed Posts: 2,503
    edited 2006-10-21 18:10
    What is $0A and $0B?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
Sign In or Register to comment.