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
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. ON AN ARDUINO MEGA.

Hardware Specs:

  • NGT30 graphics
  • keyboard
  • Ethernet
  • SD card support
  • Extra 32KB parallel SRAM if 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
  • Compilable & Executable BASIC
  • 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.

I have compiled a YouTube playlist chronologically of when I created them.  Here it is:

as.py

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

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

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

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

mmc_compile.py

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

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

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

View all 6 files

  • 1 × NGT20 Graphics Shield
  • 1 × Arduino Mega Processor/Control Board
  • 1 × PS/2 Compatible Keyboard you can cut the connector off and plug the wires into the arduino. Or get a connector.
  • 1 × SD Card Shield (Optional) Be Careful! Ensure Mega compatibility!
  • 1 × VGA/NTSC Monitor and Cables

View all 6 components

  • Should I return? Updates from past few years

    Dylan Brophy04/10/2023 at 04:09 1 comment

    I haven't been on HaD for a few years now.  But this Arduino computer project has, in some way, continued to advance.  I'm going to write a series of logs outlining the changes and developments that have happened over the past few years, not necessarily in chronological order.

    At some point I took some code I wrote, copied and restructured it into a git submodule, and started building an OS around it.  A bigger, more flushed out OS and fragments of a kernel and HAL.

    The repo is on my personal GitLab instance here if you want to take a peek at the modern source code: https://git.nuclaer-servers.com/Nuclaer/ntios-2020
    In all honesty, I never planned on releasing it, so there's some pieces that were copied from around the internet but probably have attributions in the comments.

    I've created many devices with this software over the past 2-3 years:

    Various devices I built over the last few years


    Writing assembly in a text editor on a hacked-together laptop-like computer
    Closer image of some of the associated electronics

    Terminal output (device pictured lower right in top image)

    All of the devices above run ~95% the same software.  The only differences are in the exact mapping/configuration of the hardware and some drivers to plug it in to the rest of the HAL.

    I kindof just wanted to sneak peek what the project kindof is now, and see what people think.  This is not very much, and doesn't describe what's going on or how any of this works, this is just kindof a preview.  If you want to see/learn more, comment so I know people are interested.

    What does this run on?

    If you pay attention, you'll see I'm quite a fan of the Teensy 4.1 now.  I've used other chips like the ESP32 and Artemis, but T4.1 has been my go-to for a while now.  I haven't used AVR in many of my projects for a long time now, but I think I could run this on an ATmega2560.  The software stack is getting rather large though, and probably ever more memory intensive, so I don't think I could run this well on an ATMega328p or similar chip.

    Relation to the original software

    When I first created this new OS in May 2020, I probably only copied over the existing system() function I had written for this project, but it seems like everything else was written from scratch to be more modular and use more OOP.  It's not clear if I copied some stuff from the NTIOS_2.0 codebase, or if I started from scratch.  In either case, the way the HAL is set up for the new OS project has some strange resemblance to the HAl in NTIOS_2.0.  But in all honesty, at some point I had pretty much completely forgotten about the NTIOS_2.0 code and what I had been working on.  This happens more frequently than I would like to admit...

    Should this even be considered the same project?

    I think this is the logical continuation of this project.  I don't even know where the hardware is for this project anymore, but I want to make it nicer and more modern anyway.  Is it the same?  Well we have a new codebase, new hardware...  But yet it has the same objectives and interestingly, seemingly, some of the same architecture.  I don't know, but this project will die if it stays what it was, because that is in the past.  Grow, or die, is the way of life.

    Where is this project going now?

    My hopes for the new system are a bit more lofty.  My newer code is far more mature and advanced.  I think I can load and execute ELF files from an SD card on ARM if I put some more work into it.  In the meantime we can assemble programs for a built-in emulator and execute them.  Currently this still is compiled and uploaded from Arduino.

    If I come back to HaD, this project is going to change a lot.  The code will be newer and more capable.  The hardware will become more powerful and more portable (like tablets and laptops instead of a static device).

  • GPIO Support

    Dylan Brophy10/12/2019 at 23:28 0 comments

    I added GPIO drivers, and a gpio program to test the drivers.

    Essentially I just set pin 13 to output, then set it HIGH.  And yes, it worked!  Yay!

    What's nice about the way this is programmed is that it is independent of hardware and the Arduino IDE.  the GPIO command I used uses whichever driver(s) for GPIO that it finds, regardless of what hardware this is running on.  I even can run this OS on my linux machine as a cli command.  Great for testing!

  • AVR Support

    Dylan Brophy10/11/2019 at 06:08 0 comments

    Wait - didn't this used to run on Arduino?

    Yea, in the Arduino IDE.  I am no longer using the Arduino IDE, and uploading to AVR via a makefile works great!

    After overhauling the OS I lost AVR support.  I have regained it!  Here's what the result is:

    I am still using the Arduino IDE for a serial monitor, but everything seems to work.  I still need to add support for lots of stuff now, but I'm running on a microcontroller again, which is nice.

    Anyway, I'm super excited, next I plan to add a GPIO API, so that later I can add software serial (then graphics support via an NGT30 :D)

  • Overhaul of the OS

    Dylan Brophy10/05/2019 at 04:53 0 comments

    It's been a while since I worked on this, and I see things differently now.

    First, I designed this dumb.  It's not scalable.  It was too hard to add drivers and programs and nothing was organized.

    Now I have separate directories for programs/commands and drivers.  Also, I have python scripts to configure the programs and drivers before compilation.  They are configured with JSON files that the python scripts read, and each component can be enabled/disabled.

    So I now have organization and scalability!!!  Yay!

    This is wonderful because I want to make this OS cross-platform.  I want support for more hardware, more processor types, and I want it to be usable in more ways.  For instance, to use it on microcontrollers as a usable OS in projects that need less processing power than a raspberry pi, like small robots, in home automation, and simple portables (like my #OpenPDA project).

    I definitely have a ways to go, but this is a major step.  See PR on Github here: https://github.com/NuclearManD/NTIOS_2.0/pull/1

    Note:

    1. Not as much hardware support - yet.  Only UART, NGT30, and PS2 Keyboard support
    2. No GUI anymore (can be fixed later)
    3. Added a man command
    4. Filesystem is not working, even though it is there.
    5. No multitasking at this time

    Like I said, lots of work to do!

  • basic BASIC and filesystem commands work!

    Dylan Brophy04/24/2018 at 00:58 2 comments

    Now the SD card is actually useful!  Project is now getting even more fun :D

  • SD Card working (finally!)

    Dylan Brophy12/02/2017 at 23:38 0 comments

    My arduino desktop now has a filesystem.  I can't do much with it yet, but it works. I also made some other improvements:

    1. better task manager
    2. CLI improvements
    3. new GUI color scheme

    Here is a video:

    Also, like I said in the video, I am making a board with:

    1. Arduino mega
    2. NGT20
    3. PS/2 Keyboard port
    4. SD card slot

    All in one arduino-mega sized board.

  • 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.

View all 14 project logs

Enjoy this project?

Share

Discussions

ActualDragon wrote 06/07/2018 at 17:38 point

i can see it now, we'll be winning fortnite dubs on our arduinos XD 

  Are you sure? yes | no

Dylan Brophy wrote 07/21/2018 at 05:03 point

Just wait for Arduinos with FPGA softcore accellerated graphics... :P

  Are you sure? yes | no

Mars 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