has anyone ever tried to calculate the performance losses incurred by having a program run on top of an OS instead of on bare metal?
It would actually be a performance gain since OSes allow proper multitasking.
>>108843195No because you can't run the same program inside an OS and on bare metal. This is not the same thing as cross-platform programs because even those rely on a common syscall interface, but with bare metal you don't have a syscall interface because YOU are the OS.
>>108843195>>108843525TempleOS got the closest to this (still a OS but ring 0 no virtual memory and single address space) and the difference was huge in context switches per second for example, wouldn't be too surprising if lot of other things were faster.But really the question should not be "would it be better without the os" but more like "can we made radically different os from what we have" and "do we need general purpose os for everthing"?
>>108843195Yes, check Doom 3 on OG Xbox (bare metal) vs a similar PC (Pentium 3 733 Mhz, 64MB V+RAM, GeForce 3-tier)hint: it can't run on the PCThat should give you an idea
>>108843195Why would you even assume it is not common to calculate that make decisions based on results?It is something people actually do when they decide between Linux, RTOS or some libs maybe, if they don't need any OS at all.>>108843267It's not always needed.
Yes. Old game consoles especially.
>>108843892Has anyone really been far as decided to use even go want to do look more like?
Somewhat related is security. With or without an OS.It's insane and frustrating how simple and fast software can be if you do not care about security. Every bit of it is complex mathematics to intentionally obscure and that comes at a cost both to execute and to write (correctly). Combine this with registries of credentials and capabilities etc. you now need whole systems running all the time and coordinating and none of this actually has to do with your program in principle, it's just there because people can't be trusted and no other reason.
read stories for software like bc running without os, calculations are like from 1960s
>>108843525but there must be SOME way to quantify the losses
>>108843195Sure. Anyone working on mainframes. So IBM for sure. Maybe oracle too
>>108843195>>108847011The losses are, in effect :>context switching(saving registers, once per thread switch, happens whenever the thread's allocated time quantum has elapsed or the program does a yield() call)>other threads competing for L3 cache space and bandwidth, RAM bandwidth and pollution of bank switching(yes, that RGB software waking up and using the CPU even for 10000nanosecs has a difficult to amortize cost despite DDR5 being built to handle simultaneous RW)>(multithread CPUs)threads competing for CPU core register file(some CPU designs statically or dynamically allocate core resources) and execution ports(this is particularly bad if they compete for fpu ports, even if any execution port being used could reduce performance)This is why the potentially only correct way to remove potential stutters in videogames is to have the game threads hog the correct cores and let the rest occupy so called estrogen cores/X3Dless CCD/least good CCD or the 2nd logical cores of all cores, at least you reduce context switching bullshit to a minimumThis is also why latency trannies who believe in the "AMDip" boogeyman recommend using windows registry "fixes" to change threading to enforce longer thread allocated time(quantum), not realizing it may backfire if the RGB or chromium pisscord software hogs a core for longer than it would have without that "fix"
>>108843773Xbox has a windows based OS. It isn't running software on bare metal.
>>108843894Mario 64 uses a different thread for audioThere is still a thread context switch overhead, the only clue why they did it this way i have is that the early dev was done on the SGI workstations which do use MIPS hardware and do actively run an OS, perhaps it made sense because the N64 CPU is MIPS too and has the threading functionality anywayNo idea about PS1 and DC however
0 aka no losseswhat OS does program will do, so program will become the OS and do the same thing, thus, calculated.
>>108847129You're right but I just meant game consoles and game devs of the time specifically knew the benefits of running bare or making their own micro OS more similar to a BIOS on some even older machines.In the case of SM64 the devs did the best they could at the time with limited experience of the new platform, 3D graphics, tools, etc.A guy named Kaze is hyper optimizing the SM64 decomp to absurd degrees and highlights a lot of the mistakes and flaws the original team made.Not to discredit their work, but it further pushes the point of performance when you decide to target a very specific machine without an OS rather than trying to abstract the hardware in some way.His custom game built on the same hardware looks like a GameCube game and runs at 60fps.That's insane to me. A generation ahead was technically possible at the time, but obviously not practical to produce at the time due to lack of insight and other things.Countering myself, there's also cases like the PSP which had an OS but till blows my mind with the results considering its specs. 222MHZ and 32MB of RAM ?!? wowMuch like the PS1.
>>108843195It's just about fuck all, especially if you give your program exclusive use of its cores.
>>108847460It's more like millions, tens of millions absolute top. They're just a fancy warehouse at the end of the day. The contents are way more expensive.
>>108847127it runs on bare metal, only one process is allowed
>>108847108You missed the biggest factor: virtual-to-physical address translation. The performance overhead for that is around 30%.
>>108843195I run XP and 7 on bare meal for GPU access in their vlibrary of software as well as using optical drive DRM shit offline, thus facilitating the vast physical media library I picked up for peanuts as well as stuff like the sidewinder force feedback
>>108843195>calculate the performance lossesome shit just will not work in a VM
>>108847332>Countering myself, there's also cases like the PSP which had an OS but till blows my mind with the results considering its specspsp is an asesome little piece of tech
>>108843195yes, os devs have/thread
>>108843195the real answer is don't use a non-deterministic OS and this isn't a worry
>>108843195I believe SpinRite used to run on some mini OS before it became a standalone thing. It's been a while though, but you can probably find changelogs and test results of before and after. Afaik it's significanly faster.