A project to implement a console using the Mbed using VGA for video output and a PS/2 keyboard for the input. The eventual goal is to also include tools for managing SD cards, and a semi-self-hosting programming environment.
Dependencies: PS2_MbedConsole fastlib SDFileSystem vga640x480g_mbedconsole lightvm mbed
MbedConsole is a cool little project to have a self-contained computer all on an Mbed. So far it has VGA and PS/2 support and can stand alone without a computer powering it. Next planned features are SD card support and a lightweight programmable VM complete with a file editor and self-hosted assembler.
You can view additional details about it at http://earlz.net/tags/mbedconsole
Revision 2:e2a4c5d17d59, committed 2012-09-17
- Comitter:
- earlz
- Date:
- Mon Sep 17 04:45:10 2012 +0000
- Parent:
- 1:eb209f0468de
- Child:
- 3:2bc2b0dce10e
- Commit message:
- Has a rudimentary shell. A good starting point until PS/2 breakout boards come in
Changed in this revision
mbedconsole.h | Show annotated file Show diff for this revision Revisions of this file |
shell.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/mbedconsole.h Mon Sep 17 04:41:37 2012 +0000 +++ b/mbedconsole.h Mon Sep 17 04:45:10 2012 +0000 @@ -1,20 +1,21 @@ -#ifndef MBEDCONSOLE_H -#define MBEDCONSOLE_H - -#include "mbed.h" -#include "vga640x480g.h" - -void vputc(char c); -void vputs(char *s); -char vgetc(); -int vgetsl(char *s, int len); - -int strlcmp(const char *s1,const char *s2,size_t count); - -void shell_begin(); - -extern Serial serial; - - - +#ifndef MBEDCONSOLE_H +#define MBEDCONSOLE_H + +#include "mbed.h" +#include "vga640x480g.h" + +void vputc(char c); +void vputs(char *s); +char vgetc(); +int vgetsl(char *s, int len); +void vsetcursor(int x, int y); + +int strlcmp(const char *s1,const char *s2,size_t count); + +void shell_begin(); + +extern Serial serial; + + + #endif \ No newline at end of file
--- a/shell.cpp Mon Sep 17 04:41:37 2012 +0000 +++ b/shell.cpp Mon Sep 17 04:45:10 2012 +0000 @@ -8,7 +8,6 @@ vputs("> "); vgetsl(cmd, 128); vputc('\n'); - vputs(cmd); valid=false; if(strlcmp(cmd, "help", 5)==0){ valid=true; @@ -18,9 +17,11 @@ }else if(strlcmp(cmd,"cls",4)==0){ valid=true; vga_cls(); + vsetcursor(0,0); }else if(strlcmp(cmd,"test", 5)==0){ - - vputs("Opening File...\n"); // Drive should be marked as removed + valid=true; + vputs("Opening File...Screen may flicker!\n"); // Drive should be marked as removed + wait(5); FILE *fp = fopen("/local/test.txt", "w"); if(!fp) { vputs("File /local/test.txt could not be opened!\n");