Live data from Hacker News

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

github.com

141–150 of 152 posts

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

#141
post #138

Earlier quoted context omitted.

What OS are you using? Is it working for you in VGA text mode (no x11)? Is this now working on other UNIX-like OS besides Linux? I have had problems with -nographic in the past and I know others who have as well, but maybe it works reliably now?

You mean can I run it without having X11 running? Yes, of course, with -nographic. How do you think most major VPS providers run qemu? They certainly don't run their hosts with X11 going. And yes, it runs on not-Linux, but obviously the main selling point of qemu is the access it provides to KVM, which is an interface provided by the Linux kernel. You can do software emulation of a number of architectures on a number…

Are you saying you yourself do this? You're using BSD, running in VGA textmode, from which you run qemu with -nographic to load an image of another OS? You yourself are doing this?

Most of "major VPS providers" I know use Linux, not BSD. (Yes, there are some exceptions but the reliance on Linux is almost universal.)

I would love it if you were right and I am wrong, but I seriously doubt you have tested this recently. I will happily give Qemu another go if you have tested this recently and it worked.

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

#142
post #141

Earlier quoted context omitted.

You mean can I run it without having X11 running? Yes, of course, with -nographic. How do you think most major VPS providers run qemu? They certainly don't run their hosts with X11 going. And yes, it runs on not-Linux, but obviously the main selling point of qemu is the access it provides to KVM, which is an interface provided by the Linux kernel. You can do software emulation of a number of architectures on a number…

Are you saying you yourself do this? You're using BSD, running in VGA textmode, from which you run qemu with -nographic to load an image of another OS? You yourself are doing this? Most of "major VPS providers" I know use Linux, not BSD. (Yes, there are some exceptions but the reliance on Linux is almost universal.) I would love it if you were right and I am wrong, but I seriously doubt you have tested this recently.…

Do your research, don't ask me to do it for you.

https://wiki.freebsd.org/qemu

qemu runs on Linux, OSX, Windows, and various smaller Unicies.

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

#143
post #34

Earlier quoted context omitted.

I think it's more about the feature surface. C++ is a gigantic language while C is fairly limited. I actually like C++ when I'm the only one writing it, but my experience has always been that for complex use cases (large) c++ code bases tend to always evolve to a mess of complexity, even with expert programmers. But yeah, smart pointers alone help a lot with writing tidy c++...

There was a time that C++ was considered a gigantic language. Just as there was a time that Common Lisp was considered so large that it collapsed under its own weight. Many languages, including "simple" Java, are about as large as C++ right now ( https://channel9.msdn.com/Events/GoingNative/GoingNative-201... , around the one-hour and fifteen minute mark). To be honest, one thing that makes working in C++ relatively…

There is a difference between language complexity and library complexity. The Java language is very simple, but the Java standard libraries are a collosal, complex system.

C++ the language is extremely complex and riddled with pitfalls and minefields. Just try to pin down the formal definition of such a widely-used term as "rvalue". OTOH I find the C++ standard library to be reasonably straightforward and well-designed. The STL in particular is brilliant.

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

#144
post #56

Earlier quoted context omitted.

I don't agree with Linus, but yes, boost is horrible.

I don't agree with you, boost is great.

Rather than continue with unsupported opinion, I'd rather make the specific point that Boost served well as incubator and proving ground for such constructs as shared_ptr and unique_ptr, which have been subsumed into the C++ standard as undeniably huge improvements. As a result, the unfortunate abortion auto_ptr has finally been able to be consigned to a well-deserved resting place in Hell.

Other parts of Boost have been considerably less impressive, and virtually nobody uses them. I struggled at length trying to get Boost::Parameter to work, with zero success. Boost::Format at least works, but ends up cumbersome, and does not approach the usability of {} formatting in Python.

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

#145
post #27
post #20

Earlier quoted context omitted.

As long as you avoid "virtual", I can't even think of any C++ features which would lead you towards worse performance characteristics than C. Templates may bloat your binary size and increase compile times, but they're plenty fast.

There's also making unnecessary copies of things like strings and vectors passed to functions and exception overhead (in binary size at least)

Rvalue references and std::move have largely obsoleted the argument of copy overhead. It makes particularly a dramatic improvement in container efficiency. C++11/14 really is a different language than C++98.

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

#146
post #141

Earlier quoted context omitted.

Are you saying you yourself do this? You're using BSD, running in VGA textmode, from which you run qemu with -nographic to load an image of another OS? You yourself are doing this? Most of "major VPS providers" I know use Linux, not BSD. (Yes, there are some exceptions but the reliance on Linux is almost universal.) I would love it if you were right and I am wrong, but I seriously doubt you have tested this recently.…

Do your research, don't ask me to do it for you. https://wiki.freebsd.org/qemu qemu runs on Linux, OSX, Windows, and various smaller Unicies.

So you are admitting you have not tested this and you are just going by what you read.

When was the last time you used any "smaller Unices"?

Anyway, even if the problems with -nographic on x86 have been fixed on other non-FreeBSD BSD's (and I have my doubts), my comment that compiling qemu has become a substantial undertaking still stands. I suspect you've probably never even tried compiling it yourself but that will not stop you from commenting.

I compile Bochs statically on low powered computers with no problems. Cannot say the same for Qemu. Even you're not using x11 they expect you to have x11 libraries at compile time. As with most programs that grow so large, there are more than a few dependencies one can do without.

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

#147

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?

Remember that since our general purpose computers are approximately Turing Machines, they can simulate anything, including better general purpose computers.

An OS is just a simulation of a "nicer" computer than the one that is natively exposed by the "real" one (i.e. the hardware).

Normally, "nicer" is pretty subjective, but in the case of computing it almost always means only two things:

* We simulate many more computers than we actually have (i.e. timesharing and multitasking)

* We simulate computers that are much easier to program.

In other words, an OS is just a simulation of having access to a bunch of nicer-to-program computers.

But, this ends up implying a multitude of features:

* Simulating many computers requires having a scheduler and process isolation. If we decide that we want individual users to have privileged access to their simulated computers, then we end up adding security features related to authorization and authentication. If we decide that the simulated computers should be able to communicate with each other, then we end up with networking since there is little difference between two simulated computers running on the same box, and two simulated computers that are running on different boxes.

* Simulating easier-to-program computers requires having memory management, virtual memory, I/O abstraction, graphics, portability, etc.

Since we end up with most, if not all, of the features that most people think are requisite for an OS, I think that my definition is minimal.

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

#148
post #34

Earlier quoted context omitted.

I think it's more about the feature surface. C++ is a gigantic language while C is fairly limited. I actually like C++ when I'm the only one writing it, but my experience has always been that for complex use cases (large) c++ code bases tend to always evolve to a mess of complexity, even with expert programmers. But yeah, smart pointers alone help a lot with writing tidy c++...

Brainfuck has a limited surface. That doesn't mean it isn't hard or error-prone.

But for a totally different reason. C++ is hard (to me, anyway) because it's gigantic and people tend to make it into a mess. BF is hard because it's intentionally obtuse.

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

#149

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…

Funny you should mention the Cortex-M :) https://github.com/helena-project/tock/ (written in Rust, just linked to it down thread as well)

$ grep -r unsafe | wc -l

292

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

#150
post #67

Earlier quoted context omitted.

The OSDev wiki is the best think to hit the internet since sliced bread (with cats faces pushed through them?) but it's far from a tutorial. It's a wiki. While it is one of the best repositories of knowledge on the subject of low level development, it's not a step by step guide. In the same way I don't recommend that people read Wikipedia to learn about human history I'd also not recommend reading osdev to learn abou…

I don't know but the Tanenbaum books."Operating Systems Design and Implementation" is old, but the appendix is the full C source code to Minix 3.0 if you buy the 3rd Edition. I had the 1st Edition with around 12K lines of C in the appendix. Great book, and I had Minix 1.5 running on my old Amiga around 1990. Minix was more portable than Linux, which came out around 4 year after Minix. I had my money on Minix when Lin…

> I had my money on Minix when Linux came along, since Minix was a microkernel, and I thought it sounded like the better direction to take. Well, Linux won

well, I am too young to witnesses the things, but I read from Tannenbaum, that his main intention was to keep Minix so small, that his students were able to understand it ine one semester. And that seems like a big limitation to me ...

Post reply on HN