views:

361

answers:

12

Applications that would boot straight from boot media like a bios.

WOuld this lead to better performance, leaving the OS behind?

Or would there be no difference, basically replacing system calls with function calls?

edit: I am after lists of applications similar to memtest86 but for number crunching as examples

+33  A: 

All right, get rid of the OS.

But you need to get the numbers to crunch. Where from? From the hard disk, of course. Well then, you need functions to access the hard disk. Oh and you need a modern one that utilizes all the enhancers and speedups of your hard disk controller.
Then you need a file storage format to read from. It needs to be fast and will be optimized for reading large amounts of data.
Then you need an API to read, index, and write specific portions data from and into the file.
Then you need memory management so your number cruncher doesn't run out of RAM.
Then you need libraries to deal with multi core processors, as you are going to take full advantage of them.
Then you need libraries to use all the kinky tricks the processor vendors have built into certain models.
And so on and so on. And in the end, when you have everything to crunch numbers on a really low level, you have....

... an operating system :)

Pekka
Which isn't to say that you couldn't have a stripped down and optimized OS just for the particular application...but that's probably a serious amount of work for what is probably very small gain.
Beska
Aaron Digulla
There are minimized Linuxes that probably come very close to what the TO is looking for. But even they contain a lot of logic to cover even the most basic tasks, this is what I aimed to point out. :)
Pekka
QNX is pretty lean for doing something like this.
fuzzy lollipop
You are assuming that all computers are like your desktop/laptop. It is not unusual to run on bare metal in the embedded world.
dmckee
I am assuming from the original question that he means "normal" personal computers.
Pekka
+2  A: 

Run this on a GPU ? There isn't an OS on a GPU (assuming that is the main concern).

GPUs are great at crunching numbers.

jldupont
Just an addition, you can find information on this type of programming by googling GPGPU
tloach
@tloach: thanks for the precision!
jldupont
And ofcourse for modern Nvidia chipsets, we have CUDA: http://en.wikipedia.org/wiki/CUDA and http://www.nvidia.com/object/cuda_home.html
Wim Hollebrandse
A: 

Basically no difference.

I believe memtest86 is run from a stripped-down version of DOS or Linux. The OS provides a number of useful facilities such as threading, memory protection, process management, etc. You can duplicate them, and maybe optimize slightly, but it's probably not worth it.

Edit: As noted above, the OS provides a lot of things you need, such as drivers and HD communication. A stripped-down Linux kernel is probably faster and easier to work with than writing all of these things yourself. Or, you could just kill processes/servers that are noncritical.

Even on my Windows XP install (a system not known for efficiency), with antivirus and firewall, etc the system is idle about 97% of the time.

BobMcGee
Last time I looked (a few years ago) memtest86 *would* run on bare metal, leaving only *one* page of memory untestable (the one the program was resident in).
dmckee
+1  A: 

This could probably improve performance in theory because you could get rid of memory protection and paging and just run the CPU in real mode (on x86) if you don't need to address >640K of memory. Paging adds a level of indirection to all memory access, and therefore probably has some overhead.

That said, I've never heard of this being done in practice and you could just use DOS (which barely qualifies as an OS because it's so minimalist) if you don't want memory protection.

dsimcha
Hmm, I would have said rather the opposite about DOS. A Windows intall includes all sorts of things that aren't very OS-like at all. I saw some TV commercial for XP that mentioned only one feature of this OS: That it included software to stitch together overlapping photographs to form a panaromic view. Yes, a cute piece of software, there's a feature for that in several graphics programs I have and I've used it, let's see, I think once in my life. But can that even be called an "OS feature"? When I think OS I think of I/O management, file system management, networking, that sort of thing.
Jay
I think the commenter meant literally DOS - e.g. the old versions 3 or 4 which used to run standalone - and not Windows.
Leigh Caldwell
@Leigh: Yes, I meant plain old stone age black screen MS-DOS command prompt, in real mode.
dsimcha
+1  A: 

It should be possible to quite conveniently do something like this using a very reduced Linux kernel. There are quite some distros out there that are less than 1 MB in size. Reducing it any further doesn't make sense, as you will start spending much more money on manpower than you could have ever spent on hardware.

sfussenegger
+1  A: 

You don't need a system call to "crunch numbers", you do need some sort of IO capability to put them into memory and get them out somehow. This is where one starts to think of an OS.

Nikolai N Fetissov
+5  A: 

An OS isn't magic code. It's just a bunch of function calls which call other functions. Of course, if you use an OS like Windows and run disk indexing, a virus scanner, and an MP3 player in the background plus 80+ strange services, then performance will suffer a bit.

But if you don't run anything on your machine but the app in question, most OSs don't eat that much performance.

Aaron Digulla
A: 

Suddenly 80%+ of your dev time is spent on low level interfacing with various hardware devices...bit hard to justify to business. Even if you're an Open Source application the amount of time spent doing this does not justify the cost.

For very specific domains this is usefull (like memtest86 - or even an artillery trajectory calculator...) - however a stripped down OS will be more stable and well tested (one would hope) and will handle a large part of the non domain concerns for you.

saret
A: 

Yes there is, your looking for a real time operating system such as VXWORKS or RTEMS. No matter what you do the functionality provided by a real-time embedded OS will be required by any code you write :D you get deterministic behavior for your processes with these -- i.e., no statistical elements in your program such as preemptive scheduling, VM PAGING, or memory allocators :D.

Are you by any chance writing a controller for a nuclear reactor ? :P

Hassan Syed
A: 

You may be interested in this article: http://www.engineersedge.com/technology%5Fnews/posts/1018.html

... specifically the comment by Frank Oppenheimer sums it up well: "Software is flexible, but it requires fast and expensive processors and can be too slow for very computation-intensive tasks"

Reed Debaets
oppenheimer's from the stone ages in terms of computational power.
Hassan Syed
Perhaps you misunderstood then what I was getting at here ... I'm saying custom hardware to handle specific number crunching can be built which would indubitably be much faster than software based solutions... I think Leigh Caldwell was right on track when he said "yes its called a pocket calculator" that is ... in old pocket calculators there's no software driving the math, its hardware based...
Reed Debaets
+1  A: 

Back when the RC5-64 project was active, there was a Linux kernal that was stripped down to do a single task: run as an RC5-64 client. I think it was called K-linux. It didnt need a monitor, (and I think it didnt even need a Hard disk either, just a network connection) This is probably what I would do if i had to squeeze every last drop out of an application.

Neil N
A: 

My first thought was "sure, it's called a pocket calculator."

Am I showing my age or just my lack of empathy?

Leigh Caldwell