Page 1 of 1

can I use baremetal OS to write a fully standalone program

Posted: Tue Oct 29, 2013 1:18 am
by gideond
So, I saw this archive post about these guys, they built a chess program in assemblythat runs purely on it's own without an OS on a Raspberry PI.

I've been looking to do something like this, but a LOT simpler. After going through james molley's tutorial I can write a simple program on screen that is sort of purely standalone.

I want to go a step or two further, I wanted graphics api and network api and I noticed BareMetal has ethernet api..

Question : Is it possible for me to write a program with baremetal and compile it into a OS (as in a standalone program that will boot, do it's thing and exit when needed). I need to be able to compile into ONE package or image.

Would baremetal be the best thing here, or is there something else out there that would suffice my need.

Re: can I use baremetal OS to write a fully standalone progr

Posted: Wed Oct 30, 2013 6:51 am
by Bender
Yep it is possible but I'd say it would be worthless,
First you will have to write all kinds of drivers, AT LEAST the keyboard and the Video, ones for input output. Since your OS is a sort of game or a program you wouldn't need Disk Drivers until you are planning to read and write to the external storage devices,
But after that you would be like :
Wait! I got my keyboard and video drivers and FAT16/FAT32 HDD Drivers,
Let's make a memory manger, then you would go on making an operating system.
Believe me, I went on to make a standalone x86 Mario Clone. The moment I made a simple platform engine with a port of Saniks Mouse Driver, I was, like Dump Mario in the garbage bin and start making an OS.
However I have no plans to discourage you Go on, Who knows what you may come up with?

Re: can I use baremetal OS to write a fully standalone progr

Posted: Wed Oct 30, 2013 9:11 am
by gideond
First you will have to write all kinds of drivers
But doesn't baremetal OS already have a few drivers? My plan was to use baremetal itself and build on top of that. But in the end it should be one package/executable/image whatever.

I should have ONE end product that I can run standalone.

Re: can I use baremetal OS to write a fully standalone progr

Posted: Wed Oct 30, 2013 7:13 pm
by Octocontrabass
gideond wrote:I should have ONE end product that I can run standalone.
You mean like a Linux live CD? It's not too difficult to script Linux into starting a single task, then shutting down when that task ends.

If you really want to write an OS, I'm not going to stop you, but it doesn't sound like the right solution to the problem.

Re: can I use baremetal OS to write a fully standalone progr

Posted: Thu Oct 31, 2013 12:16 am
by gideond
It's not too difficult to script Linux into starting a single task
Ah true. But I wanted something tiny and lightweight, so my question was can I use ReturnInfinity's BareMetal OS to do this? And it shouldn't be an executable that runs on the OS, the whole thing should be one package.

I'll you why I have such a strange need. I'm doing a simple compiler project. I want to rewrite my compiler a bit to be able to compile a program with an OS(Like BareMetalOS / MikeOS etc) around it. So my compiler will generate one standalone program that can be burned on a CD and used without an OS on the machine. Thats the whole story.

Infact, I already have something working. I've got the code from the James Molloy tutorial working, but all it can do is print to the screen. So right now I can compile a program from my compiler that can print stuff.

Eventually, yes, I want to build my own OS. But as a part of my compiler side project, I wanted to do the above.

Re: can I use baremetal OS to write a fully standalone progr

Posted: Thu Oct 31, 2013 1:32 am
by rdos
It's perfectly possible to bundle an application with RDOS, creating a single binary file which can then be put on a USB-stick or similar. I use this to format and partition CF discs on our systems automatically. However, this won't run on Raspberry PI.