Live data from Hacker News

BareMetal OS

github.com

21–30 of 50 posts

Re: BareMetal OS

#21
post #5

Earlier quoted context omitted.

This is a really interesting approach. What are the main bottlenecks something like BaremetalOS solves? Context switches? Copying data forth and back userland? Something else?

Extreme real-time control with total control over jitter etc. Not only fast response time but predictable.

Control over jitter would be less ideal for very tight deadlines due to branch prediction, cache misses, instruction counting, etc.

Re: BareMetal OS

#22
From the README:

> BareMetal OS is an exokernel-based operating system crafted entirely in x86-64 assembly and is designed to provide unparalleled levels of flexibility and efficiency.

Re: BareMetal OS

#23
post #3

A low-overhead environment like this must be perfect for HPC applications, i.e., when you want to use a computer in its primary function (to perform calculations, as fast as possible).

I bet it doesn’t do that well.

Here’s an example. I have a program that does a lot of memory allocation and reallocation. The memory management strategies in modern OS’s work wonders on this, better than a custom allocator I can write in a reasonable amount of time. In bare metal os I would lose this all for the advantage of not loading an os that tends to stay out of the way unless needed anyway.

Where I see use for this is more likely in situations where time to boot is critical but actual resource requirements minimal. Things like a simple kiosk system or embedded hardware.

Re: BareMetal OS

#24
There was a test with the 1BRC and it was shown that Rust was faster than Assembly (and likely C as well), meaning, a compiler will probably do a better job than a human optimizing code. How sure can someone be that this is indeed performant?

Re: BareMetal OS

#25

There was a test with the 1BRC and it was shown that Rust was faster than Assembly (and likely C as well), meaning, a compiler will probably do a better job than a human optimizing code. How sure can someone be that this is indeed performant?

OS performance comes from algorithms and data structures not from compiler optimizations.

Re: BareMetal OS

#26
post #17

It’s always fun to see this get brought up on Hacker News! I’m the developer behind BareMetal OS. Keep in mind that this is all geared toward raw compute and throughput. No ring-3, no multitasking (we do support multiple cores though), and no higher-level abstractions like TCP/IP or full-featured file systems. While it’s all coded in X86-64 assembly, a rewrite to ARM/RISC-V would be interesting once that hardware is…

> ARM/RISC-V would be interesting once that hardware is standardized. Could you elaborate on this? Both ARM and RISC-V have standardized their hardware feature and different target versions. Is it more on the iterative angle given X86-64 now moves very slowly?

While the ISAs are (mostly) standardized, the broader hardware support is a mishmash.

ACPI is available, but not widely supported.

Some hardware uses DeviceTree.

Other hardware just expects you to know what devices are connected and how to interact with them.

Re: BareMetal OS

#27
post #3

A low-overhead environment like this must be perfect for HPC applications, i.e., when you want to use a computer in its primary function (to perform calculations, as fast as possible).

I bet it doesn’t do that well. Here’s an example. I have a program that does a lot of memory allocation and reallocation. The memory management strategies in modern OS’s work wonders on this, better than a custom allocator I can write in a reasonable amount of time. In bare metal os I would lose this all for the advantage of not loading an os that tends to stay out of the way unless needed anyway. Where I see use for…

> Here’s an example. I have a program that does a lot of memory allocation and reallocation.

It's likely that if memory allocation overhead is part of your bottleneck, that using malloc() is actually a bad idea. Other management strategies such as arenas or rolling buffer will likely perform better. They're also trivial to implement ad-hoc.

Of course, you might arrive at the conclusion that the complexity overhead of custom allocation strategies[1] might not be worth it, but in this case, it means speed is not really an issue.

[1]: as well as, maybe, the necessary redesign of the application to fit those allocation strategies more elegantly.

Re: BareMetal OS

#28

It’s always fun to see this get brought up on Hacker News! I’m the developer behind BareMetal OS. Keep in mind that this is all geared toward raw compute and throughput. No ring-3, no multitasking (we do support multiple cores though), and no higher-level abstractions like TCP/IP or full-featured file systems. While it’s all coded in X86-64 assembly, a rewrite to ARM/RISC-V would be interesting once that hardware is…

The spirit of TempleOS is alive and well!

Re: BareMetal OS

#29
post #27

Earlier quoted context omitted.

I bet it doesn’t do that well. Here’s an example. I have a program that does a lot of memory allocation and reallocation. The memory management strategies in modern OS’s work wonders on this, better than a custom allocator I can write in a reasonable amount of time. In bare metal os I would lose this all for the advantage of not loading an os that tends to stay out of the way unless needed anyway. Where I see use for…

> Here’s an example. I have a program that does a lot of memory allocation and reallocation. It's likely that if memory allocation overhead is part of your bottleneck, that using malloc() is actually a bad idea. Other management strategies such as arenas or rolling buffer will likely perform better. They're also trivial to implement ad-hoc. Of course, you might arrive at the conclusion that the complexity overhead of…

Fun fact I literally implemented a memory pool since most of the allocs were on the same sized structs and did worse than the os allocator.

Re: BareMetal OS

#30
post #27

Earlier quoted context omitted.

> Here’s an example. I have a program that does a lot of memory allocation and reallocation. It's likely that if memory allocation overhead is part of your bottleneck, that using malloc() is actually a bad idea. Other management strategies such as arenas or rolling buffer will likely perform better. They're also trivial to implement ad-hoc. Of course, you might arrive at the conclusion that the complexity overhead of…

Fun fact I literally implemented a memory pool since most of the allocs were on the same sized structs and did worse than the os allocator.

That's possible. Maybe that such OS "unfairly" stacks custom options against its malloc implementation.

But I wouldn't be so sure to claim that such a pool, implemented in assembler on an OS that leaves everything to you, wouldn't outperform the os allocator you refer to. After all, there is fundamentally less information to manage.

Post reply on HN