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

Files at this revision

API Documentation at this revision

Comitter:
earlz
Date:
Mon Sep 17 03:25:23 2012 +0000
Child:
1:eb209f0468de
Commit message:
Made it do something

Changed in this revision

fastlib.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
vga640x480g.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fastlib.lib	Mon Sep 17 03:25:23 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Ivop/code/fastlib/#bc492a93e116
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 17 03:25:23 2012 +0000
@@ -0,0 +1,82 @@
+#include "mbed.h"
+#include "vga640x480g.h"
+
+#define FONTHEIGHT 16
+#define FONTWIDTH 8
+
+int console_x=0, console_y=0;
+int console_color=WHITE; //text color
+
+DigitalOut myled(LED1);
+
+Serial serial(USBTX,USBRX);
+
+void rawputc(char c)
+{
+    //fuck that shitv
+    if(console_x>80)
+    {
+        return;
+    }
+    //shift left for fast multiply
+    vga_putchar(console_x<<3, console_y<<4, c, console_color);
+}
+void putc(char c)
+{
+    //shift left for fast multiply
+    if(console_x>=79)
+    {
+        console_x=0;
+        console_y++;
+    }
+    switch(c){
+        case '\n':
+        case '\r':
+        console_y++;
+        console_x=0;
+        break;
+        case '\b':
+        rawputc(' ');
+        if(console_x>0)
+        {
+            console_x--;
+        }
+        rawputc(' ');
+        break;
+        case '\t':
+        for(int i=0;i<4;i++)
+        {
+            console_x++;
+            rawputc(' ');
+        }
+        default:
+        vga_putchar(console_x<<3, console_y<<4, c, console_color);
+        console_x++;
+    }
+}
+
+/*void puts(char *s){
+    while(*s!=0){
+        char c=*s;
+        switch(c)
+            case '\n':
+            case '\r':
+            console_x=0;
+        vga_putchar(console_x,console_y,*s,console_color);
+    }
+*/
+
+int main() {
+    init_vga();
+
+    serial.baud(115200);
+    
+    vga_cls();
+    
+    while(1)
+    {
+        if(serial.readable()){
+            putc(serial.getc());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 17 03:25:23 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vga640x480g.lib	Mon Sep 17 03:25:23 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/gertk/code/vga640x480g/#89bf087ed9cd