can I use baremetal OS to write a fully standalone program

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gideond
Posts: 17
Joined: Wed Oct 23, 2013 9:02 am

can I use baremetal OS to write a fully standalone program

Post 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.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

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

Post 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?
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
gideond
Posts: 17
Joined: Wed Oct 23, 2013 9:02 am

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

Post 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.
Octocontrabass
Member
Member
Posts: 5604
Joined: Mon Mar 25, 2013 7:01 pm

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

Post 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.
gideond
Posts: 17
Joined: Wed Oct 23, 2013 9:02 am

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

Post 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.
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

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

Post 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.
Post Reply