I am Sam, a 15- year old boy with no idea of making operating systems or any super-cool stuff like that. I often dreamt of coding or packing an OS in to an Arduino (which is, as you all know, "impossible one way or the other") , but it seems to me now that it is possible to do it one way. I don't know if the idea that I've cooked up will work or not and I want to know the answer to that question - "will this work?" I believe that you all can help me out. Here's the small sketch of the idea:
According to an article I read in Quora, all microprocessors use the instructions they retrieve from a memory to do all tasks involved in controlling the working of a computer. Although my idea is not in line with the basic functioning and structure of an os, I have somehow tried to make an imitative os in my imagination - one that uses the files stored in an sd card to work things out (sounds weird, right?). Here, we place the Arduino in the place of a microprocessor, the SD card in place of the memory that the microprocessor uses, and the other devices connected to the board the way it should be or by the help of some channel to control the communication. The Arduino reads the required instructions from the files in the sd card and processes it to do the required task. The usage of drivers is one thing in the OS that I am handing over to you for discussion. There are some other things too that you can find for discussion from this idea that I've put up here....
I hope you all will find an answer to it. Also, I pray for the quick recovery of all those who have fallen prey to COVID-19. Expecting a reply from you, I wind up my post.
There have been multiple attempts to make an OS for the Arduino.
Mostly with limited success.
You need to be specific about the board you want to attempt this with as there are multiple MCU architectures and each will need to be cross compiled in some form.
None of that is a beginner task.
Some Arduinos already have a limited OS such as the YUN, NANO (new version) MBED, and so on.
Much has been done with those boards already and just re-inventing the wheel may be a waste of time and effort.
Thanks, Mr.Bob, for the advice , but it seems to me that you haven't understood the matter. It must be my mistake of not adding the whole info, so here's the idea about reading data from the SD card:
It would be difficult to compile or decode the wheels for the OS using the Arduino (most probably) , so I thought of creating a function in the code or a separate library for decoding or executing the commands that are written into a text file or some other convenient file format. That might help one way, according to me, because unlike binary files text files can be easily read and made into text and that will help in easy compilation or execution of the commands. Binary files have those strange characters and I don't know how to change them into the actual text in the file. Also, I have an Arduino Uno R3 with which I want to do my project. Plus, I want to do it myself
with some help from you all (through the clarification of my doubts) . Thanks for reminding me about those files called "wheels".
If possible, please do suggest some Projecthub posts about embedding an OS onto the Arduino.
Sounds like “bitlash”, or even the venerable “BASIC stamp”:
Interpreter on the arduino, files to be interpreted on sd card.
Forth could work like that as well, and I think there are soMe BASICs as well.
MicroPython and CircuitPython work similarly, but require at least a SAMD cpu.
If you look somewhere on the Web, you'll find an article about someone who emulated an ARM processor on an AVR with SD card, and after many hours (just of the processor time, not development - that must've been many months) managed to boot a simple Linux image.
Binary files don't have "strange characters" in them, they have binary.
SamRuben123:
I am Sam, a 15- year old boy with no idea of making operating systems or any super-cool stuff like that. I often dreamt of coding or packing an OS in to an Arduino
At the very least choose a microprocessor board that has lots of SRAM memory and lots of program space More processor speed is also good. Trying to squeeze an OS into an Uno or Mega plus an SD Card is just adding a huge additional burden in learning, programming and testing.
For me the beauty of an Arduino is the fact that it does NOT have an OS to get in the way.
Thanks for helping me understand why my objective is an impossible one. But there's something interesting I found in the Projecthub. I wasn't able to try it out, but I say, adding a GUI to that thing makes a "kinda" OS or whatever that's intended to be! The maker of the project calls it Arduios, and it is a really interesting thing. It fascinated me at first sight and when I began diving deeper into the topic, I found it a cool experiment to try.
Will editing the experiment to include a GUI in it make things somewhat possible?
Sam
PS: What I meant by "strange characters" is that I find it difficult to understand.
SamRuben123:
adding a GUI to that thing makes a "kinda" OS or whatever that's intended to be!
An operating system is a lot more than a GUI and the GUI part can involve more code than the rest of the operating system. GUIs need lots of RAM and very fast processors.
GUI stands for "Graphical User Interface" and implies the sort of thine we are familiar with from MACs and Windows and the way that most browsers work. However if you leave out the G and just think in terms of a User Interface you could implement a very very effective text based interface for any Arduino that can display on an LCD screen and use a few push-buttons to select options. Think of the interface on many cheap 3D printers.
Thanks for telling an effective way to make a simple computer-like thing at home. Last thing: will using a tft touchscreen improve UI ? Also, will it be better if I abandon my plan to use an SD card and adopt the technique used in Arduios ?
SamRuben123:
Last thing: will using a tft touchscreen improve UI ? Also, will it be better if I abandon my plan to use an SD card and adopt the technique used in Arduios ?
It's impossible to answer either of those questions without knowing a lot more about the actual project you want to create. Sometimes a touchscreen can be useful, sometimes not. Sometimes an SD Card is needed
I think the idea for an operating system emerged when people realized that many stand-alone programs that had already been created on the very early computers had a lot of common code that could be shared between the programs and thereby reduce the work required to create a new program. For example with Windows or Linux almost every program uses data from files yet nobody needs to know the details of getting the heads of a disc drive to go to the correct cylinder to find the bytes that make up the data in a file. You need to have enough programming experience to be able to identify the repetition that an operating system might eliminate.
The other essential feature of operating systems is that they are intended for computers where several user-programs can be running at the same time (as well as the operating system program). On an Arduino Uno or Mega there is really only space and speed for a single program.
Seems like COVID-19 is taking control of the whole world... I feel so sad that many are dying due to the damned disease. I pour out my heartfelt condolences to all families who have lost their near and dear ones. I suggest that we stay optimistic ( not panglossian) and follow all necessary steps to curb this danger from spreading far and wide. Also, I suggest that we stay hygienic throughout the battle..
Anyway, I would like to share a recent development I have made in my "OS for Arduino" project. Today I tried to make a library to code processes that can be used to make custom operating systems for any Arduino board.
It seemed to work well, except a small bug which I may be able to fix. I thought of enabling multitasking, but I have a doubt on that. I don't care about the GUI, since I can , if possible, make things work on an LCD dot matrix screen( the ones that we call the LCD shield ). I didn't get to the scheduler part. I work on this with only a rough but not exact idea of the terms and concepts used here.
My doubt is : how can I store user-defined classes (the ones we use in our programmes) in the SRSM memory?
SamRuben123:
My doubt is : how can I store user-defined classes (the ones we use in our programmes) in the SRSM memory?
If you mean that you would like to store program code in SRAM then the short answer is that you can't on an Arduino. The program code is stored in a different part of memory.
Have you considered an RPi/SD card with LCD touchscreen and bluetooth keyboard/mouse?
We set up an RPi4 recently, works very nice.
Longest part was getting Noobs software on SD card to unzip the Raspbian/Linux OS onto the SD card (took hours to read from SD, unzip, and write it back). New Haven Display has a nice display, we haven't got the capacitive touch screen working yet, but haven't played with that part much.
Your description sounds similar to what my fencing scoring machine does.
It waits for a command from a 16-button remote control.
Each button press received could be considered direction to run an app.
In my case, the 'apps' did pretty specific things - start a timer, stop a timer, clear a timer, set the start to 3:00 or 10:00, update a score, decrease a score, turn on a 'warning' LED, turn on a 'penalty' LED and turn off the 'warning' LED, restore all back to the starting state, etc..
If your 'apps' don't fit in the 128K of a '1284P, or the 256K of a 2560, then you might look into writing some code that runs in the bootload section which can re-load Program memory with a file on SD card.
SamRuben123:
I didn't mean to say program code. I just meant to say "an app" or "a process". I thought of keeping processes aside when they are in waiting mode.
In your mind what is the difference between an app (or process) and program code? Both words convey to me the notion of a program or part of a program - the sort of thing that might be in a C++ function.