coderboy14 1 Posted May 26, 2021 Share Posted May 26, 2021 So, I wanted to develop a more unix/linux like operating system for OpenComputers, but of course Linux is a kernel, not an operating system - so I made a kernel, which I can then use for my operating system! Of course, being designed with a unix mindset, I am trying to follow the rule that everything can be represented as a file. Currently, your devices are all represented as folders, in the /dev folder. You can actually interact with the components by opening their files. Each component has a virtual folder with the address its assigned (in a linux format, like "sda") based on the driver assigned to it. In this virtual folder, are "files" that represent every method that the driver has informed the kernel of. By opening it, and writing to the handle (always use write for this, at least with how it's currently setup), it invokes the component's methods! Creating virtual devices, virtual files, etc. is also equally as easy. The file system controller doesn't actually care what you tell it to mount, so long as you pass it a controller that implements the right methods. Just write a driver for your virtual tree object, mount it to the file system controller, and wallah, it now may as well be a real thing. Adding a virtual component is just a tiny bit more tricky, since the '/dev' folder is a special virtual disk using custom instructions to manage the layout. While I think I've made pretty ok progress with the project, it still has a long ways to go. Not only do I want to add some more libraries to the kernel build, but I also need to test the ones I already have, since I'm almost certain I forgot about a few bugs, or just forgot to go back and implement placeholder code. I am planning very soon on writing some actual documentation for everything, but right now, you're mostly on your own for figuring out how things work. The kernel has an "init.lua" script to make it bootable and run some tests, but you'd replace that with the startup code for your operating system, just making sure to invoke the kernel first. I'll drop the GitHub link to my project. Everything related to this project is penguin themed, of course. I have only been using OCEmu so far to test my code, so I haven't the foggiest how it works on different device configurations in-game. Here's the link to my GitHub page Quote Link to post Share on other sites