An OS should be a series of programs connected to each other and the kernel, running on hardware.
A computer virus by definition is malicious.
I feel like there is some sort of miscommunication going on here about hardware. As bobastley said, the OS is like a gateway between the applications and the hardware.
The chain of command goes:
power cord → computer hardware → OS (and in the OS everything goes back to the kernel) → applications
So, the apps go through the OS to the hardware for everything, including system resources (CPU, RAM, etc.), speakers, and internet. The OS will need drivers to support the hardware (Linux has most of them built in to the kernel) in order to even run. Then it needs apps that support the OS.
I would not recommend building an OS from scratch, especially if you don’t have experience with low-level concepts like I didn’t when I first asked the same question.
The reason why there are so many Linux distros is that the nitty-gritty is already developed, and programmers can simply use Linux as their base, and develop stuff that they actually desire. The only reason I even considered making an OS is because I wanted more control, and I personally feel Linux already has that control, not to mention it’s backed-up by the entire open-source community.
If you really want to consider making an OS from scratch. Let me clear a few things up. First, it’s not really possible to collaborate, at least in Replit. Testing and running your OS will be much more challenging than compiling a C++ program, and you will need to learn how to boot into it in the first place.
I’m gonna pass over some tips @mrhh69 suggested. Possibly start with a target machine like a Rasberry Pi or some other microcontroller, then move to an actual PC architecture (such as x86 or something) and design a simple Kernel. Try to watch some tutorials and google around to get a better understanding, before jumping in like I tried to do.
Whatever you do though, try to get an actual understanding of concepts rather than copying and pasting, which was kinda the reason I created that topic anyway.
Also, just want to clear something up about this. If you designed an OS, (not sure if it is just limited to from scratch or it applies to Linux too), you will not be using any of the following except C, C++, or possibly Rust.
These languages are the only ones compatible with low-level operations. However, if you could get your OS to support it, it may be possible to develop applications within the OS in other languages. (Batch is out of the question though, and Bash only applies if your OS is Linux-based)