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
mbedconsole.h@11:fede136943a9, 2012-09-28 (annotated)
- Committer:
- earlz
- Date:
- Fri Sep 28 04:03:54 2012 +0000
- Revision:
- 11:fede136943a9
- Parent:
- 9:4211d638b2e9
- Child:
- 13:442bd2fb4ea0
Finally have keyboard support, AND it plays nice with VGA
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
earlz | 2:e2a4c5d17d59 | 1 | #ifndef MBEDCONSOLE_H |
earlz | 2:e2a4c5d17d59 | 2 | #define MBEDCONSOLE_H |
earlz | 2:e2a4c5d17d59 | 3 | |
earlz | 2:e2a4c5d17d59 | 4 | #include "mbed.h" |
earlz | 2:e2a4c5d17d59 | 5 | #include "vga640x480g.h" |
earlz | 9:4211d638b2e9 | 6 | #include "PS2Keyboard.h" |
earlz | 2:e2a4c5d17d59 | 7 | |
earlz | 2:e2a4c5d17d59 | 8 | void vputc(char c); |
earlz | 2:e2a4c5d17d59 | 9 | void vputs(char *s); |
earlz | 2:e2a4c5d17d59 | 10 | char vgetc(); |
earlz | 2:e2a4c5d17d59 | 11 | int vgetsl(char *s, int len); |
earlz | 2:e2a4c5d17d59 | 12 | void vsetcursor(int x, int y); |
earlz | 2:e2a4c5d17d59 | 13 | |
earlz | 2:e2a4c5d17d59 | 14 | int strlcmp(const char *s1,const char *s2,size_t count); |
earlz | 2:e2a4c5d17d59 | 15 | |
earlz | 2:e2a4c5d17d59 | 16 | void shell_begin(); |
earlz | 2:e2a4c5d17d59 | 17 | |
earlz | 9:4211d638b2e9 | 18 | extern PS2Keyboard *ps2kb; |
earlz | 3:2bc2b0dce10e | 19 | |
earlz | 3:2bc2b0dce10e | 20 | |
earlz | 3:2bc2b0dce10e | 21 | |
earlz | 2:e2a4c5d17d59 | 22 | extern Serial serial; |
earlz | 2:e2a4c5d17d59 | 23 | |
earlz | 2:e2a4c5d17d59 | 24 | |
earlz | 9:4211d638b2e9 | 25 | class ConsoleStream : public Stream //do this so we get printf and other goodies. Uses C functions for VGA and PS/2 |
earlz | 9:4211d638b2e9 | 26 | { |
earlz | 9:4211d638b2e9 | 27 | public: |
earlz | 9:4211d638b2e9 | 28 | ConsoleStream(){} |
earlz | 9:4211d638b2e9 | 29 | protected: |
earlz | 9:4211d638b2e9 | 30 | |
earlz | 9:4211d638b2e9 | 31 | // Stream implementation functions |
earlz | 9:4211d638b2e9 | 32 | virtual int _putc(int value) |
earlz | 9:4211d638b2e9 | 33 | { |
earlz | 9:4211d638b2e9 | 34 | vputc((char)value); |
earlz | 9:4211d638b2e9 | 35 | return 1; |
earlz | 9:4211d638b2e9 | 36 | } |
earlz | 9:4211d638b2e9 | 37 | virtual int _getc() |
earlz | 9:4211d638b2e9 | 38 | { |
earlz | 11:fede136943a9 | 39 | return vgetc(); |
earlz | 9:4211d638b2e9 | 40 | } |
earlz | 9:4211d638b2e9 | 41 | }; |
earlz | 9:4211d638b2e9 | 42 | |
earlz | 9:4211d638b2e9 | 43 | extern ConsoleStream console; |
earlz | 9:4211d638b2e9 | 44 | |
earlz | 2:e2a4c5d17d59 | 45 | |
earlz | 1:eb209f0468de | 46 | #endif |