Jump to content

Looking to create an OS that will run on Replit.com, looking for advice and assistance.

I am looking to create an OS that will run on Replit.com, a cloud-based coding website for those of you who don’t know, and am looking for advice and assistance. I barely know python and want to learn to code it in a different language because I know that python is not very efficient for things like this, and also would like to learn more languages to be a more advanced programmer. If you need more info, just ask. 

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, Peter_The_Ent said:

OS that will run on Replit.com

I don't see any VM options on their site. All i see is that it seems to be a GUI for coding or something like that. Your premise seems flawed. For an OS to run on a specific host website it need VM or at least some kind of docker which is "technically" a VM.

 

Nowadays there are more language that ca interface with controllers chips on different components. Basically you have the good old Assembly and C but there are couple others. I would personally stick to those and maybe try Rust a little bit. I recently seen someone making a switch running Rust so it does interface with couple things to an extent but I haven't dived into it enough to say it can do it all like Assembly can. Since it's C++ alike it probably can do most of the job but not all.

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, Franck said:

I don't see any VM options on their site. All i see is that it seems to be a GUI for coding or something like that. Your premise seems flawed. For an OS to run on a specific host website it need VM or at least some kind of docker which is "technically" a VM.

 

Nowadays there are more language that ca interface with controllers chips on different components. Basically you have the good old Assembly and C but there are couple others. I would personally stick to those and maybe try Rust a little bit. I recently seen someone making a switch running Rust so it does interface with couple things to an extent but I haven't dived into it enough to say it can do it all like Assembly can. Since it's C++ alike it probably can do most of the job but not all.

Like I said in the initial post, I am a beginner, so you are going to have to dumb that down for me. 

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

I don't think it would be very feasible to write an operating system on Replit or in Python, at least not an operating system in the way we typically think about them. One idea that would probably work in that environment is to write a basic task scheduler and task switcher, which is part of the core of an operating system. Try to make it so that you can give your "operating system" some functions to run as well as how long to wait before running them again. For example, you could give your OS one function that prints out "Hello World" every 10 seconds and another that prints out the current time every minute or second. These functions shouldn't be contained as part of the OS itself, but instead you should have a way to "register" the functions so that your OS knows to call them at whatever time interval you specify.

 

If you'd like to learn more about creating an actual operating system - one that can run directly on hardware, I'd first recommend checking out the C and C++ languages. These allow you to work much closer to the computer's hardware compared to Python, which is needed to make a more advanced OS.

 

Here are some guides you should check out if you're really serious about learning how to create an OS:

https://github.com/cirosantilli/x86-bare-metal-examples#getting-started

https://wiki.osdev.org/Main_Page

 

I don't want to discourage you, but writing an operating system takes a lot of hard work and knowledge in programming. Trying to take this on would undoubtedly make you a better programmer though.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, dcgreen2k said:

I don't want to discourage you, but writing an operating system takes a lot of hard work and knowledge in programming. Trying to take this on would undoubtedly make you a better programmer though.

I know. I also don’t care. I may not know the details of most programming languages, and kind of quoting @geerlingguy , I don’t want to do it because it is the best, I want to do it because I can. I believe it is possible. All an OS is is a special user interface that can run programs. I should be able to do the same in a programming language, even though it won’t be as efficient. I would like someone who can offer advice on what language to use and assistance if I need it.

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, Peter_The_Ent said:

I may not know the details of most programming languages, and kind of quoting @geerlingguy , I don’t want to do it because it is the best, I want to do it because I can. I believe it is possible.

That's the right mindset to have. My comment about this kind of thing not being well suited for Python is mostly because it runs in a virtual machine instead of bare hardware. Depending on what you're trying to do with your operating system, this may or may not be important to think about.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

You're asking how to build a car but you don't have a space to store your car and you don't have any tools.

 

If you think of an OS as the thing you see and click on when you use a computer, that is only one part of the complete package. Like the driver's seat and steering wheel of the car. There's an entire engine running that you don't even see.

 

BUT, it's ok to focus on just that part for now. There is no way to get there other than starting small and working your way up. Since you're a beginner, you have to start at the very beginning. There are many beginner's Python courses online. Pick one and go through it. All the way through it, even if it doesn't seem relevant to your particular goal. Because without this foundational knowledge, you won't be able to branch out to something more complex.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Peter_The_Ent said:

All an OS is is a special user interface that can run programs.

The GUI is close to the last step in making an OS. You need to build the core that speak with the components first.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Peter_The_Ent said:

All an OS is is a special user interface that can run programs. I should be able to do the same in a programming language, even though it won’t be as efficient.

No. You will need to use a programming language that compiles to binary code that can be run on the underlying archtecture directly (e.g. compiles to x86 or ARM instructions)

 

You can't use a language the requires an interpreter (e.g. Python) or a virtual machine (e.g. Java), because these in turn require an OS to run on.

 

The operating system is the part that communicates with the hardware (with the help of drivers). And yes, it also has a GUI that a user can use to launch apps, but the actual OS is the thing behind the UI. As was said above, the UI is the car's dashboard, the OS is the whole car.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, dcgreen2k said:

Depending on what you're trying to do with your operating system, this may or may not be important to think about.

@Sakuriru thanks for the book recommendation and the recommendation for what language to use.

@thevictor390 I like the analogy, but I know an OS is more than that, I was just generalizing it, I don’t like to explain stuff to people online when they know it already, typing is not as fun as talking. 
@Franck I know that the GUI is one of the last steps.

@Eigenvektor I think you are wrong. It is like the computer that was made in Minecraft to run Minecraft.

 

Coding languages can run sub programs, so if you program them to, they can run full programs.

 

2 hours ago, Peter_The_Ent said:

I may not know the details of most programming languages, and kind of quoting @geerlingguy , I don’t want to do it because it is the best, I want to do it because I can.

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

@Eigenvektor is correct. You cannot run Python on bare hardware because it must run inside an interpreter. You need to write it using a language that compiles to assembly code instead. Furthermore, if you want your OS to be useful, then it needs to run on your own computer instead of Replit. That leaves you with two options - an "operating system" like what you seem to be talking about that's really just a GUI program running on top of your existing OS and can launch programs from, or an actual operating system that your computer boots into.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

24 minutes ago, Peter_The_Ent said:

Coding languages can run sub programs, so if you program them to, they can run full programs.

That doesn't make that program an OS. I think you are confused on the terms.

What you are looking for is making an interpreter.

 

That will help your research and this is totally doable with most languages and thousand fold easier than making an OS

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, dcgreen2k said:

@Eigenvektor is correct. You cannot run Python on bare hardware because it must run inside an interpreter. You need to write it using a language that compiles to assembly code instead. Furthermore, if you want your OS to be useful, then it needs to run on your own computer instead of Replit. That leaves you with two options - an "operating system" like what you seem to be talking about that's really just a GUI program running on top of your existing OS and can launch programs from, or an actual operating system that your computer boots into.

No, he is not. I did not say that I WAS going to program it in python, or bare hardware. 

 

2 hours ago, Peter_The_Ent said:

I don’t want to do it because it is the best, I want to do it because I can.

I want it in replit.com

1 minute ago, Franck said:

That doesn't make that program an OS. I think you are confused on the terms.

What you are looking for is making an interpreter.

 

That will help your research and this is totally doable with most languages and thousand fold easier than making an OS

I am not confused, I was using it as an example, like a “proof of concept”. Just saying if a language can run sub programs, it can be made into an OS.

 

 

I KNOW THAT IT IS NOT THE BEST, AND IS DIFFICULT, I DON’T CARE!!! I WANT WHAT I WANT! I LIKE CHALLENGES, AND WANT TO LEARN MORE ABOUT OPERATING SYSTEMS!!!

 

 

p.s.

I do have a short fuse for people telling me something is “Not Possible” when it is, but is just difficult or impractical. I am not stupid, my brain is constantly thinking about ways to make things work.

 

p.p.s.

I am writing this on a phone. 

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

Oh well. Obviously I don't know how to write an operating system on a programming website, or how programming works at all apparently. I'll be waiting to see what you come up with though.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, dcgreen2k said:

I don't want to discourage you, but writing an operating system takes a lot of hard work and knowledge in programming. Trying to take this on would undoubtedly make you a better programmer though.

I'd say while you need to have a good grasp on programming, the biggest thing with OS stuff is knowing hardware level stuff as well and I think importantly knowing design principles

 

Writing an OS can be an overwhelming thing.

 

5 minutes ago, Peter_The_Ent said:

No, he is not. I did not say that I WAS going to program it in python, or bare hardware. 

Please don't take this the wrong way, but @Eigenvektor was correct in what he said.  His quote was associated with you saying that one can build an OS in any programming language.  That isn't correct for languages that are interpreters that do not compile to native assembly language.  While you might be able to write large sections in it you are not able to write the entirety of it.

 

 

As for this topic, my advice would be don't start at OS level stuff if you barely know python and don't know other programming languages.  There's a bunch of stuff that would have to be learned.  With that said, from what you have said I'm wondering if you are confusing writing an OS vs writing something like an interpreter/script

 

Start with smaller projects, learn the language.  So much of "programming" as well isn't just the programming it's the software engineering aspect.  Hope onto open source projects, or  other attainable starter steps like mini programs (game programming is actually a good one).  Then from there you can start branching into other stuff that would be practical for OS level.

 

OS stuff handles, memory management, code execution, display stuff, and communication with the hardware. 

Writing a new language handles interpreting code.

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, Peter_The_Ent said:

I do have a short fuse for people telling me something is “Not Possible” when it is, but is just difficult or impractical. I am not stupid, my brain is constantly thinking about ways to make things work.

I don't think anyone said something wasn't possible. Outside saying it's not possible with Python which is true. If your Replit.com supports compiling to C or Assembly your good to go.

 

There is however much better tool for coding Assembly and C and i don't remember the name but there is a minimal unix base OS that really doesn't have much more than couple hundreds of thousand of lines of code and it's a good kind of project to use as a base to see how they made things. You wont find much tutorial on making OS unfortunately.

 

**Edit**

I just thought about it and you can actually start on the easy path and make a "kind of" OS by working with Arduino. It is embedded systems but it's a great stepping stone, plus it will make you learn native languages (most likely C)

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Franck said:

You wont find much tutorial on making OS unfortunately.

 https://wiki.osdev.org/Expanded_Main_Page is a good resource and is what I'm using to learn right now, but I don't know how much of the stuff on there is transferable to Replit.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

42 minutes ago, Peter_The_Ent said:

No, he is not. I did not say that I WAS going to program it in python, or bare hardware.

I merely pointed out that not every programming language is a suitable choice for writing an OS, I didn't say you made a wrong choice. When I say using Python for this task is impossible, I mean it. It isn't merely difficult or impractical.

 

The term operating system implies that your program runs on bare hardware, that's what an operating system is all about. A program that can simply be used to run other programs is a task launcher, not an operating system and still needs an underlying operating system to run on.

 

If you look at Linux, then its kernel is the actual operating system. The desktop environment you use to interact with programs is not; it is interchangeable. For example you can switch from Gnome to KDE without changing the underlying operating system.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Peter_The_Ent said:

I WANT WHAT I WANT! I LIKE CHALLENGES, AND WANT TO LEARN MORE ABOUT OPERATING SYSTEMS!!!

Then learn and maybe then you will understand more from what has been posted here.

 

You can look at MicroPython running on microcontrollers pretty much bare metal pretty much aside from maybe some firmware. But that's not the desktop Python, that's a completely separate codebase and is written in C to then expose the scripting layer with familiar syntax.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Eigenvektor said:

I merely pointed out that not every programming language is a suitable choice for writing an OS, I didn't say you made a wrong choice. When I say using Python for this task is impossible, I mean it. It isn't merely difficult or impractical.

I did not say that I was going to program it in python. From what useful stuff I have been told so far, I am going to use C or Assembly.

@dcgreen2k thanks for the resource. 
 

2 hours ago, Franck said:

I just thought about it and you can actually start on the easy path and make a "kind of" OS by working with Arduino. It is embedded systems but it's a great stepping stone, plus it will make you learn native languages (most likely C)

I don’t have an Arduino, and I don’t have the money for one, all of my money for the next year is spoken for. I got invited to go on a performance tour of Europe. Pricey. I only have a normal PI. 
 

 

2 hours ago, wanderingfool2 said:

Writing an OS can be an overwhelming thing.

 

2 hours ago, wanderingfool2 said:

As for this topic, my advice would be don't start at OS level stuff if you barely know python and don't know other programming languages. 

 

2 hours ago, wanderingfool2 said:

Start with smaller projects, learn the language. 

As I learn whatever language I plan on using (one of the above), I will be coding small projects as I go. I don’t remember where I learned that that is the best way to do it, but I did.

 

Which language should I use for the OS C or Assembly? 

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Peter_The_Ent said:

I did not say that I was going to program it in python. From what useful stuff I have been told so far, I am going to use C or Assembly.

Yes, I'm aware you didn't say that. I was merely responding to "any language would work". Because some don't.

 

Just now, Peter_The_Ent said:

Which language should I use for the OS C or Assembly?

Go with C, C++ or Rust. The Linux kernel is primarily written in C, some parts in C++, but they are looking into Rust because it essentially makes certain types of bugs impossible (i.e. the language/compiler prevents you from making them)

 

Don't use Assembler unless you really have to (i.e. for very performance critical parts). It's just a lot of extra work for little to no gain on average. It will give you maximum control, but that generally isn't needed. Modern compilers are generally much better at optimizing the generated machine code (which is 1:1 to assembler) than your average human. Assembler makes sense if you know for a fact that the generated code is not ideal and you can do better.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Eigenvektor said:

Yes, I'm aware you didn't say that. I was merely responding to "any language would work". Because some don't.

Ever heard of exaggerating?

 

And thanks for telling me that about assembler. I will save learning that for the future.

 

C it is!

 

p.s.

Anyone have any good free C tutorial recommendations?

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Peter_The_Ent said:

Which language should I use for the OS C or Assembly? 

You should mainly use C. Assembly is only really needed for parts like the bootloader.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, Sakuriru said:

Challenge accepted:

image.png.a84bf2ac3209765e58acebebdc2df3ff.png

Umm Wait GIF - Umm Wait Nathan Fillion GIFs

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, Sakuriru said:

Challenge accepted:

image.png.a84bf2ac3209765e58acebebdc2df3ff.png

Cool. What is your username for replit?

Main "Rig"=HP 11A G6 EE

Android Tablet

Raspberry PI Zero W 2

If you have any fun ideas for things for me to do with my PI, send me a direct message. 

I plan to upgrade within a few months to a proper computer.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×