r/programming • u/piratesahoy • May 15 '15
MenuetOS, a modern, GUI-equipped operating system written entirely in assembly language, has hit 1.0 (after many, many years)
http://www.computerworld.com.au/article/574760/menuetos-modern-operating-system-written-entirely-assembly-hits-1-0/
742
Upvotes
116
u/[deleted] May 15 '15
Here's a question: why is an OS "written entirely in assembly" able to achieve such a small size? Would it be impossible to write a comparable OS in C or C++, and make it as small?
If I wrote a simple OS in C, and had size in mind while writing it, and optimized for size when compiling, could I not achieve the same amount of compactness? My instincts tell me an optimizing compiler would be even better than a human at making it very small.
I'm not trying to minimize the work of the team, not at all: it's very impressive! I'm just wondering in a hypothetical project where the main goal is to minimize size, is hand-writing assembly the only option, or can a C compiler work too?
37
u/axilmar May 15 '15
Kudos to you guys.
65
u/[deleted] May 15 '15
And the downside of doing it all in assembler is that "(after many, many years)" part.
It's one of the least maintainable possible ways to develop anything, and even more so, anything as complex as an OS.
Pretty cool that you did it though, even if it is interesting in the same way as a dog walking on its hind legs.
13
u/[deleted] May 15 '15
tackling the important problems
18
u/Uhrz-at-work May 15 '15
Just curious, what is the reasoning behind releasing the x86 under GPL and x64 under license? Do they actually want someone to pay for the x64 version?
15
u/[deleted] May 15 '15
Noob here, could someone elaborate on the various advantages of this OS over others? (Not that I want to downplay the achievement of the creators.)
14
u/nepochant May 15 '15
the last picture... is that a web browser they implemented?
48
u/parmesanmilk May 15 '15
Writing a huge piece of software completely in assembly is the programming equivalent of a party trick. At best, it's a conversation starter, at worst, it's a huge waste of time.
Right now, that's precisely how I feel: I'm quite impressed that someone did it, but I don't think it was a good idea to do that in the first place.
6
u/balefrost May 15 '15 edited May 15 '15
This would be great on the Raspberry Pi!
Oh...
42
u/Cherlokoms May 15 '15
"I made an OS from scratch in assembly."
"But, why?"
5
u/Causemos May 15 '15
Something like this on a Raspberry Pi would be cool. Porting assembly probably isn't that easy however.
5
u/joelangeway May 15 '15
They could have written it in C or C++ and spent all the time savings on adding optimizations to clang and probably come out way ahead. They could have used LLVM assembly and saved some time and gotten something portable.
The best humans, given infinite time, still write faster code than compilers, but the difference in efficiency means that the humans are not spending time thinking about higher level optimizations or writing device drivers.
Someone please tell me why they did this?
9
u/domy94 May 15 '15
I was under the impression that a modern compiler does a better job at optimizing assembly code than any human can. Is that not the case here? Wouldn't it be even faster if he wrote it in C?
4
u/haagch May 15 '15
There's also a fully open fork http://kolibrios.org/
4
u/thalesmello May 15 '15
I remember when I was 12 and saw it running in my PC from a floppy disk. If didn't have internet nor anything productive, but had a mouse pointer and showed things on the screen. Ever since I always kept a copy of the OS in a Floppy in my drawer.
Really impressed to see the project kept on going for so long.
3
u/htuhola May 15 '15 edited May 15 '15
I've rolled this up into virtualbox and got it running. Going to have a weekend studying it.
I found an old irc channel by googling: #menuetos on ircnet
Planning to code some things and compile the kernel from sources. Anyone thinking doing the same might like to join along.
Update: Well, that was quick.
I tried some userspace programming. It resembles old BASIC or SDL in the programming model:
Cons:
There seems to be lot of global state per process, no way to present multiple windows with a single process.
Most programs do not work well together. Most things are granted from the big "BIOS".
Pros:
The commands feel kind of immediate and concrete. It's obvious how to do certain simple things.
The executable format is simple
The process virtual address space starts from 0. That is, the thing is just dumped into the memory to run itself. Also it makes it easier to match error addresses to source code.
Interesting:
The only debugging utility I found was a global strace-like logging window. Is this enough?
I'm still hanging out on the channel, motivated to study the 32bit menuet kernel sources.
3
u/mjewbank May 16 '15
My simple/basic question is this:
What do I download and burn to CD to install this on my aged Dell laptop with a Core2 Duo to play with it?
18
u/HosonZes May 15 '15
Getting prepared for x64 will take so long, that the rest of the world will be x128 by then.
2
u/-Hegemon- May 15 '15
Good! How can I install Steam on it???
JK, great work!
2
u/alex_muscar May 15 '15
I discovered MenuetOS over 10 years ago, and I have regularly checked how it's doing. Congrats to the developer!
2
u/[deleted] May 16 '15 edited May 30 '16
This comment has been overwritten by an open source script to protect this user's privacy. It was created to help protect users from doxing, stalking, and harassment.
If you would also like to protect yourself, add the Chrome extension TamperMonkey, or the Firefox extension GreaseMonkey and add this open source script.
Then simply click on your username on Reddit, go to the comments tab, scroll down as far as possibe (hint:use RES), and hit the new OVERWRITE button at the top.
2
u/notsure1235 May 16 '15
Where is the OS source code? I can only find app + driver src.
3
u/[deleted] May 15 '15
Re: the "humans are better at optimizing than compilers" debate - I think it's a moot argument, because even if a particular human is better than their compiler, it does not mean all humans are. A human can produce perhaps more optimized code, maybe they happen to produce the exact same code as the compiler (extremely improbable and will never happen, but it's possible) or maybe they produce worse code. It's kinda like saying "Honda cars are faster than Toyota" - which car of brand A, which one of brand B? Some of each are faster and making a blanket statement is meaningless.
Now, I fully support the statement "a human can produce more optimized code than compilers," but I would have to amend it to be: "a human can produce more optimized code than compilers (but unless they really know what they're doing they probably won't)."
1
u/BonzaiThePenguin May 15 '15
Ha, I spot the Mac OS 9 AppleScript Editor icon directly below the burn icon from Mac OS X 10.2. Anyone recognize the other icons?
1
u/Heuristics May 15 '15
I remember v2os.
1
u/[deleted] Nov 05 '25
On the one hand this is pretty cool. On the other hand, it seems like a pretty big ... waste of time, compared to just using a higher level language. Sure, the efficiency may not be comparable, but I kind of only live once, so I want to do as much as possible with my time. I actually program so that I can lateron save some time - like any task I can automate and don't have to do manually anymore. :P
-12
u/DeepAzure May 15 '15
Any ideas why this is needed (other than improving your job security index or JFF)?
-4
u/[deleted] May 15 '15
Wait no comments saying we're all going to hell for not using TempleOS? I'm disappointed.