Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
23 May, 2013, 17:16:29 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: rshell - A simple RS232 shell for the Nspire -  (Read 2711 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
compu
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Yesterday at 21:53:16
Date Registered: 09 January, 2011, 22:45:52
Location: Germany
Posts: 226

Topic starter
Total Post Ratings: +53

View Profile
« on: 18 August, 2011, 21:51:12 »
+2

rshell is a command-line interface for Nspire using the RS232 port.

It has the ability to launch ndless executables and pass C's argc and argv to them.

I have included some programs for filesystem operations:

ls - list content of a directory
cp - Copy a file
mkdir - Create a directory
stat - Show size and type of a file
rm - Remove a file (for some reason buggy sometimes)

All these commands are in their own TNS-File that has to be located in /documents/bin or the current directory.

Built-in commands are:

cd - Change directory
exit - Exit rshell

Demonstration:

ls

1
2
3
4
5
6
7
8
9
10
11
12
13
A:\documents\>ls.tns
.\
..\
Examples\
bin\
A:\documents\>ls.tns /
dev\
tmp\
phoenix\
documents\
ti84\
logs\
widgets\

cp

1
2
3
4
5
6
7
8
9
10
A:\documents\>cp.tns
USAGE: cp.tns SOURCE DESTINATION
Copies a file from SOURCE to DESTINATION.
A:\documents\>cp.tns bin/stat.tns copied.tns
A:\documents\>ls.tns
.\
..\
Examples\
bin\
copied.tns

mkdir

1
2
3
4
5
6
7
8
9
10
11
A:\documents\>mkdir.tns
USAGE: mkdir.tns NAME
Creates a directory named NAME.
A:\documents\>mkdir.tns lol
A:\documents\>ls.tns
.\
..\
Examples\
bin\
copied.tns
lol\

stat

1
2
3
4
5
6
A:\documents\>stat.tns
USAGE: stat.tns FILE
Shows stat data for FILE.
A:\documents\>stat.tns copied.tns
Mode: File
Size: 0 KBytes
(Shows 0KB here, because it is smaller than 0.5KB and got rounded down...)

rm

1
2
3
4
5
6
7
8
9
10
A:\documents\>rm.tns
USAGE: rm.tns FILE
Removes the FILE.
A:\documents\>rm.tns copied.tns
A:\documents\>ls.tns
.\
..\
Examples\
bin\
lol\

cd

1
2
3
4
5
6
7
A:\documents\>cd examples
A:\documents\examples\>cd ..
A:\documents\>cd /
A:\>cd phoenix
A:\phoenix\>cd /documents
A:\documents\>cd \
A:\>

* rshell.zip (25.93 KB - downloaded 40 times.)

* rshell.png (82.52 KB, 997x642 - viewed 331 times.)
Logged

Nspire I/O Discussion|Website - cross-compatible with Prizm!
TI-Nspire Programming Statistics
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 15:03:11
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #1 on: 18 August, 2011, 21:52:57 »
0

Looks very nice Smiley
Good job!
« Last Edit: 18 August, 2011, 21:53:15 by jimbauwens » Logged

adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Today at 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197


Total Post Ratings: +185

View Profile WWW
« Reply #2 on: 18 August, 2011, 21:54:12 »
0

This is even more than awesome, really nice indeed !
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
willrandship
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 01:21:23
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2638


Total Post Ratings: +66

View Profile
« Reply #3 on: 18 August, 2011, 21:54:43 »
0

WANT. Also, any chance of integrating such a shell into the nspire without the RS232? Tongue
Logged

compu
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Yesterday at 21:53:16
Date Registered: 09 January, 2011, 22:45:52
Location: Germany
Posts: 226

Topic starter
Total Post Ratings: +53

View Profile
« Reply #4 on: 18 August, 2011, 21:57:06 »
0

WANT. Also, any chance of integrating such a shell into the nspire without the RS232? Tongue
Maybe I can use one of my older projects for on-screen output and keyboard input, it shouldn't be too hard to integrate.
Logged

Nspire I/O Discussion|Website - cross-compatible with Prizm!
TI-Nspire Programming Statistics
willrandship
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 01:21:23
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2638


Total Post Ratings: +66

View Profile
« Reply #5 on: 18 August, 2011, 21:57:48 »
0

yay, because that's been something I've wanted for a while.

Oh, also, if we cp to a non-tns name, will it then not show up in the menu, but still be in the calc? That would rock.
« Last Edit: 18 August, 2011, 21:59:39 by willrandship » Logged

compu
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Yesterday at 21:53:16
Date Registered: 09 January, 2011, 22:45:52
Location: Germany
Posts: 226

Topic starter
Total Post Ratings: +53

View Profile
« Reply #6 on: 19 August, 2011, 07:52:48 »
0

yay, because that's been something I've wanted for a while.

Oh, also, if we cp to a non-tns name, will it then not show up in the menu, but still be in the calc? That would rock.
Yes, files with a non-tns extension will not be shown by the document browser, but you can "hack" the OS Tongue
Logged

Nspire I/O Discussion|Website - cross-compatible with Prizm!
TI-Nspire Programming Statistics
willrandship
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 01:21:23
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2638


Total Post Ratings: +66

View Profile
« Reply #7 on: 20 August, 2011, 07:33:16 »
0

well, of course, but I was thinking it'd be a lot more organized to not see all the roms from gbc4nspire, or all the text files from that one text editor, and only the things we can actually execute in the main menu.
Logged

pianoman
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 20 October, 2011, 04:23:28
Date Registered: 21 May, 2011, 19:13:57
Location: You can know that my current velocity is about 0 m/s.
Posts: 427


Total Post Ratings: +24

View Profile
« Reply #8 on: 21 August, 2011, 02:02:19 »
0

Nice job, compu!
Just one question though: does this require Ndless?
Logged

willrandship
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 01:21:23
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2638


Total Post Ratings: +66

View Profile
« Reply #9 on: 21 August, 2011, 02:13:00 »
0

I'd bet on it: Lua doesn't have any RS232 support as far as I'm aware, so it'd have to be ndless.
Logged

pianoman
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 20 October, 2011, 04:23:28
Date Registered: 21 May, 2011, 19:13:57
Location: You can know that my current velocity is about 0 m/s.
Posts: 427


Total Post Ratings: +24

View Profile
« Reply #10 on: 21 August, 2011, 02:14:17 »
0

Awwwww Sad
Oh well... Still, great job!!! Smiley
Logged

willrandship
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 01:21:23
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2638


Total Post Ratings: +66

View Profile
« Reply #11 on: 21 August, 2011, 06:00:58 »
0

Ndless for 3.0 will come, just wait!
Logged

compu
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Yesterday at 21:53:16
Date Registered: 09 January, 2011, 22:45:52
Location: Germany
Posts: 226

Topic starter
Total Post Ratings: +53

View Profile
« Reply #12 on: 21 August, 2011, 13:33:05 »
0

I'd bet on it: Lua doesn't have any RS232 support as far as I'm aware, so it'd have to be ndless.
Lua has a function to send data via RS232, but you can't receive any data with it. So yes, this requires Ndless.

Ndless for 3.0 will come, just wait!
Lua + C would be awesome Cheesy
Logged

Nspire I/O Discussion|Website - cross-compatible with Prizm!
TI-Nspire Programming Statistics
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Today at 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197


Total Post Ratings: +185

View Profile WWW
« Reply #13 on: 21 August, 2011, 13:36:01 »
0

About that Lua outputting to the RS232 port, it's just a print() actually that outputs stuff to the console, which is actually the serial port
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
willrandship
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 01:21:23
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2638


Total Post Ratings: +66

View Profile
« Reply #14 on: 22 August, 2011, 05:51:00 »
0

so, TI essentially set up the RS232 to be a shell, and ended it at that? Or is it just marked as stdout?

How hard would it be for you to integrate rshell into the calc if there was a way to display whatever went into and out of RS232 on-screen, in a terminal-like fashion? Just curious.
Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.235 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.