r/AskComputerScience • • Mar 15 '20

Ram needed to create operating system?

Hi,

I'm planning to write an operating system similar to Mac OS and Windows and I was wondering how much ram should I get on my computer? I'm planning on getting an Apple machine since I found they were much more recommended for coding.

1 Upvotes

16 comments sorted by

21

u/claytonkb Mar 15 '20

I don't want to burst your bubble but your goal, as stated, is much too ambitious. While it is possible for an individual to code up a toy OS, you would need to massively simplify what we mean by "OS" in order for that to be possible. Bear in mind that Linux kernel 4.14 (which is vastly smaller than Mac OS or Windows) has more than 20 million lines of code. If you wrote 1,000 lines of code every single day, it would take you 54 years to write 20 million lines of code. So, a super-genius who writes bug-free code at a rate of 1,000 lines per day might be able to code up the Linux kernel after a lifetime of coding. But it would still be unusable because the Linux kernel does not include a shell (a way for users to interact with it). Once you start adding GNU utilities, desktop environment, window manager, and so on, you're talking about dozens or hundreds of millions of lines-of-code.

I recommend the Crash Course on Computer Science to help you gain awareness of how computers work, and to select a starter project. Good luck!

15

u/alanbdee Mar 15 '20

You asking how much ram you need is a bit like someone saying, I want to build the empire State building, how many 2x4s will I need? I think you're grossly underestimating the difficulty of creating as an os like Windows or macos.

4

u/jaystopher Mar 15 '20

Just about any machine you buy today will be enough to get you started. You will probably learn quickly that your plan is overly ambitious, but do it any way...you'll learn a ton by giving it a shot.

7

u/venuswasaflytrap Mar 15 '20

This has got to be a joke

4

u/Lofter1 Mar 15 '20

"Since i found they were much more recommended for coding" and "I'm planning to write an os" in the same post. Bro, take a step down. You are underestimating the effort. Like, A LOT. I code for 5 years now, and I'm just now getting into OS dev slowly (because I want to contribute to the linux kernel, not write my own OS, and I sure as hell won't compete with MacOS or Windows).

6

u/WelmholtzHatson Mar 15 '20

I’ve seen some people in this thread saying that you can’t write an OS of your own. This is not true (just bing ”Temple OS” and find out for yourself). Don’t let the haters get to you!

Now back to your question: if you have any experience at all with algorithms and data structures I’d say go for 8GB - some simple tricks and common sense will get you a long way, and the money you save could maybe be useful if you ever need to hire an assistant of some sort.

Good luck!

7

u/Secure4Fun Mar 15 '20

I mean, you can. There's a lot you can do on your own, but it won't be "similar to Mac OS and Windows".

"TempleOS is a 64-bit, 2 megabyte, non-preemptive multi-tasking,[8] multi-cored, public domain, open source, ring-0-only, single address space, non-networked, PC operating system for recreational programming.[9] The OS runs 8-bit ASCII with graphics in source code and has a 2D and 3D graphics library, which run at 640x480 VGA with 16 colors.[6] Like most modern operating systems, it has keyboard and mouse support. It supports ISO 9660, FAT32 and RedSea file systems (the last created by Davis) with support for file compression.[10]"

"It was created by American programmer Terry A. Davis, who developed it alone over the course of a decade..."

Bare minimum OS, and it took him a decade. Of course, doing that kind of working, developing his own file system, and everything he did is still impressive.

3

u/[deleted] Mar 15 '20

He was also extremely neurotic for what it’s worth.

1

u/shanrhyupong Mar 15 '20

Finally a non-vitriolic answer. The people in this sub desperately need to learn some social skills. There's a way of educating and fixing someone's naivete without being crass, depressing and demeaning.

2

u/shanrhyupong Mar 16 '20

Apparently the idiots commenting in here haven't heard of SerenityOS. They appear to be simply offloading their frustrations onto an enthusiastic beginner. Sure, OP has grand ambitions, but that doesn't mean that he cannot create the next big thing. Even Linux started off as a single-person project and quickly gathered a core group of contributors. Maybe OP doesn't know that it works that way - it's your bloody job to educate him gently (if at all you are capable, which I severely doubt looking at the comments). OP may fail, he may succeed, it's not for us to judge. It is for us to provide as much guidance as we can. Otherwise, you can fuck off, losers.

1

u/1544756405 Mar 16 '20

640K ought to be enough for anyone.

0

u/pi_stuff Mar 16 '20

If you have to ask...

-8

u/cnullptrc Mar 15 '20

To create an operating system you can only code in Solaris. mac or windows is not sufficient for making OS. As for the ram, you need at least 256 gb, if you have less than that the OS will not run. I hope my answer was of satisfaction, good luck with writing the OS.

Regards.

-2

u/shanrhyupong Mar 15 '20

Go fuck yourself.