Linked by David Adams on Wed 14th Jul 2010 21:33 UTC, submitted by iseyler
OSNews, Generic OSes BareMetal is an open source 64-bit OS for x86-64 based computers. It is written in Assembly, and applications can be written in Assembly or C/C++. It's aimed at three target segments (High Performance Computing, Embedded Applications, and Education). It's also designed to be simple, and it's really small. Under 16Kb small. Version 0.4.8 was released recently, which includes updates to the C application library, updated documentation, and better support for SMP. It's good to see some innovation in the startup/hobbyist OS space. We wish them well!
Thread beginning with comment 433598
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Why x86 assembly?
by iseyler on Thu 15th Jul 2010 20:36 UTC in reply to "Why x86 assembly?"
iseyler
Member since:
2008-11-15

BareMetal OS will always be lean and mean. Allowing it to get "large and complex" would defeat our goals. The OS provides just the basics (keyboard input, screen output, disk (and eventually Ethernet) access). BareMetal OS will never replace the OS on your desktop/notebook because that is not what it is being designed for. We want something that gets out of the way when an application is running.

As for portability we don't think the x86 architecture will be replaced any time soon. Also the great thing about x86 is that it is everywhere. While high-level compilers do a good job at compiling code we prefer being in full control of what opcodes the CPU is executing (and in what order). Does GCC or LLVM/Clang optimize for "branchless" code if it can?

- Ian Seyler @ Return Infinity

Reply Parent Score: 1

RE[2]: Why x86 assembly?
by Valhalla on Fri 16th Jul 2010 13:37 in reply to "RE: Why x86 assembly?"
Valhalla Member since:
2006-01-24


As for portability we don't think the x86 architecture will be replaced any time soon. Also the great thing about x86 is that it is everywhere.

And good to see you going for the x86-64 cpu generation. Those extra registers must sure be handy.

While high-level compilers do a good job at compiling code we prefer being in full control of what opcodes the CPU is executing (and in what order).

Heh, I can certainly understand the preference of 'full control' since it's also part of my own nature. That said, compiler optimization has matured alot these past years and although they will never offer the same level of control (and likely not the same level of optimization as that of an assembly guru) I personally find it 'close enough' for the majority of cases. Newer optimization techniques like PGO (profile guided optimization) offers you branch prediction, efficient instruction cache usage, function reordering, loop unrolling etc in an automated way. Again, a great assembly programmer can beat this I'm sure, but it will require a great level of skill and more time. Please don't think I'm putting your efforts down, I admire your willingness and skill to write an os in pure assembly and having programmed alot in x86 assembly during my time I find it very inspirational. Today, most of the places I see assembly code is in BIOS'es, really low level OS stuff and special optimizations such as video encoding/decoding. Seeing it applied on a whole OS project is very impressive.


Does GCC or LLVM/Clang optimize for "branchless" code if it can?

Yes, GCC will transform conditional jumps into branchless equivalents wherever applicable, and I'm certain the same is true for LLVM although I'm too lazy to look it up (hey, it's summer).

Reply Parent Score: 2

RE[2]: Why x86 assembly?
by DeepThought on Sat 17th Jul 2010 05:07 in reply to "RE: Why x86 assembly?"
DeepThought Member since:
2010-07-17

BareMetal OS will always be lean and mean.
- Ian Seyler @ Return Infinity


But at least multi-threading should be added. Or did I oversee it in the sources ?

Actually, IMHO, something that calls itself an OS today needs to support multitasking and or multi-threading.

Anyway, good to see there are more freaks around doing pure assembly :-)

Reply Parent Score: 1

RE[3]: Why x86 assembly?
by iseyler on Sun 18th Jul 2010 08:19 in reply to "RE[2]: Why x86 assembly?"
iseyler Member since:
2008-11-15

Multi-threading is supported but not in the way that other Operating Systems use it.

BareMetal OS uses a Process Queue. An application can throw as many "work loads" as it wants into the Process Queue and any available CPU Cores will begin to work on them.

There is a presentation on the topic here:
http://vimeo.com/13423853">BareMetal

Reply Parent Score: 1

RE[2]: Why x86 assembly?
by f0dder on Sat 17th Jul 2010 13:13 in reply to "RE: Why x86 assembly?"
f0dder Member since:
2009-08-05

While high-level compilers do a good job at compiling code we prefer being in full control of what opcodes the CPU is executing (and in what order).
Good luck controlling the order instructions are executed in... how many years has it been since out-of-order execution was introduced to CPUs? ;)

(yeah, I'm nit-picking).

Reply Parent Score: 1

RE[3]: Why x86 assembly?
by DeepThought on Sat 17th Jul 2010 16:59 in reply to "RE[2]: Why x86 assembly?"
DeepThought Member since:
2010-07-17

Good luck controlling the order instructions are executed in... how many years has it been since out-of-order execution was introduced to CPUs? ;)

out-of-order execution is no problem for assembler programming. Why should it be ? There are always synchronization points like return from subroutine or memory barriers. Only if you need to be sure some code has been executed before another is started, you have to insert such sync-point by yourself.

Reply Parent Score: 1