Author Topic: PShell on Raspberry Pi Pico (RP2040)  (Read 539 times)

0 Members and 1 Guest are viewing this topic.

Offline WillTurnerTopic starter

  • Contributor
  • Posts: 49
  • Country: au
PShell on Raspberry Pi Pico (RP2040)
« on: July 22, 2023, 07:31:36 am »
Has anybody (else) yet had a play with PShell?

This is a C compiler with vi and some simple commands running in a shell over a serial link.
All on the RP2040, with access to the Pico SDK, and a small littlefs file system.
 
Hence, "self-hosting" in the same kind of way that MMBasic can be on the Pico.
The experience is very similar to the edit-run-debug cycle of Basic. Wow!

This appeals to me because I can downclock the RP2040 to 48MHz. and it draws about 10mA. But I can develop code in-situ.

 https://github.com/lurk101/pshell
 
The following users thanked this post: MK14, I wanted a rude username

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 696
  • Country: us
Re: PShell on Raspberry Pi Pico (RP2040)
« Reply #1 on: July 22, 2023, 08:15:02 am »
Interesting. What appeals to you about using the console vs. hitting the run button in an IDE, like VS Code?
 

Offline WillTurnerTopic starter

  • Contributor
  • Posts: 49
  • Country: au
Re: PShell on Raspberry Pi Pico (RP2040)
« Reply #2 on: July 22, 2023, 11:24:00 am »
  Thanks for asking :). That's what I'm trying to work out.

  Low power has a lot to do with it. And there is a huge nostalgic element. Add a dash of PDP-11 envy, and a desire to get down to the bare metal in a relatively painless way. Once the system is installed and running, many complications are eliminated - No toolchains, complicated development environments, heck, a dumb ASCII terminal allows me to get into the hardware with ... no laptop as a host. The feel of the thing is ... hard to describe.
  The idea of running Linux on RP2040 isn't really practical (Fuzix is part way there I suppose). So this is the next best minimalist kind of self hosting operating system. If RP2040 can be considered "embedded", then this environment would be like the leap from Basic in ROM systems to something like UCSD Pascal.
   
  I should mention a few shortcomings.

  No C pre-processor. No linker. One flat source file. But, access to the Pico SDK.

  LittleFS file system, small relative to Linux capable systems.

  At this stage, no SD Card support, or VFAT on a card. So upload/download of files using XModem.

  Anyway, if you are at all interested in this kind of thing, give it a whirl. If nothing else, it is a lot of fun. 
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7902
  • Country: nl
  • Current job: ATEX product design
Re: PShell on Raspberry Pi Pico (RP2040)
« Reply #3 on: July 22, 2023, 11:28:06 am »
Wait a minute. So it compiles the code for the Pico on the Pico?
 

Offline WillTurnerTopic starter

  • Contributor
  • Posts: 49
  • Country: au
Re: PShell on Raspberry Pi Pico (RP2040)
« Reply #4 on: July 22, 2023, 11:36:06 am »
Yes, there is a stripped down shell with ls, cp, mv style commands, but especially a version of the vi editor. Create a source code file, then "cc srcfile.c" compiles and executes. Ctrl-C halts, and returns to the shell prompt. Documentation looks scant, but the source code for everything is there, and looks small enough to print out and peruse. (Read the source Luke). Kudos to the author(s)!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf