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
We just trust that compilers know what they're doing.
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.
I was running GEOS on my C64 25 years ago! Last time I checked, it was all written in assembler, and it was an OS.
.. assuming that they could bring it up to par with modern operating systems (which of course is a gigantic leap of faith) .. in theory it could be the leanest OS EVER created.
Well 32 bit is but 64 bit isn't... Lame.
Microsoft, Apple and Google update their OS about every year or two. If MenuetOS took 13 years to get to version 1.0, how long would it take them to release a bug fix? Is there a guarantee of a hot fix in 7 years or your money back?
What could I potentially use this sort of OS for? In what environment would it be pretty handy to have? Or is this a sort of a cool kids thing where it exists just because it can?
I thought this thing was done years ago. Good to see it going though and a great example that modern operating systems don't have to be written in C.
hmmm probably not... x86...
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.
funny, I was just reading about high level assembly, Art of Assembly Language http://www.plantation-productions.com/Webster/
Nice to see some geeks are still experimenting with assembly language. I haven't heard much about assembly language since I have graduated from college about 10 years ago. Thanks for posting the link.
Real Programmers write assembly language operating systems on punch cards.
putting the 'B' in LGBTQ+
Does the OS come with a more modern application programming language than assembler, such as Forth? I'd like to use it, but fear of having to learn assembler keeps me away from it. So it would be good to have a modern programming language such as a nicely threaded Forth interpreter or a simple LISP system implemented on top of this ... for the rest of us, who are afraid of assembler.
Why bother making electronics small?
Why bother looking for dark matter?
Why bother existing?
Why? Because the universe exists, that is why.
"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.
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.
So obviously their development cycle is much faster than HURD!
And we all know how much better one was over the other !!
I will not digress to the "asm coders spend time with bits not algorithms" !!
I will not digress to the "asm coders cannot flip a switch and update the binary for a new CPU" !!
I am not now nor have I ever been a member of the communist party !! Not that there is anything wrong with that !! Like being gay !! That is the way your cards were dealt !!
At least,there is a guarantee that this OS will be secure and without any backdoor. Simply because there is no compiler to inject it, so no chance for nasty hidden traps. Who knows, maybe in the following years this OS will became the only secure OS at all....
"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
Who knows what they do next!
This reminds me of GRC, Steve Gibson's company that produced disk utilities for recovering data and IIRC possibly even fixing broken pre-IDE disk drives. He boasted that all his software was written in super fast assembly language for maximum performance!!!
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.
thank you...
i imagine some of the commeters above freaking out when they read that statement...I admit I learn alot from reading the 'assembly sucks C is better' but the context of the discussion is *exactly* the kind of purely theoretical, ignore the user abstract computing model that causes our industry so much trouble. Its the tendency for programmers to ignore the *user* in the equation completely b/c humans have too much complexity and uncertainty (for the nerd mind)
it the core problem of our industry, IMHO
let me repeat...I *love* the /.'ers who obviously know what they are talking about who, on comments for stories like this, debate the most abstract minutiae of coding for *efficientcy*
but it becomes a Moebius Downward Spiral of rhetoric at some point...i say have the discussions, but always remember that the human part of the equation is **the only reason the computer exists** up above there's actually a comment above where the guy talks about how 'true computing' doesn't even have a user! WTF
think about what MenuetOS will allow the **user** to do....and on what machine....
this OS concept, the concept that an OS Kernal should be built from the ground up for ***how the user will use it*** is the way to the future for our industry.
Thank you Dave Raggett
"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
"So that I can continue to use computers without dishonor, I have decided to put together a sufficient body of assembly-only software so that I will be able to get along without any software that is compiled."
(As always, though, bathing is optional.)
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
Religion about tools is just silly.
Smite him, minions!
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!
Anyone remember the QNX Floppy OS
http://www.youtube.com/watch?v=K_VlI6IBEJ0 -- They released this in 1999
They've been making incredibly compact embedded OS's for years, that should really be what the mobile phones use.
Congrats to the Menuet peeps for making a more modern OS that compact!
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.
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.
I am posting this comment using the MenuetOS
browser (running on VirtualBos). It is amazing
that it fits on a 1.44MB floppy image.
If you consider it efficient to write anything in assembly it can only mean one of 2 things :
your code is executed billions of times daily. hence the ratio (timeSpentRunning*users / timeTowrite) is so huge that it is worth spending a huge amount of time writing in assmebly.
OR your time is worth shit. i.e : machine time is worth more than your time. Personnaly I write code than runs on anything from PC to clusters and I have never encoutered a case where writing in assembly would be economically sensible (over C\C++ + python + java + whatever). this case exist, but they are rare.
TL;DR : Interesting project for many reasons and i'm sure they have a lot of fun. Doesn't mean assembly zealots are right when they say it is "efficient" to write assembly code.
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
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
It is a crazy thing to do, because assembly is so close to the hardware, and code generators can be so efficient, but look at all the OS development being done today, mostly it's a version of Linux, Unix or Windows. Even Apple is based on Unix. There are some specialized OSs, like cell phones.
...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.
I can't help but be amused though more by the comments.It's as if no one remembers the feat of moving beyond assembly language in the 60's and 70's.
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?