Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I run a program in place of an OS ? I mean is it possible for me to replace the OS with a custom made program which says "Hello World" as soon as the Hardware starts ?

share|improve this question
3  
In that case that "Custom program" will be your "custom OS" actually. A computer can't run without an OS. Of-course you can pick up a Linux Distro and tweak it for your needs. –  Lamb Dec 30 '12 at 20:11
1  
Sure, you could just make a bootloader that does that. You need to know Assembly and the boot process rather well, though. –  minitech Dec 30 '12 at 20:28
    
Most modern user-based operating systems can be configured for "kiosk mode" in which an application is placed at the forefront and the operating system is out of reach of the user. –  MaQleod Dec 30 '12 at 20:36

2 Answers 2

Yes it is entirely possible, however this program will have to be your OS. That means that you will not have your typical functions to print to the screen, instead you will either have to implement these functions yourself which write to the hardware or you have to simple write "Hello World" to the graphics hardware directly.

For tutorials on how to do this, look up the OSDev wiki, they have tutorials for this exact sort of thing.

share|improve this answer
    
replace OS with another OS and call it a program? You can not replace an OS with anything except another OS. –  Logman Dec 30 '12 at 20:23
2  
@logman You are mistaken. An OS is a program with special functions for running other programs. You can replace an os kernel with any specialized program. For example, early video games were their own OS's and they were a specialized program. –  Dougvj Dec 30 '12 at 20:31
1  
Why not? An OS is a program: a complex program that manages other programs. You will just to access the hardware directly whiteout any system call or driver but it is definitely possible and not so complicated. –  Matteo Dec 30 '12 at 20:31
    
Wouldn't using a bootloader help with the process ? And as you specify that "That means that you will not have your typical functions to print to the screen, instead you will either have to implement these functions yourself which write to the hardware" so does that mean that I will have to go into the hardware level programming ? Is there any way to bypass the low level prrogramming ? –  Ankur Dec 31 '12 at 18:21
    
@user1712778 You're right, a bootloader will help if the program is greater than 512 bytes. If you wish to run your program without an operating system, then you must access the hardware directly. There are libraries that help with this, but it is unavoidable. Another option is to run a very light Linux kernel and have your program be the 'init' process. –  Dougvj Dec 31 '12 at 22:33

No. There is too much going on. You need an OS and you replace the existing windows manager/gui/cli/shell with yours. Example, instead of MS Windows "explorer" opening and running you replace it with yours. Not practical in MS but...

You can do this with linux distros... you should check out TinyCore for a really barebones OS that is meant to be built on. Default Windows Manager in TinyCore is flwm which is built on a framework you could use to make your own gui

share|improve this answer
    
Since the new OS would only print "Hello world" you do not need any window manager, GUI, whatever. See for example: codeproject.com/Articles/28067/… –  Matteo Dec 30 '12 at 20:22
    
technically you are right, but it is basically useless for anything besides a hello world application. But it is an OS. You can call it anything else you want but it is still an OS. Or Not. Semantically we could be here for a long time discussing that. –  Logman Dec 30 '12 at 20:30
    
The OP is just asking if it is possible to boot a "program" that prints hello world. The answer is yes regardless of how you call it. –  Matteo Dec 30 '12 at 20:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.