Shop OBEX P1 Docs P2 Docs Learn Events
KyeDOS - an operating system for the Propeller — Parallax Forums

KyeDOS - an operating system for the Propeller

Dr_AculaDr_Acula Posts: 5,484
edited 2013-03-19 04:34 in Propeller 1
I thought I would start a new thread for Kyedos rather than hijacking Kye's SD driver thread.

This is Kye's amazing new SD card driver code with a few modifications so it works as an operating system. It is designed to be downloaded to the EEPROM as the core propeller program, from which you can run any other propeller binary file, like playing a movie.

It boots up to a command prompt, and if you type "HELP" it gives the help menu. You can list the directory and run some test commands but the exciting thing is that Kye has greatly speeded up the reboot code, so it is now practical to run other binary files as if they were commands.

As an example, attached is KyeDOS. Now, this almost fills up the memory, and I wanted to add another command to dump out file listings. No problem! I simply wrote a new program called Type (homage to CP/M, but you can rename it to Dump or List or anything if you like). Compile using F8 on the proptool, save it as a binary file, and then rename it ending in .exe. (again, that is not set in stone, and it could be .bin or .com as well).

You can see these command files if you type "dir *.exe" at the command prompt.

Now, just enter "type myfile.txt" or whatever you want to display, and it runs this program, displays the fie, then waits for a keypress, then goes back to KyeDos.

This concept can be extended to any spin program. You can switch video modes easily, or switch from programs that use the keyboard to ones that use the mouse.

Hardware requirements are any board with an sd card. If you don't have a keyboard or vga display, no problem as the program also works via the serial port to any terminal program. There are some values you can enter in the CON section to disable things - eg I would imagine almost everyone would disable the 20x4 LCD as this is using the Dracblade driver. VGA and keyboard are the standard demoboard pinouts, so to get this working all you may need is an sd card and a few 10k pullup resistors.

For those that have been following KyeDOS for a while, the big change here is the speed improvement.

Suggestions and input would be most appreciated. Any help adding more commands would also be most welcome.
«1

Comments

  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-01-15 16:57
    Brilliant! You guys are geniuses.
  • KyeKye Posts: 2,200
    edited 2011-01-15 20:46
    I wish I had time to support your efforts with this.

    Thanks,
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-01-16 02:03
    I have the earlier KyeDos as the launch of the Z80 emu's.

    Every time the speed gets increased I find that the layout distances get more and more fussy, and less and less of my mottly SD card collection want to play nice.

    You are not being sponsored by SanDisk are you ???
  • SapiehaSapieha Posts: 2,964
    edited 2011-01-16 02:19
    Hi Toby.

    I had much wire length issues on SD card's before I added in that case one100nF one 10uF caps as near SD as possible --- and to that Resistors NOT only on used signal pins but on all pins SD use as signals even them not used in Propeller type connection.

    I have the earlier KyeDos as the launch of the Z80 emu's.

    Every time the speed gets increased I find that the layout distances get more and more fussy, and less and less of my mottly SD card collection want to play nice.

    You are not being sponsored by SanDisk are you ???
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-01-16 02:47
    Hi Sapieha

    I tried all of that, a while ago, on a project. I even found that sticking freezer spray on the Prop could tip the balance as to whether the SD ran or not.

    The last go with a modified Dracblade (the one built into a keyboard) I got away with pull ups on all four lines but at the Prop end of the wires rather than the SD end, the wires were about 10 cm long but widely spaced. There is a 0.1uF and a 10uF (SMs) at the PCB edge, again not quite at the SD.

    I think that the real problem is that I use such a rag-tag bunch of cards.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-16 02:49
    The latest dracblade has all the things Sapieha has suggested. The wire length is not more than 3cm as the card is on the closest corner of the propeller to the pins.

    On the plus side, Kye's latest code works with more of my SD cards than before. In fact, all of them.
  • SapiehaSapieha Posts: 2,964
    edited 2011-01-16 02:59
    Hi Toby.

    One thing are important 10uF else bigger On SD side as close it as possible. You need think it is one PIC MCPU on board of SD with inbuilt XTal and for stable functioning as all other oscillators it need stable Voltage (Not possible on big length wires.) You need consider that SD even Voltage to write to it that need be stable THAT give with start of writing Voltage fail on entire SD and capacitor are for give it this little time Voltage need to stabilize.
    Hi Sapieha

    I tried all of that, a while ago, on a project. I even found that sticking freezer spray on the Prop could tip the balance as to whether the SD ran or not.

    The last go with a modified Dracblade (the one built into a keyboard) I got away with pull ups on all four lines but at the Prop end of the wires rather than the SD end, the wires were about 10 cm long but widely spaced. There is a 0.1uF and a 10uF (SMs) at the PCB edge, again not quite at the SD.

    I think that the real problem is that I use such a rag-tag bunch of cards.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-01-16 03:07
    I have one that is only 8MB MMC, that must be close to an original !!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-18 15:20
    Hi Toby, I have a 16mb sd card but it is the only one I own that does not work. I've been mainly using 512k and 1gig as they are at a sweeter price spot than bigger cards.

    *** New program added - Xmodem for file transfers. ***

    I have also modified KyeDOS so that it does not send anything out of the serial port when running an external program, as this was upsetting xmodem.

    Xmodem has been tested at 115200 baud, and not all terminal programs can handle this. Teraterm gives occ errors at 38400 and does not work faster than this. Shamcom works talking to the board but does not include xmodem. But Hyperterminal works. Set up for 115200 baud and select "none" for file transfer protocol.

    One feature this demonstrates is the simplicity of command line parameters in Kyedos. For xmodem type

    XMODEM R MYFILE.TXT

    where xmodem is the .exe file to run, R is for Receive (or S for Send) and then the name of the file. The xmodem program then extracts out the parameters.

    You need to do this in the right order eg run xmodem first on kyedos, and then use the terminal program to send the file.

    For files up to about 50k, it is faster to use xmodem. For larger files, it is generally quicker to remove the sd card and copy directly. Don't forget to hit the reset button when reinserting a card that has been removed so Kyedos can reinitialise the sd card.

    In themselves, these programs are not very exciting. However, they demonstrate the concept of getting around the memory limitation of the propeller by splitting things up into manageable pieces.

    Xmodem's main use is from within a custom IDE that I am working on that can edit Spin, Pasm and C, both separately and hybridised together. It's most immediate application will be as a way of getting large external memory C programs onto an sd card.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-01-30 16:48
    Hmmm... Something missing here.... Can't quite put my finger on it....

    Oh... Yeah... TV... ;)

    http://dl.dropbox.com/u/7557533/shared/KyeDOS3_withTV.zip

    Here's a slightly patched copy of KyeDOS using a modified AIGeneric driver.
    I've tried not to touch the DOS itself too much so that it maintains compatibility.

    I'll pretty it up a bit more later, but if you've been using PropDOS, this is a definite upgrade.

    OBC
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-30 17:09
    OBC - that is fantastic!

    I didn't add TV because I don't have one (my little LCD cheapie won't synch, and I can't boot the kids off my real TV long enough to test it).

    So have you added a text driver? How many characters in a line? (If it is less than 80, might need to change a few bits of code so things line up ok).

    Is there a new "main" code with TV added?

    Just thinking about the changes which would be in these lines (all display text goes out through these two lines, which simplifies adding another display driver)
    PUB PrintString(pstring)' sends pstring to the vga and serial port with no CRLF
        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 (_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   
    
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-01-30 17:58
    The TV driver is 40x24. I'm detecting the cursor position in the text driver itself and sending a CR at the end of the screen-line. This keeps me from having to make changes to your core code.

    The only thing I added to the core code was an entry in OBJ and a videopin line.

    OBC
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-30 18:18
    40 should be fine for using Kyedos. I suspect the only thing that might be a bit messy is the text that prints out when you type "help". There is a lot of text - maybe split it over two pages and ask the user to hit any key to get the next screen?

    But for using this, it will be fine as you generally type a command to run another binary.

    Thanks for coding this!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-01-30 19:14
    I see a feature I really want. How about storing the {directory} path in COMMAND.TXT so that compatible programs can jump to the same folder the command was issued?

    OBC
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-01-30 19:56
    @Dr_A

    Do you have any problem with your code being forked a little? I'd like to do some serious mucking around in KyeDOS, but I don't want to step on any toes.

    OBC
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-30 20:09
    Change it all you like!

    I don't think it would be 'forking' as you would be adding things in. The directory structure for instance sounds a great idea.

    Hopefully by adding the TV stuff you won't run out of memory. And if you do, we can always go to BST and check that box that says 'don't compile unused spin methods'

    I look forward to seeing what you add. If you post it here then that can be the latest version. I'll just do a quick check to make sure it is backwards compatible. Maybe make it version 4 and add your changes to the comments section?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-09-01 06:46
    I know that this may be asking too much, but it is worth asking.

    Is anyone working on an executable DOS file that would load binary code to one or more cogs from an SDcard? It may be a huge step, but it would likely be a very worthwhile one.

    I looked through KyeDOS 3.0 as presented herein and it seems to be oriented entirely toward reading and writing data at this point.
  • SeekerSeeker Posts: 58
    edited 2011-09-01 19:30
    I know that this may be asking too much, but it is worth asking.

    Is anyone working on an executable DOS file that would load binary code to one or more cogs from an SDcard? It may be a huge step, but it would likely be a very worthwhile one.

    I looked through KyeDOS 3.0 as presented herein and it seems to be oriented entirely toward reading and writing data at this point.

    I am confused. The question you ask is the problem that this solves. You can load an entire startup image for the onboard memory, and then read and write to replace that as needed. Even bits and pieces if you don't want to wait for an entire new full memory replace. You can even replace code in individual cogs on demand. To be honest, this was one of my first questions, and I got a pretty good answer, but I had to figure out how to make it work in my situation. Each O/S (that we create on top of DOS) is different and has different needs.

    Oh, and hi everyone. Nice to see you all again.... been away doing other things. You know, real life Smile. Now I have another prop project. Ironically it uses 4 actual propellers. The round spinning kind. ;)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-09-01 19:42
    Is anyone working on an executable DOS file that would load binary code to one or more cogs from an SDcard? It may be a huge step, but it would likely be a very worthwhile one.

    I am fairly sure that the cogs keep running when kyedos does a reboot so you could have one program that loads up some cogs, then reboot with a different program that loads different cog code.

    There is certainly code in C to do what you want - I call them 'cogjects' but they have other names as well. I wrote about 10 of these by taking existing spin obex code, translating the spin part to C and then separating out the pasm part. The pasm part becomes an array in XMM C which sits in high memory, and you can load it in and out of the cogs from within software. Mouse, keyboard and some displays have been translated.

    You can store the cog code within a C program or store it as a file on an SD card - it does not matter.
  • tingotingo Posts: 87
    edited 2011-10-08 13:32
    I have unzipped the KyeDOS3 archive on a Ubuntu machine. But why are some files this strange format:
    tingo@kg-home:~/work/prop/kyedos$ file *REA*
    _README_.txt: Little-endian UTF-16 Unicode text, with CRLF line terminators
    tingo@kg-home:~/work/prop/kyedos$ less _README_.txt
    "_README_.txt" may be a binary file.  See it anyway? 
    
    And, more important, how do I read them? less or mousepad isn't able to make the contents readable.
  • tingotingo Posts: 87
    edited 2011-10-08 15:05
    OK, I got KyeDOS working (bstc works under Linux, 32-bit at least, and Loader.py works for uploading code). I was a little surprised that a ps/2 keyboard is still needed, even if I am running via the serial port. But I guess input from the serial port hasn't been implemented yet?

    BTW, KyeDOS is nice. Thanks! :)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-08 17:03
    Kyedos is written so it can accept input from either keyboard or the serial port.
          repeat
            if key.gotkey <>0        ' scan both the local keyboard and the com port
              result:=key.getkey
            if sio.rxavail(0)
              result :=sio.rx(0)  
          until result <>0           ' until something comes in either port
    

    and it outputs to the serial port, to the display and to the 20x4 LCD (if you have that connected).

    There is the VGA version, and Jeff Ledger rewrote it for a TV screen as well. Which screen are you using?

    When you get CP/M working, you can compile it and copy the binary onto the SD card and then run it from Kyedos. I have several versions on the sd card, eg CPMTV.EXE and CPMVGA.EXE. In fact, pretty much any spin program can be put on your SD card - just rename them from .binary to .exe
  • tingotingo Posts: 87
    edited 2011-10-08 17:55
    Dr_Acula wrote: »
    Kyedos is written so it can accept input from either keyboard or the serial port.
    and it outputs to the serial port, to the display and to the 20x4 LCD (if you have that connected).
    Well, for some reason, KyeDOS will not accept input from the serial port here. Input from the ps/2 keyboard works fine. Output to the serial port works fine. Can't say anything about VGA or TV output, as I haven't tried that yet.
    Dr_Acula wrote:
    There is the VGA version, and Jeff Ledger rewrote it for a TV screen as well. Which screen are you using?
    I'm using a serial port. BTW, I got the KyeDOS archive from the first post in this thread.
    Dr_Acula wrote:
    When you get CP/M working, you can compile it and copy the binary onto the SD card and then run it from Kyedos. I have several versions on the sd card, eg CPMTV.EXE and CPMVGA.EXE. In fact, pretty much any spin program can be put on your SD card - just rename them from .binary to .exe
    I tried compiling cp/m with bstc, but got an error message (more on that at a later time).
    So I tried with cpm.binary from the Spin-Archive-28-Aug-2010.zip file, renamed it cpm.exe and put it on the SDcard. On that card I also put the .DSK files from the Disk-archive-28-Aug-2010.zip file. It looks like this:
    *** KyeDOS SD card operating system v3.01 by Kwabena W. Agyeman & J. Moxham ***
    Type Help for command listing
    >dir
    
    DCIM         TRASHE~1     TYPE.EXE     XMODEM.EXE   P8X32A.TXT   CPM.EXE      
    C.DSK        BOOT.DSK     B.DSK        A.DSK        COMMAND.TXT  
    
    >
    
    But when I start cp/m, this is what I get:
    >cpm
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
    
    Too tired now, will test more tomorrow.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-08 18:27
    I'll post a reply on the dracboard thread.
  • tingotingo Posts: 87
    edited 2011-10-08 18:30
    tingo wrote: »
    Well, for some reason, KyeDOS will not accept input from the serial port here. Input from the ps/2 keyboard works fine
    OK, I figured out the problem (I should have thought of it earlier). I used stty to check the settings on my serial device:
    tingo@kg-u35jc:~$ stty -F /dev/ttyUSB0 -a
    speed 115200 baud; rows 0; columns 0; line = 0;
    intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^A; eol = <undef>; eol2 = <undef>;
     swtch = <undef>; start = ^Q;
    stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 1;
    -parenb -parodd cs8 hupcl -cstopb cread -clocal crtscts
    -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff -iuclc -ixany
     -imaxbel -iutf8
    -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
    -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl
     -echoke
    
    the crtscts part says that rts/cts handshaking is on, which won't work for this situation. So I turn it off with:
    tingo@kg-u35jc:~$ stty -F /dev/ttyUSB0 -crtscts
    
    and now input from serial port works in KyeDOS. :-)
  • TorTor Posts: 2,010
    edited 2011-10-09 09:09
    tingo wrote: »
    I have unzipped the KyeDOS3 archive on a Ubuntu machine. But why are some files this strange format:
    tingo@kg-home:~/work/prop/kyedos$ file *REA*
    _README_.txt: Little-endian UTF-16 Unicode text, with CRLF line terminators
    tingo@kg-home:~/work/prop/kyedos$ less _README_.txt
    "_README_.txt" may be a binary file.  See it anyway? 
    
    And, more important, how do I read them? less or mousepad isn't able to make the contents readable.
    Some of the files (including README) in propeller software appears to be UTF. UTF-8 is normally not a problem, but I too have problems with UTF-16.. I'm not sure why it's used (possibly for some of those special font characters), I write everything in ASCII and it seems to work fine with BST/BSTL.

    After some trial and error I found that the 'kate' editor from the KDE project can display those files.

    -Tor
  • jazzedjazzed Posts: 11,803
    edited 2011-10-09 09:50
    Tor wrote: »
    Some of the files (including README) in propeller software appears to be UTF. UTF-8 is normally not a problem, but I too have problems with UTF-16.. I'm not sure why it's used (possibly for some of those special font characters), I write everything in ASCII and it seems to work fine with BST/BSTL.

    After some trial and error I found that the 'kate' editor from the KDE project can display those files.

    -Tor
    Parallax font drives me crazy. Some folks like it.
    Use iconv to fix files: $ iconv -f UTF16 -t ASCII -c foobar.spin
  • TorTor Posts: 2,010
    edited 2011-10-09 11:09
    @jazzed: Thanks for that tip, that's very useful to know.

    -Tor
  • TorTor Posts: 2,010
    edited 2011-10-10 03:05
    Back to those UTF-16 fonts.

    I now despise those fonts. It completely ruins the possibility to properly version control the source code. You can't do a 'diff' to get line changes. It's back to the seventies, before software version control. And why are those UTF-16 fonts used? It seems to be only to make lines in between sections, and around the MIT license comment section in some files! Whereas there are perfectly good ASCII characters to do the same, if you really want to. ASCII or UTF-8 will do fine.

    So now, before I import anything into a Git repo (for example), I have to use 'iconv' to convert the files. But then the lines which should have been ordinary '----' or '====' or '____' in the first place disappears.

    I humbly suggest to everybody that when you upload something into e.g. OBEX that you use '___' or something, and not those UTF-16 fonts.. it'll make it much easier for you too, because people can then create proper diffs and send patches.

    -Tor
  • tingotingo Posts: 87
    edited 2011-10-12 12:54
    jazzed wrote: »
    Use iconv to fix files: $ iconv -f UTF16 -t ASCII -c foobar.spin
    Thanks!
    In Ubuntu iconv by default outputs to stdout. To fix that, I used this variation:
    $ mv Keyboard.spin oKeyboard.spin
    $ iconv -f UTF16 -t ASCII -c oKeyboard.spin -o Keyboard.spin
    
    Very useful.
Sign In or Register to comment.