Cavve91
Posts: 3
Joined: Thu Jul 07, 2016 1:49 pm

Doubts about the language to use

Thu Jul 07, 2016 2:00 pm

Hello everyone , I'm an Italian guy and about a year ago I bought a Raspberry Pi2 . I tried different operating systems to understand its potential and for the fun . Now I'd like to write a small operating system that limits to animate my Raspberry and automatically copy files from a HardDisk to another . I read online that Assembly is a good language but being inexperienced I would like your advice . I wrote here even though I know there is a section for programming but not knowing which language to choose and being a general question I have preferred to write here .

Thanks for your kind attention .

User avatar
Jednorozec
Posts: 809
Joined: Sun Nov 24, 2013 2:17 pm
Location: Deposit, NY

Re: Doubts about the language to use

Thu Jul 07, 2016 4:29 pm

Writing an operating system is a very difficult task. Find something else to do as a first project.
The most important leg of a three legged stool is the one that's missing.
It's called thinking. Why don't you try it sometime?

Cavve91
Posts: 3
Joined: Thu Jul 07, 2016 1:49 pm

Re: Doubts about the language to use

Thu Jul 07, 2016 4:41 pm

Somewhere you have to start :) I guess it's complex, but I have time and it interests me a lot .

User avatar
B.Goode
Posts: 8553
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Doubts about the language to use

Thu Jul 07, 2016 4:52 pm

Cavve91 wrote:Somewhere you have to start :) I guess it's complex, but I have time and it interests me a lot .
So start with any language. By the time you find it is not adequate for your needs you will have a lot of direct personal experience that will allow you to make a wiser choice for your next attempt.

Of course, you will understand that to write an Operating System you will need resulting code that will execute directly on the arm hardware, so interpreted languages such as python, ruby or basic are unlikely to be appropriate choices.

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Doubts about the language to use

Thu Jul 07, 2016 4:55 pm

If your objective is to create 'bare metal' code your choices are probably assembler and C. If you are an inexperienced programmer this will be an uphill battle, simply creating an environment to compile, test and run your code is (almost) a project in itself.

Have a look at "Raspberry Pi Bare Metal Programming in C"- http://www.valvers.com/open-software/ra ... g-in-cpt1/ and see if its the sort of thing you want to dive into.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

Heater
Posts: 13335
Joined: Tue Jul 17, 2012 3:02 pm

Re: Doubts about the language to use

Thu Jul 07, 2016 5:05 pm

Cavve91,

The mere fact that you have to ask that question indicates you are far from experience enough to be thinking about writing an operating system.

The Linux kernel and UNIX are written in C. You need a language that compiles down to efficient machine code for an OS. Windows is probably written in C and or C++.

Still, writing an OS is a worthy goal. I suggest you first read "Operating Systems Design Implementation" https://www.amazon.com/Operating-System ... 0131429388

Pithagoros
Posts: 580
Joined: Wed Nov 12, 2014 8:16 pm

Re: Doubts about the language to use

Thu Jul 07, 2016 5:57 pm

Possible something is lost in translation, and for "operating system" we should read "application".

Though the suggestion of Assembler would lead us to believe that an actual bare metal process is the goal, the trivial moving of files is something that could be achieved with a script.

ghans
Posts: 7873
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Doubts about the language to use

Fri Jul 08, 2016 9:36 am

OP is highly confused. What he really wants is to
write an userland auto-copying script, and have his Pi
autoboot to it. I know this because i can read minds ;)

I suggest learning Bash scripting and how to write systemd
unit files. Here is some inspiration :

https://chiselapp.com/user/dmpop/reposi ... p-box/home
https://github.com/LarsMichelsen/sd-autocopy


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

ejolson
Posts: 3568
Joined: Tue Mar 18, 2014 11:47 am

Re: Doubts about the language to use

Sun Jul 10, 2016 2:49 pm

ghans wrote:OP is highly confused. What he really wants is to
write an userland auto-copying script, and have his Pi
autoboot to it.
When Google decided to write the operating system called Android they chose Linux as the kernel. Though less successful, Chrome also has Linux as the kernel. While the word Linux sounds like Unix, it is worth remembering that Unix is a complete operating system whereas Linux is only a kernel that becomes Unix-like as part of the GNU project to make a Unix-like operating system. Creating yet another new operating system does not require bare metal programming, but can again be based on the Linux kernel.

Return to “General discussion”