MenuetOS, an OS Written Entirely In Assembly Language, Inches Towards 1.0
angry tapir writes "MenuetOS is an open source, GUI-equipped, x86 operating system written entirely in assembly language that can fit on a floppy disk (if you can find one). I originally spoke to its developers in 2009. Recently I had a chance to catch up with them to chat about what's changed and what needs to be done before the OS hits version 1.0 after 13 years of work. The system's creator, Ville Turjanmaa, says, 'Timeframe is secondary. It's more important is to have a complete and working set of features and applications. Sometimes a specific time limit rushes application development to the point of delivering incomplete code, which we want to avoid. ... We support USB devices, such [as] storages, printers, webcams and digital TV tuners, and have basic network clients and servers. So before 1.0 we need to improve the existing code and make sure everything is working fine. ... The main thing for 1.0 is to have all application groups available'"
ASSembly language? This OS will run as slow as frozen mollasses.
I want my computer to run FAST!
I want an operating system written in Java, running on a java interpreter written in java [add recursion here].
Java is faster than C, so logically, java must be faster than ASSembly. More java == more speed.
Lets get to it!
Why?
Time for bed, said Zebedee - boing
Now can I run Firefox on it to play online games while playing zeroconf-shared music?
So before 1.0 we need to improve the existing code and make sure everything is working fine. ... The main thing for 1.0 is to have all application groups available
Nah, main thing is to find a working floppy disk and drive.
I've been watching this project for ages, and I'm excited to see it slowly maturing. Quite a bit of fun to play with if you have some time to kill.
Well 32 bit is but 64 bit isn't... Lame.
But did it support USB, TV tuners, and webcams?
It is entirely a 'cause we can project. It is a misnomer that assembler is faster than C code in practice. Most compilers and optimizers can take advantage of modern hardware's (i.e. x86's) continuing changing architecture. Things that were fast on core2duo may be slower on core i7, and they may have introduced new operations to do XYZ faster still.
Not to mention that securing asm is a nightmare, very very time consuming. Even their '13 years' isn't enough.
A lot of the bloat in modern OSes comes from having to support a wide range of hardware - it's one of the reasons Linux can scale down to run on a tiny embedded system if you strip out that hardware support and other unneeded features (such as a fancy UI). You might even find that it doesn't scale well onto higher-end systems.
Real Programmers write assembly language operating systems on punch cards.
putting the 'B' in LGBTQ+
But did it support USB, TV tuners, and webcams?
Yes it did! GEOS supported all the existing USB TV tuners and webcams of its time.
"Pointless" as a tag? Really? Is this Slashdot at all?
Have gnu, will travel.
MenuetOS isn't open source. The web page mentions the (dead?) 32bit version is GPL, but the 64bit version is release under a non-free license:
http://www.menuetos.net/m64l.txt
If we are starting to believe that the core of an operating system should include a full GUI, video and mp3 playback, audio, USB, network, etc. for the least possible battery use, then this is a really cool way to go.
Why waste the resources? Just cause we can?
If we are to rethink what a basic operating system of today ought to have right out of the box from the first nanosecond, then I'm sure there is a lot of reengineering that would happen to any Linux or Windows kernel.
Hmm, the humour and sarcasm seem to have been be lost on you.
i.e., from the sounds of it, it is not multi user, and everything runs with superuser privileges. It is written entirely in assembly language which adds another level of complexity for the programmer to deal with.
Whilst it sounds like an interesting research project, and is no doubt likely to be quite a lot faster than any other multi-user OS, those are some MASSIVE trade-offs, especially with regards to security and stability.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
Embarrassing the creators of all the OSs that take five minutes to reach desktop.
I know you're joking, but when you write straight up assembly all the optimizations are up to you, and the fastest way to schedule instructions can change a lot between CPUs. While it probably isn't awful slow, it's also probably not as fast as a compiler-optimized C-based equivalent would be, and maybe even a Java one.
+1 Virtual Mod point to parent
Your thin skin doesn't make me a troll
Assembler really isn't that hard. My first three years as a programmer were assembly language only for embedded applications. It's like anything else -- you memorize stuff and after awhile you see every problem as a list of assembly instructions. Later, using C seemed like cheating, in a way.
Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
So obviously their development cycle is much faster than HURD!
I never said it wasn't an OS, I was just pointing out one of the things that would make this more of an accomplishment.
"MenuetOS is an open source"
Not the x64 version, which is the version that's actually worth a shit.
Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
Because assembly programming is really fun. It's challenging and it's a pretty unique experience for most of us who rarely touch systems at that low a level.
I swear to God...I swear to God! That is NOT how you treat your human!
What a senseless waist of human life.
more cowbell
Comment removed based on user account deletion
It all depends in the definition of "performance" that you want to establish. If performance for this projects means just "raw machine cycles used in specific task", then yes we all know assembly will outperform anything (given you have huge amounts of resources, like time and money) BUT if you define performance also by "results obtain VS resources spend" then you will never win using assembly code.
LincolnLogOS is an open source, GUI-equipped, wooden operating system written entirely in Lincoln Logs that can fit on any play room floor (if you have one big enough). I originally spoke to its developers in 2009. Recently I had a chance to catch up with them to chat about what's changed and what needs to be done before the OS hits version 1.0 after 13 years of work. The system's creator, Ville Turjanmaa, says, 'Timeframe is secondary. It's more important is to have a complete and working set of features and applications. Sometimes a specific time limit rushes application development to the point of delivering incomplete forts and buildings, which we want to avoid. ... We support USB devices, such storages, printers, webcams and digital TV tuners, and have basic network clients and servers. So before 1.0 we need to improve the existing forts and buildings and make sure everything is working fine. ... The main thing for 1.0 is to have all application groups available.
Someone you trust is one of us.
Yup. I guess it deserves a mention that just like Linux, MenuetOS also comes from Finland and is lead by a guy called Ville Turjanmaa.
"Help! Help!" she cried.
Most of them all just walked by, ignoring her. She might be jaw-droppingly gorgeous 36-24-36 redhead with pouty lips in a light dress, but she was clearly crazy, waving that weird plastic thing around. "You!" she urgently growled, as she seized a suited man's lapels. "Can you help me read this? It's the only copy!" This looked like a successful man, so surely he could afford a decent computer, right?
He blushed. He wanted her, and maybe could use it to get her back to his place, but the lie would eventually come out. And this woman had just the sort of sincere bearing, that he knew the lie would be punished, not accepted. He sighed. He glanced at the disc again, just to make sure what he was seeing, and sighed. "No. Sorry. What is that, anyway?"
She let go, and cast her glance around the crowd.
And that's when it happened: Drinkypoo. The moment she saw him, she knew. This was the one. She didn't even have to ask, because she knew. But she decided to ask anyway, so that he could have the pleasure of saying yes and offering to help. It would be the first of many pleasures that he would experience.
"Can you read it? There are some really important files from the 1990s on here. I've got to have them. I'll do anything, Drinkypoo. Anything."
There was a time when Drinkypoo would have grinned nervously, or asked followup questions. But by now, he knew the story. He didn't want to hear the story anymore; he just wanted the reward. Drinkypoo didn't so much as even glance at the disk. Why so many unbelievable hot women always had invested in LS120s and floppies to store their critical records, he didn't know. Maybe some freak effect of a one-shot Imation advertising campaign, long ago. No one even really knew why, for sure; they just knew that a shitload of the drives had somehow ended up in the possession of that demographic.
He squinted and recalled his depleted inventory. That blonde with the 1.4MB floppy from two nights ago. "Got to stop at the drugstore on the way. C'mon," he replied. She stuffed the disc into her purse for safekeeping and they walked to his car.
Half an hour later, at his place, she sat on the couch, nervously clutching her purse containing the precious disc. Drinkypoo sauntered over, and held out the glass of rye bourbon on ice. "Here, relax. Everything's going to be okay." She sighed with relief, set her purse upon the coffee table, accepted the glass and sipped. "Thanks."
"You can't imagine what this means to me," (though Drinkypoo actually knew very well), "I need those files so badly." She reached for his belt buckle for a brief moment, but paused. "First things first, though, I suppose."
Drinkpoo shrugged. What did it matter to him? It would all work out the same. This was going to be fun no matter which order things occured. "Sure." He walked over to the computer desk and nudged the mouse, waking it up from sleep, casting monitor light across the room. "Let's have the disc."
She smiled, and reached into her purse, pulling out a .."
[CHOOSE YOUR OWN ADVENTURE:
1) .. gun.
2) .. Zip or Jaz disc.
3) .. 3.5" floppy or LS120 disc. (Drinkypoo, it will cost you 0.01 BTC for me to write this version.)
]
"Believe me!" -- Donald Trump
From the license: http://www.menuetos.net/m64l.txt
1) Free for personal and educational use.
2) Contact menuetos.net for commercial use.
3) Redistribution, reverse engineering, disassembly or decompilation
prohibited without permission from the copyright holders.
For an OpenSource OS written in assembly, that 3rd clause is a bit strange.
(yes, yes, I did notice that the 32bit version is more traditionally open-source-licensed...)
I know for a fact that my C code is faster than my Assembly code... since the time I lost track of all CPU pipelining and stuff, while compilers only got better at optimizing. When they release version 1.0, it will probably have to be run on a emulator, perhaps in a quantum computer.
Some assembly code that I wrote was faster than C from current compilers over several major architectural changes of x86. The percentage by which they were faster decreased, yet after 3 architecture changes I was still 10% faster with the original assembly.
The key to writing good assembly code is not trying to out-compile the compiler, that is a newbie thing to do. The key is to leverage knowledge that can not be transmitted to the compiler, can not be expressed in C.
Not very portable then
That said, I rarely use assembly in professional software development situations when targeting computers and mobile devices. Before addressing your comment let me add one more thing. Learning assembly is important with respect to making you a better C programmer. I'm not talking about understanding the asm code you see in the debugger. I really am referring to writing C code. C code can be written in architecturally specific manners. The code is still portable, yet more efficient only on a specific architecture. Understanding the architecture and assembly language can allow you to write more efficient C code.
Yeah, outside a few rather narrow cases, ...
That is nothing new, this has been true for decades. You have to go back to Apple II and Commodore 64 days to find a timeframe where assembly was appropriate for general purpose software development. I'm referring to computers, not micro controllers and other such environments.
... modern CPUs have just gotten too complicated to write efficient assembly for.
This is absolutely false. The key to writing good assembly code is not trying to out-compile the compiler, that is a newbie thing to do. The key is to leverage knowledge that can not be transmitted to the compiler, can not be expressed in C. This is where the real win is, this is where assembly can still beat C even after a couple of architectural upgrades.
Great, I thought, a lightweight, compact OS complete with GUI that strives to be fast, secure and robust. I know just the application for something like that: mobile terminals! Just port it and...
[pop]
Ahw shucks, it is written in x86 assembly. Porting it essentially comes down to rewriting the thing. Yes, you could machine-port the thing, ending up with code constructions which work great on x86, not so much on arm. A compiler would produce better assembly from C source than that.
--frank[at]unternet.org
The worst choice in C is to think you need to help the compiler optimize. Seriously, the compiler doesn't care at all whether you write x = x << 1; x += x; or x *= 2; it sees them all the same, so code the one that makes sense in context.
Historically helping the compiler, giving it hints, is in fact a good way to get superior code out of a compiler. For example consider 4x4 matrix multiplication. Do you use nested loops or just unroll it manually? Compilers tend not to fully unroll all the nested loops. The compiler may do better scheduling on fully unrolled non-looping code. Do you create temporary variables to preload a row or column, or do you just access each variable in memory directly? The former may generate better code on a RISC architecture and the later on a CISC architecture. These are the sort of things I think of when referring to helping the compiler, giving it hints. When that mythical smart compiler arrives that is able to figure out the preceding on its own, it will simply ignore your hints, the hints will do no harm. Until this mythical compiler arrives, the hints may help.
BTW, I agree with your sentiment in the context of the example you offer. Besides being useless, I've also seen people introduce bugs by making such "optimizations". Replaced the subexpression "x * 2" with "x << 1" in a larger expression and you may have changed the order of evaluation of the overall expression and are doing an erroneous calculation. "<<" has a different operator precedence that "*".
I experimented with this several years ago, and I was surprised at how slow it was. Hopefully this has improved. It was written in asm, which should be fast, of course, but it seemed like they erased all of those gains with klunky system/gui stuff. Nevertheless, very exciting!
Can't people program for Ring0-3 in assembly? I dunno about MinuetOS, but if they did, couldn't they have allowed various privilege levels for the different parts of code that were written? Use Ring0 only for a handful of routines, put the rest of the kernel stuff into ring 1, device drivers into ring 2 and other userland in ring 3??
What is this "floppy disk" mentioned in the summary? It sounds weird, a disk thats floppy? how odd.
I doubt that he would approve, given his opposition to intermediate formats like Bytecode, ANDF or object code. Assembly code would be just as problematic.
As someone who writes bootloaders using both C and assembly language there really is very little advantage to using assembly any more. The C compiler gnerates very good assembly code at this point that is very compact if the right parameters are used. At this point it is difficult to exceed what the compiler does in terms of code density and it's a hell of a lot easier and faster to maintain C code than assembly.
In my last bootloader I had to fit a MMC/SD bootloader in under 8K. In that space all of the assembly code fits in the first sector along with the partition table. The assembly code sets up the stack and does some basic CPU configuration and contains the serial port routines just because I had plenty of space. The rest of the bootloader contains all of the SD/MMC driver, FAT16/32 support, CRC32 and more. Note that this is MIPS64 code. The bootloader is able to load the next stage bootloader from a file off of a bootable partition from the root directory, validate it, load a failsafe bootloader if the validation fails and launch the next bootloader, all in under 8K. Having disassembled the output using objdump the compiled code is often better than hand coded assembly since the compiler can often find a smaller sequence of instructions. Not only that, but the compiler can order the instructions better for performance since it knows the CPU pipeline quite well.
You don't need to write in assembly for something to be small, just don't throw in a bunch of unneeded crap.
-Aaron
This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
Seriously, I tried Menuet a few years ago. It's crazy fast on even ancient hardware.
It just needs a couple of killer apps.
Competition Good, Monopoly Bad.
You might want to check Blackberry - they use QNX as their OS. It's also the basis of Cisco's IOS
Of course that's barely the end. NAND gates are made of transistors and resistors.
But in the end, it's all nothing but quarks and electrons, bound together and moving in various combinations and patterns, interacting via strong force (gluons) and electromagnetic force (photons).
The Tao of math: The numbers you can count are not the real numbers.
for a long time, till they came up with PL/S. The typical mainframe environment was COBOL or PL/I for application programming, assembly language for system and utilities.
Writing code in assembly means giving up on portability. Is it wise to bet on x86 in 2013?
We have to remember that in the early ages, Unix had its success because it was written at 98% in a high level language, which was an innovation at that time
Sorry kid, the "beige box is the hard drive" bullshit doesn't trump what's in the technical dictionaries or the textbooks.
Microsoft LOST when they tried to convince the Judge that a web browser was part of an operating system instead of a userspace application but PR and opportunism has succeeded in convincing a pile of "beige box is the hard drive" losers that gut feel trumps accepted definitions.
'sorry kid'?
listen old timer, i don't think we disagree on anything...this isnt' about some antitrust lawsuit where M$ used some bullshit argument
i hate M$....don't bitch at me for shit Microsoft did
Thank you Dave Raggett
Actually, below that it's mostly Perl.
Tedious Bloggy Stuff - hooray?
You are using Microsoft's definition that the Judge rejected instead of the textbook one. You have swallowed the bullshit argument and are attempting to propagate it. That is why I am being condescending, because by using a "personal definition" you are clearly only pretending to know what you are writing about and doing it badly enough that it's obvious that you do not. Thus a communications failure since it's mindless noise just pretending to be signal.
In my workplace we run a suite of geophysics programs of which many parts are compiled from source code that has not been touched for twenty years.
bullshit...put up or shut up
I want links **to both** the M$ judge and the 'textbook one'
Links to both and then copy my original comment...when you lay out all three side by side, then list where mine is like the 'judge's' then we can talk
otherwise you haven't made any evidence for a claim & this conversation is past over...you're projecting your hate of M$ on me dumbass...i'm on your side
don't expect a response unless you post links to both things you are comparing my comment to
Thank you Dave Raggett
Not this compiler-inserted backdoor crap again... Look, an assembler could insert a backdoor as well. And any of the developers could insert a backdoor. Did you read the entire source code? Even if you did, do you think you could find a cleverly hidden backdoor?
Besides, all you need to do to get rid of the hidden compiler backdoor (assuming there is one) is write your own compiler, use it to compile the suspected compiler, then use the generated compiler to compile itself, and presto, the backdoor is gone. Writing an interpreter instead of a compiler is also an option. Since you only need to do this whole process once, your compiler doesn't need to do any smart optimization and it's acceptable for the whole process to take some time (a week? a month? who cares).
...yes, it was definitely Flynn. ...END OF LINE.
There are 2 groups of people you can make fun of on the Internet without fear of attack. The illiterate, and the Amish.
Oops - didn't mean to be anonymous. (Is there a way to edit my original comment to remove the anonymity)?
OK -- replied to the wrong post and can't fix it. So much for trying to figure out this UI.
It's got nothing to do with "hate of MS" but is instead a parallel example of this bullshit "beige box is the hard drive" shit with personal definitions based on gut feel.
Why should I reply with links to someone who is just making up their own personal definitions anyway, it's not going to stop you doing it and get you looking up the textbook definition instead is it?
Also, how can you possibly have never heard of MS declaring that a web browser was an integral part of the OS and the Judge telling them to fuck off with that stupid lie (at length and with more civil words) - you are on a site like this so you would have heard of it so why should I bother tracking down a link to something you've already heard about?
It's only the core of IOS-XR, and in fact will be gone in the next release (which will share a Linux core with NX-OS and IOS-XE)
/* FUCK - The F-word is here so that you can grep for it */
I've read the whole thread and this is the first post off which I can legitimately hang an obligatory XKCD reference.
All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe