Live data from Hacker News

Essence: Desktop operating system built from scratch

nakst.gitlab.io

221–230 of 299 posts

Re: Essence: Desktop operating system built from scratch

#221

Earlier quoted context omitted.

I did this in the mid-90s when this book came out: https://www.amazon.com/Developing-32-Bit-Operating-System-Cd... I knew x86 well from demo scene coding, and I had the Linux and NetBSD sources to help, but the hardest bit was just getting all the boot sector stuff going properly and getting the processor into 386 mode as soon as possible. I wrote an entire OS that booted into a windowed GUI, multi-threaded, file sys…

Very cool! Do you have insight into why modern operating systems consume gigabytes of disk space and require so many system resources?

Because they do a lot more? The video demo is the happy path. It's perhaps hard to notice things like the image viewer supporting drawing things on the image but not supporting saving the resulting file, or the lack of alt-tab.

Also, Essence is basically a Win32-like system (with some very small use of C++ but e.g. using char* instead of std::string). The kernel is handling graphics and the windowing system, like it used to do in Windows. Even the eyedropper you saw has kernel mode support.

https://gitlab.com/nakst/essence/-/blob/master/kernel/window...

Yes you can get very efficient code this way but only at a cost of low programmer productivity / reliability / security, especially as the code scales up to more than one developer. For a hobby OS it doesn't matter. For a commercial OS it's not good enough, hence Apple/Microsoft's investment in .NET and Swift. These consume more resources but make it easier for programmers to avoid mistakes and work together.

Don't get me wrong. I'm loving the style, the panache, the clean code, the ambition. Fantastic project. But it's a bit naive to ask "why can't all operating systems be like that?". Operating systems written by one guy will inevitably be fast and light compared to an OS that's 30 years old and which has 10,000x the number of features (at a conservative guess).

Re: Essence: Desktop operating system built from scratch

#222

So many interesting/fascinating concepts and ideas that will remain relegated to niche communities because of basically one problem: lack of drivers. This is the problem that must be solved if we ever want to move away from the dominance of a few OSes "too big to fail" and their million compromises to a thriving field where competent programmers can create new OSes as easily as now they can create new apps.

This used to be the case but, nowadays, there is a second problem, which is lack of web browser. Now, in addition to deal with present and future hardware, you need to deal with present and future web technologies, or your OS will not succeed. This makes it more difficult for amateur OS designers.

All this said, it makes me very happy that some people are brave enough to keep trying.

Re: Essence: Desktop operating system built from scratch

#223

So first off: Very cool. Amazingly polished, and self-hosting! Especially since it looks to be an actually-independent project with POSIX as an optional compat layer. I feel like the features that are unique are mostly in 3 groups: 1. Features that shouldn't be unique to this system. Tabbed windows have occasionally happened on other systems, and probably should become more common, and there's no reason it shouldn't…

An example of 1) were the Windows Sets that were planned for Windows 10 and eventually dropped due to integration issues with legacy Win32 apps

Re: Essence: Desktop operating system built from scratch

#225

Earlier quoted context omitted.

> Also note that the user will be confused when they delete the whole directory and observe 0 bytes get freed. Note that's already the case when the user removes files that are opened by some process.

On Linux yeah. On Windows no.

On any non POSIX system.

Re: Essence: Desktop operating system built from scratch

#226

That's cool. Though that's C/C++ again, unmanaged memory can't be considered safe in 2021. We need different things.

This type of comment is getting so old I wonder what can be done about it. Maybe the reason why we don't have "different things" is because users of these so called safe languages are too busy arguing online about how safe their programs are instead of actually writing anything worthwhile. Meanwhile operating systems will continue to be written primarily in C/C++ for the forseeable future

In case you check what I'm doing with my safe language you may be surprised. That's something new and worthwhile. Not an OS unfortunately, I would be happy to work on that but I can't live from that.

> Meanwhile operating systems will continue to be written primarily in C/C++ for the forseeable future

And we will continue reading about lifes ruined by bugs and people killed by exploits. There is no sustainable future with unsafe foundation.

Re: Essence: Desktop operating system built from scratch

#227

So many interesting/fascinating concepts and ideas that will remain relegated to niche communities because of basically one problem: lack of drivers. This is the problem that must be solved if we ever want to move away from the dominance of a few OSes "too big to fail" and their million compromises to a thriving field where competent programmers can create new OSes as easily as now they can create new apps.

This will never change, it has always been like this since computers exist.

Re: Essence: Desktop operating system built from scratch

#228

That's cool. Though that's C/C++ again, unmanaged memory can't be considered safe in 2021. We need different things.

Rust is an ugly language that is not fun to use. There is one OS written in it (Redox) and it's progress is very slow. It's actually less work to audit C++ code manually to find memory unsafety than it is to use Rust and get that safety "for free". Sorry to say these things out loud.

> Rust is an ugly language that is not fun to use. There is one OS written in it (Redox) and it's progress is very slow

Yes, you are right. We need to invest lot more resources into that. And we need languages better than Rust.

> It's actually less work to audit C++ code manually to find memory unsafety

Nope, you are fundamentally wrong. And every new zeroday shows that you are wrong.

Re: Essence: Desktop operating system built from scratch

#229

This is an amazing piece of work, but it's clearly a labor of love: this isn't going to have any real-world use any time soon. Where operating systems are headed is more towards security (process isolation, bulletproof input etc), not lightweight GUIs on top of thin kernels like this. Are there any passion (or other) projects that explore this? I know about Qubes, but that's more like a heavy layer on top of a heavy…

> this isn't going to have any real-world use any time soon. If it was ported to ARM and had a decent GUI interface builder, it could become a killer OS for making interface panels for appliances. Some manufacturers are repurposing Android for this task, however this forces them to use much powerful hardware, and their UX is still laggy.

The easiness to hire contractors to take care of programming the respective apps wins over the possibility of cheaper hardware, that is why they are moving into Android and not a POSIX OS with Qt or something like that.

Re: Essence: Desktop operating system built from scratch

#230
post #91

Earlier quoted context omitted.

Usually orthodox c++ looks something like: https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b this is from bgfx

> UPDATE As of January 14th 2019, Orthodox C++ committee approved use of C++14. So it is basically Modern C++, just a few years later.

It's 2022, so perhaps the committee will approve features from C++17.

Now, all things considered, having used bgfx in various languages, I think the Orthodox C++ approach leads to quite clean code.

Post reply on HN