Live data from Hacker News

Thor – A minimalistic operating system in assembly and C++

github.com

41–50 of 152 posts

Re: Thor – A minimalistic operating system in assembly and C++

#41
post #8

Earlier quoted context omitted.

Yes, but his opinion counts more than some John Doe's as Linus supports his case with solid arguments.

'It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C' Solid argument that. His two other arguments: - infinite amounts of pain when they don't work (and anybody who tel…

> Considering that the linux kernel is strongly tied to the specific C dialect supported by GCC and is not portable at all, this argument is bullshit.

Linux has been ported to over two dozen architectures so it is extremely portable. Yes, it is tied to some GCC behaviors, but many operating systems are tied to compilers. Some extensions make the code identical across different archs, like __builtin_return_address.

Windows is tied to particular C features, which is why MSVC is resistant to C99. Plan9 was a special dialect and compiler of C.

Re: Thor – A minimalistic operating system in assembly and C++

#42

Can an operating system be developed from scratch using a safe language such as Rust? If yes, why people still even think about doing it with unsafe languages?

You can write a kernel in pretty much every language. There are some experiments with Rust: http://www.randomhacks.net/bare-metal-rust/

There are several reasons to choose a language rather than another. I personally don't like Rust at all, so I don't see any reason to use it, neither do I see any advantage in using it. But that's only my opinion. A lot of osdev currently is made by hobbyist (not counting the handful of really succesful kernels), so the main argument is simply personal and there is nothing wrong with it. Moreover, keep in mind that Rust is pretty new while C/C++ are decades old, this means more support, more portability, more people that know how to use it, ... This is not negligible at all.

Re: Thor – A minimalistic operating system in assembly and C++

#43

Can an operating system be developed from scratch using a safe language such as Rust? If yes, why people still even think about doing it with unsafe languages?

Sure it can and it has been done multiple times, although the industry hasn't cared much besides high integrity software, where software errors cost human lives.

For an example, check the "Project Oberon" book.

http://people.inf.ethz.ch/wirth/ProjectOberon/index.html

The revised 2013 version, with its own FPGA as replacement for the Ceres Workstation hardware of the original version.

Re: Thor – A minimalistic operating system in assembly and C++

#45
post #6
post #4

Earlier quoted context omitted.

That's Linus's opinion, yes. Not everyone has to share it.

It's a really annoying widespread opinion. I've been looking for people who really do write OSes in modern C++.

BeOS, Symbian, L4, Genode, Mac OS X drivers, and big parts of Windows are all examples of C++ use in OS development.

Re: Thor – A minimalistic operating system in assembly and C++

#46

Can an operating system be developed from scratch using a safe language such as Rust? If yes, why people still even think about doing it with unsafe languages?

> Can an operating system be developed from scratch using a safe language such as Rust?

We don't know.

> If yes, why people still even think about doing it with unsafe languages?

Because it works.

Re: Thor – A minimalistic operating system in assembly and C++

#48
post #2

Last week I read the very good 'How to build an operating system from scratch' [1], and I'm glad I did. It meant that I could burrow into the files on this github project and understand exactly what was going on. One day, when I finally have some free time, I am totally going to do this myself. --- [1] https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures...

I read this same exact article last week too, what are the odds! Definitely have the same mindset to write my own someday. This project will be a ton of help.

Re: Thor – A minimalistic operating system in assembly and C++

#49
post #31

Earlier quoted context omitted.

I will! I'm guessing you mean these..? http://www.brokenthorn.com/Resources/OSDevIndex.html

They are pretty good indeed to begin with. However, the best resource there is is clearly osdev.org, both the forums and the wiki are full of information!

Here's a better direct link to osdev.org info: http://wiki.osdev.org/Main_Page

Re: Thor – A minimalistic operating system in assembly and C++

#50

Earlier quoted context omitted.

'It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C' Solid argument that. His two other arguments: - infinite amounts of pain when they don't work (and anybody who tel…

> Considering that the linux kernel is strongly tied to the specific C dialect supported by GCC and is not portable at all, this argument is bullshit. Linux has been ported to over two dozen architectures so it is extremely portable. Yes, it is tied to some GCC behaviors, but many operating systems are tied to compilers. Some extensions make the code identical across different archs, like __builtin_return_address. Wi…

The context of course was portability to different compilers, not architectures.
Post reply on HN