Behind Menuet, an OS Written Entirely In Assembly 419
angry tapir writes "MenuetOS is an operating system written entirely in assembly language. As a result it's extremely quick and compact (it can even fit on a floppy disk, despite having a GUI). It can run Quake. Two of the developers behind MenuetOS took time out to talk about what inspired them to undertake the daunting task of writing the operating system, the current state of Menuet and future plans for it."
That's just dumb. And kinda cool. (Score:5, Interesting)
6 months from now, a new processor revision will provide enough marginal performance to make up for not coding the other 95% in assembly.
That said, this is a monumentally cool achievement, if academic.
Not that amazing (Score:5, Interesting)
For a more impressive feat, check out the Synthesis kernel written back in 1988. Also written entirely in assembly, and as stated in the linked wikipedia entry, that OS kernel was the "mother of all self-modifying code." It actually handled things like thread scheduling by generating a custom assembly snippet to jump to the correct point in the next thread to execute.
http://en.wikipedia.org/wiki/Self-modifying_code#Alexia_Massalin.27s_Synthesis_kernel [wikipedia.org]
Re:Stupid license. No thanks. (Score:2, Interesting)
Of course, if they had to integrate Quake with the OS parts, then wouldn't the OS also fall under the GPL like the quake source?
Re:From the license... (Score:4, Interesting)
Re:Not that amazing (Score:4, Interesting)
thread scheduling by generating a custom assembly snippet to jump to the correct point
Wow, this thing must have been fun to debug and maintain. And also, must be a challenge to optimize current generation CPUs for, with separate data and instruction caches... No wonder it never gained traction.
Re:That's just dumb. And kinda cool. (Score:5, Interesting)
Re:From the license... (Score:3, Interesting)
Did you think they wrote it in hex?
Why not it's how I started writing Machine Code
Programming in hex, compared to just clicking a "compile" widget on a toolbar, feels a lot more like "programming." It's fun to toggle in a program byte by byte and see it run -- even on a slowed-down Z80 [paleotechnologist.net].
networking (Score:5, Interesting)
Too bad it doesn't have wireless networking support, it looked to be the perfect thing to make older notebook computers useful.
Been done already... (Score:1, Interesting)
There has already been an operating system written in assembly language, which fit on a floppy disc, despite having a GUI.
It was called the Macintosh operating system. (and no, it was not written in Pascal, despite having Pascal calling conventions)
Re:That's just dumb. And kinda cool. (Score:3, Interesting)
Typically, you get most of your performance gains by rewriting 5% or less of the software in assembly [Citation needed... :-)].
I think you mean Amdahl's Law [wikipedia.org] (that speeding up or parallelizing one task will only produce a speedup limited by the relative time consumed by that task compared to the rest of the code.)
I do think that writing good, efficient C code (for instance) will get you most of the way there -- and in that case, your argument is right. There's still something to be said for developing something like this just for art's sake, though. Why do people admire handcrafted Swiss watches, when they can get a perfectly good timepiece for a few bucks down at the Wal-Mart? Craftmanship, and the skill it implies, are impressive to those of us who know what is involved.
Perhaps (if they could open up the code, and if it has very good documentation), they could use it as an example of how to get things done quickly in assembly. Once you get into the assembly mindset, it *is* fun to figure out a way to run a loop in 2/3 the instructions (allowing your robot to control 24 servos instead of 16, with the same $5 microcontroller).
Assembly language doesn't scale (Score:4, Interesting)
Writing large programs in assembly language is almost impossible, you have to get it perfect first time because refactoring assembler code is next-to-impossible.
eg. Small changes in the base data structures (eg. change a data type) mean you have to go through and change every instruction which references that data, and since there's no type-checking in assembler you can easily miss some and the assembler won't tell you about it.
With a compiled language you can change the data type and you're done.
This argument also explains why C++ is better than C. C++ and OO methodology makes writing large programs MUCH easier than using C and procedural code. With C code you have to keep an awful lot more knowledge in your head at any give time and it's easy to forget things in C that can be done automagically in C++.
Re:From the license... (Score:2, Interesting)
Re:Not the best choice of languages (Score:4, Interesting)
Also, since when do you have to write your program/os in only one language?
Game developers mix their code all the time. C++ for the main part/glue, assembly for the tight loops and things that need speed-ups, and a (maybe compilable) scripting language like Python or Lua for, well, scripting (bots, map events, rules, etc).
I'd write an OS in Haskell for the main part, and assembly or C++ for the really low level or very speed-dependent stuff.
Re:From the license... (Score:5, Interesting)
Re:Stupid license. No thanks. (Score:4, Interesting)
Re:From the license... (Score:3, Interesting)
I'm already posting from MenuetOS - I've been using it for a couple of years as my 'security' option for things like pissing off people in IRC and daring people to hack my computer.
It's nice having a machine that's pretty much untouchable because nobody knows the exact hardware you're running, nor your coding habits.
Re:Stupid license. No thanks. (Score:1, Interesting)
Seriously, is the reading comprehension skills around here so limited?
"without permission"
Let me get around your big problem, "Excuse me Mr. Copyright Holder, may I have permission to to reverse engineer, disassemble or decompile your software so that I may either independently verify your claim or perhaps use it as the center of an interesting research project."
Mac OS 6 (Score:3, Interesting)
So it's written in assembly, has a GUI and boots from a floppy? Yup, Apple did it (Mac OS was written in 68k assembly up to System 6)
And no offense but Mac OS 6 looks like it had a more sophisticated GUI than that, colour depth aside.