Tux

...making Linux just a little more fun!

Developing a small OS from a preinstalled Linux

Abhishek Sharma [spyzer.abhishek0 at gmail.com]


Thu, 8 Oct 2009 20:17:07 +0530

Hi,

I am working on a project of making a small OS which will boot up on my dual core machine and will serve as a simple calculator. If its possible I would like to add GUI to it too.

My question is for this job do I need to program all the stuff as assembly code or is there a way in which the precompiled linux kernel or those "boot.img | initrd.img" can help me without having to go through assembly development?

If its possible I would be glad if you tell me how I can achieve this.

Thank You.


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Thu, 8 Oct 2009 20:52:15 +0530

Hello,

On Thu, 08 Oct 2009, Abhishek Sharma wrote:

> I am working on a  project of making a small OS which will boot up on
> my dual core machine and will serve as a simple calculator. If its
> possible I would like to add GUI to it too.

There is no more reason for such a project than a project that takes a rolls-royce jet engine and uses it to move at 20Kmph! The only difference perhaps is that your project is possible but the jet engine one is not!

> My question is for this job do I need to program all the stuff as
> assembly code or is there a way in which the precompiled linux kernel
> or those "boot.img | initrd.img" can help me without having to go
> through assembly development?

You can certainly configure Ubuntu to boot up by default into an X session with Emacs running the "ess" front-end to "R" which can do far more than any "calculator" I ever met could.

You could replace "R" with "octave" or "scilab" as well.

Regards,

Kapil. --


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Thu, 8 Oct 2009 13:03:42 -0400

On Thu, Oct 08, 2009 at 08:52:15PM +0530, Kapil Hari Paranjape wrote:

> Hello,
> 
> On Thu, 08 Oct 2009, Abhishek Sharma wrote:
> > I am working on a  project of making a small OS which will boot up on
> > my dual core machine and will serve as a simple calculator. If its
> > possible I would like to add GUI to it too.
> 
> There is no more reason for such a project than a project that takes
> a rolls-royce jet engine and uses it to move at 20Kmph! The only
> difference perhaps is that your project is possible but the jet
> engine one is not!

Oh, we humans excel at inefficiency. E.g., the parasitic computing concept:

http://www.nd.edu/~parasite/

Now, all that aside - if you actually want a ridiculously overpowered, remove-the-fly-from-your-friend's-forehead-with-an-axe solution, I'd suggest exploring the "memtest" boot option available on many Linux live CDs. It boots just enough Linux to run "memtest" - which seems like something you could use.

There's also the option of looking at the few remaining "Linux on a floppy" versions. You could configure one of those to start some sort of a command-line calculator - say, "bc" or "dc" - and call it a done deal. This is possibly the simplest answer of all.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *


Top    Back


Lew Pitcher [lew.pitcher at digitalfreehold.ca]


Thu, 8 Oct 2009 13:25:24 -0400

On October 8, 2009 10:47:07 Abhishek Sharma wrote:

> Hi,
>
> I am working on a  project of making a small OS which will boot up on
> my dual core machine and will serve as a simple calculator. If its
> possible I would like to add GUI to it too.
>
> My question is for this job do I need to program all the stuff as
> assembly code or is there a way in which the precompiled linux kernel
> or those "boot.img | initrd.img" can help me without having to go
> through assembly development?
>
> If its possible I would be glad if you tell me how I can achieve this.

From your email, it is difficult to see what your goal is.

If your goal is to build a "simple calculator", then your plan to develop a "small OS" or utilize an existing "precompiled linux kernel" is a drastic overkill.

OTOH, if your goal is to write a "small OS", then you will have to spend some time defining what facilities you want this "small OS" to provide, before you start.

If you are just looking for a pre-existing "small OS" that you can boot up on your system, then there are a vast number of choices available to you, including Minix (a great way to learn OS design and development), Xinu, and a large number of small Linux distributions.

If you are asking whether or not a "small OS" /requires/ that all code be assembly language, then the answer is "no". Unix-like operating systems are typically developed in a high-level-language (C, actually) with a small amount (probably around 5%) of assembly language to deal with the low-level hardware. Applications (like your "calculator") and facilities (like your "GUI") are typically 100% high-level-language.

My recommendation would be to spend some time learning about how operating systems and application programs are developed. A /really/ good place to start would be the Minix OS, which is a simplified Unix environment written specifically for use as an educational tool in learning OS development.

-- 
Lew Pitcher
 
Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/   | GPG public key available by request
----------      Slackware - Because I know what I'm doing.          ------


Top    Back


Jim Jackson [jj at franjam.org.uk]


Thu, 8 Oct 2009 18:43:39 +0100 (BST)

On Thu, 8 Oct 2009, Abhishek Sharma wrote:

> I am working on a  project of making a small OS which will boot up on
> my dual core machine and will serve as a simple calculator. If its
> possible I would like to add GUI to it too.
>
> My question is for this job do I need to program all the stuff as
> assembly code or is there a way in which the precompiled linux kernel
> or those "boot.img | initrd.img" can help me without having to go
> through assembly development?

Check Linux From Scratch

http://www.linuxfromscratch.org/

It has lots of clues.


Top    Back


Neil Youngman [ny at youngman.org.uk]


Thu, 8 Oct 2009 19:25:51 +0100

On Thursday 08 October 2009 18:03:42 Ben Okopnik wrote:

> Now, all that aside - if you actually want a ridiculously overpowered,
> remove-the-fly-from-your-friend's-forehead-with-an-axe solution, I'd
> suggest exploring the "memtest" boot option available on many Linux live
> CDs. It boots just enough Linux to run "memtest" - which seems like
> something you could use.

Actually memtest86, which I assume is run by the memtest boot option[1], doesn't load any Linux at all.

"Since Memtest86 is a standalone program it does not require any operating system support for execution." [2]

Neil

[1] or possibly memtest86+. http://www.memtest.org/

[2] http://www.memtest86.com/tech.html


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Thu, 8 Oct 2009 19:11:30 -0400

On Thu, Oct 08, 2009 at 07:25:51PM +0100, Neil Youngman wrote:

> On Thursday 08 October 2009 18:03:42 Ben Okopnik wrote:
> > Now, all that aside - if you actually want a ridiculously overpowered,
> > remove-the-fly-from-your-friend's-forehead-with-an-axe solution, I'd
> > suggest exploring the "memtest" boot option available on many Linux live
> > CDs. It boots just enough Linux to run "memtest" - which seems like
> > something you could use.
> 
> Actually memtest86, which I assume is run by the memtest boot option[1], 
> doesn't load any Linux at all. 

I didn't realize that - but that would make it all the more suitable for Abhishek's purposes. A stub loader that rolls over to an application seems like exactly the thing he's asking for.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *


Top    Back