close-circle
Close
0%
0%

Arduino Desktop

The desktop with an arduino as the main processor. Multitasking, Gaming, Graphics, and (later) File IO

Similar projects worth following
close
Want to have a computer in your pocket other than a RPi, and easily write an OS for it? Here is the answer. An OS + the hardware for a desktop using an arduino. Oh, and a Terraria clone. ON AN ARDUINO MEGA.

Hardware Specs:

  • NGT20 graphics
  • keyboard
  • Ethernet
  • SD card support
  • Extra 32KB parallel SRAM using an awesome shield

Goals:

  • File System
  • Programs for Files (Editing, executing, displaying...)
  • Shell (Obviously)
  • daemon for displaying RAM usage (right side of screen)
  • Task Manager
  • Terra (Like Terraria)

There are two software versions. One is an emulator and the other is a hard coded OS.  The hard coded one has two repos, for the older and newer versions.

as.py

Assembler for Some-CPU-I-haven't-named-yet (SCIHNY)

plain - 9.56 kB - 05/23/2017 at 04:22

download-circle
Download

server_boot.py

Distributes bootcode for those of us without SD card support in our computers (like myself)

plain - 940.00 bytes - 05/23/2017 at 04:22

download-circle
Download

mmc_assemble.py

This seems to work. For MMC CPU architecture. Use Python 3. I no longer am using MMC for this project

plain - 9.15 kB - 04/29/2017 at 03:04

download-circle
Download

mmc_compile.py

Not sure this works. PYTHON 3!!! No longer used.

plain - 5.91 kB - 04/29/2017 at 03:04

download-circle
Download

SomeStuff.h

Need this - it goes with NGT20_GUI_Computer.ino I am now using an emulator so this isn't used.

plain - 2.61 kB - 04/15/2017 at 07:31

download-circle
Download

View all 6 files

  • More alphabets and where the project is going

    Dylan Brophy08/13/2017 at 20:36 3 comments

      I love language so I decided to add some new alphabets.  I added the characters in the Cyrillic alphabet that are used in Russian, plus the characters from an alphabet I made up for fun a while back.

      Now I can print with more characters:

      On top: Hello World!

      On bottom: Hello (Informal)

      Benefits:

      1. more alphabets
      2. smaller text (so more can fit on the screen)
      3. adjustable character length

      Drawbacks:

      1. Slower loading and displaying
      2. Only white characters are supported - no green or red
      3. can't really mix with Latin alphabet due to size and interface differences

      I also ported a simple game I made for the ATmega328p a few years back:

      Other than those things, however, my project is so far somewhat useless.  The biggest drawback is that it isn't currently possible to execute some generic program:  all must be hard coded into the OS (essentially).  Well, I remember a while back reading that Java had been ported to AVR - uJ.  Adding this and enabling Ethernet would allow community made programs to be downloaded and executed to the Arduino Desktop without the aid of another computer.  Not that it has a community - but you hopefully get the point.  Java enables a useful stand alone system.  Also, since I have the extra 32KiB RAM I have more room for programs, plus graphics and keyboard....  Soon hopefully Ethernet and SD support too.

  • void system(char* input){ ... }

    Dylan Brophy08/01/2017 at 20:40 0 comments

    C++ has this function, system(), that executes a command.  If I want a command line for my arduino computer, I might as well implement this function.

    My friend, @Andrey Skvortsov, sent me an arduino shield that makes the arduino a ton more powerful.  It adds 32KB of SRAM, but its parallel, not serial.  Furthermore it maps directly into the AVR address space, so you don't have to manipulate pins.  Its basically an extra 32KB blazing fast SRAM addition for the Arduino MEGA.  I have barely used it to any potential, but I have begun making memory allocation functions and such for it, so I can go farther.  My system function actually uses the shield, and removing the shield breaks the system() function.  SO the shield works!  See that project here: #Arduino MEGA 2560 32Kb RAM shield 

    I had the arduino auto-execute these commands:

    sudo
    sudo -f
    terminate 0
    lsps

    Output:


    The sudo command is like linux : get elevated permissions.  I added sudo -f, f as in FORCE.  Basically force events to occur where possible.  So the "Self-hacking ENABLED" is from sudo -f.  terminate 0 : terminate process 0 (but there was no process, so we get error bad PID).  lsps is LiSt ProceSses.  It said "0 processes:", because no processes were executing.

    Now I am working on a terminal and will add more commands later.  Terminal, for now, will block all other processes until exit.  Multitasking terminals, as I have discovered, aren't the easiest.

  • Progress of new architecture and File System work

    Dylan Brophy05/20/2017 at 23:38 0 comments

      I took a break from this project for a while, but I have come back. I have a basic terminal with one command working, along with a file system. The terminal has only a help command that prints a string on the screen. I have working file IO now. File IO works kinda.... different. Basically instead of accessing the SD card directly by the emulated CPU in the Arduino, the SD library's functions are mapped to the CPU's emulated hardware IO. This does a few things:

      1. Makes there no need for a complex file system driver
      2. SD card library functions are faster because they are not run on an emulator
      3. I don't have to find a way to directly read/write bytes on the SD card

      Think of it like having a filesystem driver (software) mapped to your CPU's hardware IO.

      I will do something similar for network access. So that my OS can download updates to the SD card.

  • New (And superior) CPU architecture

    Dylan Brophy05/18/2017 at 03:42 0 comments

    I'm pretty much no longer going to use the old MMC architecture. I now have a simpler, faster, and generally better CPU architecture I designed. I will also use it for my FPGA computer. Most instructions are one or two bytes, as opposed to my older architectures that took WAY too many. It's still WIP, but it has run on the Arduino Desktop and works well in place of the MMC architecture.

  • Network Boot for MMC Emulator

    Dylan Brophy05/04/2017 at 04:43 0 comments

    Video Explains All

    Basically I made the MMC emulator be able to download a binary image from the internet to boot from. SUPER COOL! In my opinion :D

  • Playing with some older ideas

    Dylan Brophy04/29/2017 at 04:55 0 comments

    I decided to try porting an ancient emulator I wrote to my Arduino Desktop. A while ago I built what I call the MMC. It has nothing to do with MMC cards, MMC stands for Modular Mega Computer. It was pretty cool, except low specs (not enough disk space, too difficult to program, and bad graphics) made it quickly useless. The best part about it however was the MMC Processor design. This was a 16-bit CISC processor that is probably the best processor design I ever made - and has the absolute WORST documentation.... I stumbled upon the assembler I wrote for it, and decided to look for the Arduino file. I knew its name stated with computer, but that's not too helpful because I literally polluted my arduino sketchbook with files like "Computer_1", "Computer_2", "Computer_160512", or whatever. After looking through a few files I found it.

    After porting it and fixing some weird problems with the assembler I got it to run on my mostly unmodified arduino desktop. All I added was a new Seeed studio Ethernet shield V2, which I don't intend on removing. I also redesigned it to boot from a SD card, instead of a parallax SmartCard like before.

    I got a hello world program to boot if the SD card couldn't be booted, so everything is working so far! SD card won't boot right though - Always there is an Invalid Opcode Error.

    I will continue testing to see if I want to switch to my MMC architecture, or keep my Arduino Multitasking OS. I must admit, MMC is very tempting...

  • Terra now has entities to fight - and low RAM

    Dylan Brophy04/16/2017 at 09:05 10 comments

    I added this creepy character inspired - again - by Terraria that follows the player around, then comes down and attacks. Easy to kill (for now) and only one. OS is good as ever but RAM is running low. I really should optimize. What I need is dynamic memory allocation. Well, here is a video on my Terra progress:

    The internet seems to think that arduino memory allocation functions (malloc/free etc) dont work well. Is this true? Any alternatives?

  • Terra graphics issues - resolved

    Dylan Brophy04/15/2017 at 07:39 0 comments

    While making the game Terra (a clone of Terraria for Arduino) I realized the graphics were drawing way too slowly. This is a problem I commonly find in anything that draws graphics from an arduino. The problem was that rendering each block was very slow. My solution was to tessellate the blocks by finding rows of the same blocks and filling them with the same color. Took me some time to perfect this, and it can DEFINITELY be improved (larger tessellation : bigger than just rows). Here is what the game is currently looking like:

    I have a little character in the center. Instead of moving the character I move the environment. This is for two reasons:

    A: Not all of the world is visible at any given time. This allows the easy drawing of the part of the world currently being seen.

    B: The character has a different set of 4 colors than the world. So if the player moved I would have to recolor tiles a TON. Not good. (Each tile can only use 4 colors)

    Well, so far Terra has controls, working tessellation for fast redraws, and a randomly generated world. But super long ways to go. This should be better than paying for the game XD.

View all 8 project logs

Enjoy this project?

Share

Discussions

Mark Sherman wrote 05/23/2017 at 05:50 point

Nice!  What do you want to do for the filesystem?  I have a similar project and considered fatfs, but opted to design my own simple system.  If you built the hardware, wrote your own assembler, why not build your own fs?  I'm curious what you come up with.  Mine is based on files just being single linked lists of sectors, and a directory is just a struct of names and sector numbers stored in a 'regular' file.  No index or FAT.

  Are you sure? yes | no

Dylan Brophy wrote 05/24/2017 at 01:04 point

Basically the arduino c code (outside the emulator) replaces a large part of the kernel, including filesystem support.  I do this because I am not sure yet how to directly read/write bytes to/from the SD card in C using the libraries I have and I feel that a filesystem driver that is emulated would be too slow.  It would be more something to do on my #FPGA computer, but I would consider it on this project too.  I have designed filesystems in the past.... Before I knew how drives worked XD.  I would do it again. 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates