Long day of work and what-not and everyone's been arguing amongst themselves over a bunch of stuff that has nothing to do with my design
. I'll respond in reverse order (newest first) so nothing gets missed here:
First, just to clarify...
Combuster wrote:Processes, tasks and applications are ambiguous terms to say the least
Couldn't agree more... in my head I have a tendency to think that "processes" are one or more "threads" in a single unique memory space. Therefore multiple "threads" may share the same address space, but no two "processes" (or related "threads") may use the other's memory space under normal conditions. Loose definition, but computers aren't limited to one specific paradigm like that, so you can call anything you want anything you want.
In regards to this system, we're using the "process" as I just described above, and "worker", "thread", "task", and "job" to mean "thread" as described above. It's pretty simple, it's a mono-process system with exactly CPU-count number of threads (one as the main process thread, and the others sticky to each remaining CPU). The exception here of course is that the drivers run in CPU0 as well, but it's not such an exception that the spirit of the design couldn't be called mono-process/multi-tasking (I mean, TSRs existed for MSDOS that could hook the PIC, but no one would argue that it's not a mono-process OS).
That's all I have to say about that so I'll skip up past the next handful of posts arguing semantics...
Brendan wrote:bwat wrote:Brendan wrote:Are you sure you're not talking about "embedded bootable applications"? I can't think of an OS intended for embedded use that is a modern OS but doesn't support multiple processes in some way.
Multiple processes does not mean multiple application. There's no need to confuse the two. To give a specific example, the old Ericsson EMP modem which can be found in many smartphones was an ARM chip running Enea's OSE operating system and a single control application which was broken up into several processes.
So you agree with me, except that in order to continue being an argumentative troll you had to pretend that 2 of out 2 million or more is "plenty" while ignoring the fact that "almost all" is not "all"?
I was
hoping to get some feedback on the design, not argue over the practicality of designing for an embedded system market while focusing on the x86 arch (which doesn't even apply to OdinOS right now).
Moving on...
Brendan wrote:To save time here's some possible suggestions that you could've attempted if your head wasn't firmly jammed somewhere warm and smelly:
Brendan wrote:"It reduces the number of TLB misses and/or cache misses (compared to "one or more applications" when only one application is being run)". Note: This is false.
You're wrong. I'm not going to be nice anymore. You're flat-out-unarguably wrong. Remember when I said, "correct me if I'm wrong" when addressing that earlier, I was just being socially "nice". I followed up with being nice and not calling you flat-out wrong, but... yes... you're wrong. Any unnecessary cache miss or invalidation, any unnecessary inefficiencies in branch prediction, any unnecessary major/minor page faults, any at all, even the slightest bit, is needless expense (and in many cases, very expensive). Why you keep stating that it's negligible simply because you're confusing the idea that having a lot of things that a system can do is worth the cost of context switching with your particular design vision, completely ignoring the very fact that context switching, but it's very inherent nature is simply expensive. Stop confusing a big picture design idea (in your head) with the in-the-moment reality during a context switch. I'm looking at it from a pure "inherent nature" perspective, and you're looking at it from a "acceptable/negligible cost of doing business for what I want to achieve" perspective... stop confusing the two.
Brendan wrote:"It makes something easier for the end user (or the person using the OS as part of an embedded system, or whatever). Note: This is false too.
Who said that? You just did, but I didn't see anyone else in this thread say anything along those lines.
Brendan wrote:"It reduces the size/complexity of the OS". Note: In general this might have been a valid reason (e.g. back when CPUs were 8-bit); but not for the OS that mrstobbe described (that runs drivers as processes and needs the size/complexity involved anyway).
No, this is still absolutely valid. It will never be invalid unless computers suddenly turn into processing gods who magically give the answer 42 before you even think up the question. Any reduction of complexity adds to the overall efficiency of the system. Again, I think you're just thinking, "Ohhhh... I can do a lot and there doesn't seem to be any major ramifications... CPUs just get better... memory gets cheaper... etc". You're really missing a bigger aggregate picture entirely. As for my design, it can clearly be incredibly simpler (even with a powerful event-driven API) than any common modern general-purpose OS. At this point, I really don't think you have any kind of a solid grasp of even the basics of my design, so it's pretty hard for you to make statements like that and look reasonable. Go re-read it. I'm pretty much done being nice with you here. Still don't agree after re-reading it and the exact same arguments? Fine... but keep them to yourself because you've said the few things that have made me think you'll probably ever say, and ten times more irrelevant and false things on top of that.
Brenan wrote:"It makes it easier to do a real time OS". Note: This is false (you just need a real time scheduler, and there's plenty of existing real time OSs and research papers to choose from.
Again, not relevant.
Well... that was a whole bunch of negative writing... moving on, hopefully this one's a positive contribution.
OSwhatever wrote:mrstobbe wrote:Hypothetically they then could become almost perfectly CPU bound as work demands, but would be extremely energy efficient while more "idle". In a general purpose SMP design, there is tons of context switching going on even in a mostly "idle" scenario, which is expensive in terms of energy, and a process (or processes) never get the opportunity to fully utilize a CPU because they are constantly being preempted at that point.
Um no, when my microkernel is idle, the CPUs are really idle. There is no context switching going on at all and they are just waiting for some external event.
Yes, the same could be said as true for monolithic kernels as well. That's really not about whether a kernel is monolithic or micro in nature, but I was comparing this system to general purposes OSs that have a bunch of processes constantly running, many of which are frequently switching in because they need to do simple "book-keeping" tasks or "check-and-sleep" tasks if nothing else.
OSwhatever wrote:As you bring up that your goal is to reduce power consumption, there are systems where your model can be beneficial. For example a system with one less powerful but extremely power efficient CPU cores and then several bigger cores that are powerful but draws a lot of power. Having only the power efficient CPU handling the interrupts might be good in this case as that can prevent you from powering up the bigger ones and this is the one that wakes up the other ones if necessary.
Ooohhh... definitely going to research that... building support for that into the kernel may end up being fantastic. Thanks!
OSwhatever wrote:[snip... more (good) stuff related...]
Definitely a good idea. I should probably stub out the basic separate architectures for the time being in the build tree. For the time being though I'm focused on cheap commodity server hardware... the kind of stuff that gets deployed 10-50 servers at a time. That means x86 (in fact, I'm only focusing on long-mode right now). Simple market fact. Wonderful idea though (at least to experiment with).
The whole problem so far is that (what you're trying to help address here), is that I have no idea how efficient the main CPU0 stuff will be if I take this road, regardless of architecture. It might be far more expensive than I would like, and might end up being a major bottleneck. I keep going back and forth in my head about how I should approach it.
Thanks for some great input!
Moving on...
Brendan wrote:bwat wrote:Absurd and childish. Why can't you accept that the OP is designing this system and he/she just might have needs that you do not share. If the OP wants to build a dedicated system then he/she is free to do so, and very possibly justified in doing so.
It surely isn't beyond your imagination to envisage a scenario where a dedicated OS is going to be preferable to a general OS.
It is beyond my imagination - I can't think of a single sane reason for "single application" for a modern OS (regardless of whether the OS is intended for a special purpose or not).
Sigh... Brendan, my point exactly, see my previous comments in this post.
Brendan wrote:Do you honestly think that Google or Facebook use "single application only" OSs? Why would they bother when any "as many application's as you like" OS is capable of only running one application?
First, I know people at Facebook (but not at Google), and yes... what I described (one single purpose per system, and X number of those systems load balanced and fail over capable) is exactly what they do. Everyone else I know does it too. You've never even done a dig to find out that a company has a large round-robin dns pool? What exactly do you think is behind that pool? You think those IPs point directly to the "end" servers? No they point to load-balancers. What do you think is behind those load-balancers? An array of servers each with static http, dynamic http, dns, db, mta, backup, etc... all managing to be magically in sync with each other? It shocks me that you seriously haven't even given this any thought even if you don't have any direct experience with it. It was actually a rhetorical question and I didn't expect you to actually come back and literally think that large infrastructures don't do this. I think it's completely common knowledge for most nerds, even ones not involved in server infrastructure themselves. Basically you just screened out to the world, "I have no idea how the modern internet operates at all!" That's perfectly fine (there's nothing wrong about having a lack of knowledge about something), but don't pretend like you do. That's really what's irritating me right this second. You act like a know-it-all.
Sigh... more negative crap... moving on.
Brendan wrote:The problem with running multiple operating systems under virtual machines on the same physical hardware is that those OSs don't/can't cooperate to ensure that the most important work is done before less important work. To allow more important work to be done before less important work, it's far better to run both applications under the same OS. This has the additional benefit of avoiding the overhead of virtualisation.
Ummm... correct if it mattered. That's presuming that both OSs are general purposes SMPs but they don't know how to talk to each other. Where is it even implied that either of those conditions are met. The only thing implied was that the host OS is
probably general purpose [Xen virtualization under Linux or what-not]). Man you like arguing without thinking. This a hobby for you?
Brendan wrote:I didn't say that I expect servers to be general purpose; only that you can have special purpose servers without pointlessly crippling a kernel for no reason.
Holy monkeys... seriously. Doing these responses in reverse is amazing. Not only have you been making that clear from where I picked up on this response, you were just as adamant about that before this very statement. Here, let me google, no wait, quote that for you...
Brendan wrote:mrstobbe wrote:Brendan wrote:Finally; there's a severe difference in magnitudes here. For example, to avoid a task switch that might cause a few microseconds of delays, you're considering wasting entire CPUs for many seconds.
Wait, what? Explain if you could please. I can't even remotely envision this at all.
Ok, imagine a computer being used for a HTTP server. There's 4 CPUs and 4 threads, and all CPUs spend 95% of their time waiting for network and/or waiting for disk.
Now imagine you also want to run an FTP server too. You've got 4 CPUs that are 95% wasted, but you can't use that wasted CPU time for the FTP server because the OS can't handle that; so you have to go and buy a complete second computer so that the FTP server can waste 95% of 4 more CPUs.
To avoid wasting a tiny little bit of CPU time (with task switches), you're wasting massive truckloads of CPU time.
That's just the very beginning. Just enjoy reading your own posts from start to even where you made the comment "I didn't say that I expect servers to be general purpose" in this thread. Seriously, get a glass of wine or whatever and take your time. So you're saying, a server should be able to do quite a few special-purpose things (let's just say, picking some based on your posts here, HTTP server, backup, and pre-building some sort of cache). Right? So you think I, or anyone, would design an OS specifically to do those three things? No, that's called a general-purpose OS. To go back to quoting you, "Now imagine you also want to run an FTP server too"... yeah, well it's a general purpose server at that point. This is exactly your argument. I'm seriously... speechless... that you've been making this argument and then suddenly, out of the blue, contradict yourself, only to switch back to making that same exact argument.
Are you for real?
Holy crap, again... moving on (please be something good, please be something good)... evidently not...
Brendon wrote:mrstobbe wrote:Brendan wrote:If one process starts a second process and waits until the child process terminates, then that's 2 processes (where only one is given CPU time, but both share memory, have file handles, etc) and not a single process. Of course if you're planning to have drivers running in their own virtual address spaces (as processes) it's not really single process anyway; and you're effectively doing "multiple processes and multi-tasking, with different obscure limits on what different types of processes can do".
Pure semantics... if one process starts another but can't exist (in terms of processor... can't see the light of day again) until the other one exits, it's still a mono-process system. Again, pure semantics.
If an elephant has ears, legs and a heartbeat, and you temporarily pause its heartbeat, does the elephant cease to exist? Of course not.
If a process consists of a virtual address space, one or more threads, and any number of other things (file handles, signal handlers, etc); and you pause its threads, does the process cease to exist?
You can call it pure semantics if you like; as long as you understand that the semantics you've been using to describe your ideas are extremely confusing because you've mangled the terminology every else uses.
You're an idiot. Officially. Let me give you a medal. By your logic everyone should think of a kernel as a process as well. Oh wait, there's the BIOS to consider too. Maybe the video BIOS as well? Crap, we forgot about that custom RAID card with it's own stuff going on. Therefore, since the dawn of man, there has never been a mono-processing system. Of course... I see the light of day, something has a resource and therefore it's automatically considered a process, therefore it's a multi-process system. Never mind the fact that to be a multi-process system, you have to schedule those processes. Sorry, would the term "task" work for
you better there? How about multi-
tasking system? Was MS-DOS a multi-
tasking (using that term just for you) system because it had COMMAND.COM which could then execute something else? It's freaking semantics. You're the type of person who doesn't listen to anyone else. You hear the words, but don't actually listen to what's being said because all you care about is when it's your turn to talk so you can attack those words. I bet it makes you feel smart a lot of the time doesn't it? My ideas seem to be "extremely confusing"
to you, and only you. Not a lot of other people have chimed in, but they also haven't reverted into some sort of primal "hey, look at me! i'm smart! you know how you can tell? you're wrong about everything no matter what it is!" state over the basic idea simply because they didn't understand it (or, as I gather by now, a lot of basics about modern usage of computers). I asked you what I should do to clarify things and all you've done is come back and just act like a know-it-all and look like a prick. If you were confused, why didn't your first reply start with, "I'm confused. This, this, and this doesn't make sense to me. By 'term a' do you mean 'definition that I think is term a'? Can you please explain some of your ideas to me? I think I understand this and that, but think you might be wrong about this because of that, that, and that." How do you think I would've responded? You think this would have been a fun and productive dialog? Instead your first two posts were you trying to puff up and look like you knew what you were talking about. You subsequently, and systematically followed up with the most brain-dead, mostly off topic, argumentative just for the sake of arguing replies through the duration. bwal is right about you. I tried to be nice and even (several times) "agreed" with you in hopes of getting a better conversation started, but please stop posting in this thread.
Major sigh. If you can't have a reasonable conversion about OS design on one of the few forums in the world that deals only with that subject, then there's something wrong. I mean, I can be a bit of a jerk when I'm in a bad mood posting, but Brendan, you're just a troll. I probably don't even think you know it either.
Sadly, that looks like that's the end of replies too. I was hoping for something positive to end on. OSwhatever, at least there's your comments about the high/low power CPU thing. Productive.
I am being genuine in asking for comments, suggestions, concerns, red-flags, criticisms, etc. Please share them. I sincerely apologize for having to take up almost an entire post addressing Brendan in a progressively negative manner, but I think it was warranted. Brendan is hopefully an exception to the rule here.
EDIT: Cleaned up a tiny bit of bad grammer (stupid brain
)