Live data from Hacker News

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

github.com

101–110 of 152 posts

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

#102
post #45
post #6

Earlier quoted context omitted.

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.

I think only L4/Fiasco.OC and L4ka::Pistachio are C++; other L4-style kernels (seL4, OKL4, among others), including L4 proper, are written in C.

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

#103
post #94

Earlier quoted context omitted.

Yeah, still have my Be CDs stored somewhere. However regarding Microsoft, I actually think that vendors were as guilty as Microsoft. They could have chosen not to take Microsoft's discount and try to sell alternative OSes, even if it meant having to face a few challenges. The one that takes is as guilty as the one that gives.

I would have to really dig for the emails the company sent out (I should have them archived someplace), but I thought the issue wasn't discounts, but a revoking of the license to sell Windows if the OEMs didn't comply. I did a quick search and came up with Quora answer given here: https://www.quora.com/Why-was-the-BeOS-dropped but this doesn't jive with my memory. I will have to see if I can find an old email or mayb…

Even if it was revoking the license, vendors had an option, and they have chosen the easy one out.

I remember quite a few small shops trying to put a fight selling other kinds of computers, they might have lost in the end, but they tried to walk a different path.

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

#104
post #79

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…

>>Sorry, but I take it personally when me and my colleagues are called substandard programmers. I don't know what kind of programming you do, but he is talking mainly about kernel programming. He is mainly criticizing the people who want to bring C++ in the kernel world. Anyone is welcome to prove him wrong. But I think, C++ is more suited for applications programming, where efficiency is not a prime concern and abst…

> Anyone is welcome to prove him wrong.

Apple and Microsoft already did.

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

#105
post #54

Earlier quoted context omitted.

Aren't large parts of Windows written in C++ ?

The kernel is written entirely in C. See various WRK releases you can find online.

Until Windows 8, which they introduced C++ support on the kernel and deemed C89 as good enough, with the way forward being C++.

Yes, the latest VC++ do support C99 library, because it is required by the C++ standard and the new MSVCRT.dll is actually written in C++ with extern "C" entry points.

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

#106

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?

> If yes, why people still even think about doing it with unsafe languages? What you need for OS or embedded development is a language that doesn't get in your way. C doesn't get in your way. C is the first language that both stayed out of your way and also provided reasonable productivity features (over BCPL, B, and assembly). It was only recently that people have figured out how to come close to a "safe" language t…

> C is the first language that both stayed out of your way and also provided reasonable productivity features

If we ignore the history of computers outside AT&T....

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

#107
post #79

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…

>>Sorry, but I take it personally when me and my colleagues are called substandard programmers. I don't know what kind of programming you do, but he is talking mainly about kernel programming. He is mainly criticizing the people who want to bring C++ in the kernel world. Anyone is welcome to prove him wrong. But I think, C++ is more suited for applications programming, where efficiency is not a prime concern and abst…

> The STL/Boost abstractions are much more inefficient.

Well, the STL/Boost libraries are designed for certain goals. If you have different goals, you should use something different. But in any case, which specific abstractions are you talking? Which scenario are you optimizing for and what common case, worst case perf numbers are you looking to hit?

>. (e.g. even name mangling can be a significant cost factor in Kernel.)

What in the world are you talking about?

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

#108

The hobbyist OSes pop up a lot on Hackernews. Some are more full featured than others. What would say is the minimum feature set to be called a real OS?

At least for my operating systems class, the requirement was to be able to boot and run a text editor, usually Vi. Didn't stop some people from building one that could run Doom though.

Ah. I was thinking something more like process isolation and device drivers.

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

#109
post #106

Earlier quoted context omitted.

> If yes, why people still even think about doing it with unsafe languages? What you need for OS or embedded development is a language that doesn't get in your way. C doesn't get in your way. C is the first language that both stayed out of your way and also provided reasonable productivity features (over BCPL, B, and assembly). It was only recently that people have figured out how to come close to a "safe" language t…

> C is the first language that both stayed out of your way and also provided reasonable productivity features If we ignore the history of computers outside AT&T....

Example? Standard language that never required a trip to assembly language for system level programming?

On IBM's, PL/I didn't cut it that regard.

On a UNIVAC you could do a lot of system programming in FORTRAN, but only because there were a zillion proprietary extensions that accessed system programming primitives.

BASIC on a Commodore 64 had PEEK() and POKE() but that doesn't count either, very non-standard.

FORTH? Nope... still asm at the bottom.

Concurrent Pascal? Nope... not safe, despite the type checking, because you could twist variant records however you liked. And I think there was asm at the bottom anyway, IIRC.

COBOL, well, CDC COBOL had a bunch of extensions, too, but you still ended up in asm for system programming.

Show me the source code for a device driver in a high-level language that pre-dates C/B/BCPL.

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

#110
post #47

+1 for being able to run on Bochs. There's nothing minimalistic about Qemu. It's an enormous resource intensive program to build. And it's not even easy to run in text mode (no x11). "Qemu-lite" is sorely needed.

It's actually quite easy to run in text mode, just add -nographic. It automatically hooks the serial port up to your terminal, too.
Post reply on HN