Slashdot Mirror


Behind Menuet, an OS Written Entirely In Assembly

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."

111 of 419 comments (clear)

  1. From the license... by damburger · · Score: 5, Funny

    3) Redistribution, reverse engineering, disassembly or decompilation prohibited without permission from the copyright holders.

    Are you sure they wrote the entire thing in assembly language?

    --
    If we can put a man on the moon, why can't we shoot people for Apollo-related non-sequiturs?
    1. Re:From the license... by Anonymous Coward · · Score: 2, Informative

      Point one: assembly languages are compiled (from a human readable text file to a machine-readable object file). Did you think they wrote it in hex?

      Point two: it's therefore possible to decompile it.

    2. Re:From the license... by damburger · · Score: 5, Informative

      That would be disassembly, which they already mentioned separately as being prohibited. Putting "Point one" and "Point two" in front of clearly incorrect statements doesn't improve anything.

      --
      If we can put a man on the moon, why can't we shoot people for Apollo-related non-sequiturs?
    3. Re:From the license... by buddhaunderthetree · · Score: 3, Insightful

      Yeah I wonder about why they chose that particular license. I mean it's not a commericially viable product, and if it's meant to spur research and development then why not chose some sort of free software license.

      --
      "Technology.....the knack of so arranging the world that we don't have to experience it." Max Firsch
    4. Re:From the license... by damburger · · Score: 2, Insightful

      What puzzles me (apart from the amusing bit about decompiling something that was never compiled) is the prohibition on disassembly. Given the pretty much trivial mapping between assembly mnemonics and the actual binary files they distribute, it seems a silly thing to prohibit.

      --
      If we can put a man on the moon, why can't we shoot people for Apollo-related non-sequiturs?
    5. Re:From the license... by pentalive · · Score: 2, Insightful

      Why do you think "Task is easy to do" has anything to do with "The author and rights holder does not wish it done" ?

      Just because a thing is easy to do does not mean one automatically has some right to do it.

    6. Re:From the license... by damburger · · Score: 3, Interesting

      Because it would be like banning you from remembering (not even speaking) dialogue you remember from a movie. Its inane.

      --
      If we can put a man on the moon, why can't we shoot people for Apollo-related non-sequiturs?
    7. Re:From the license... by gbjbaanb · · Score: 3, Funny

      Hex? You had it easy.

      I had to flip switches on a front panel, in binary.

      Though come to think of it, when I was a child I had a 'computer' that was programmed by putting wires into holes in a breadboard. So.. binary, pah! I had it easy...

    8. Re:From the license... by Rockoon · · Score: 3, Insightful

      Decompiling never results in the original source code.

      I think only a few of the responders have a firm grip on the distinction between decompilers and disassemblers.

      The true distinction is not on the input to these programs, but instead on their output. You can feed a good decompiler some white noise and still get some high level source code.

      --
      "His name was James Damore."
    9. Re:From the license... by miffo.swe · · Score: 2, Funny

      Thats nothing, when i was a child i had a calculator that was a pile of pebbles. By putting them in different piles i could count different types of objects at the same time.

      --
      HTTP/1.1 400
    10. Re:From the license... by FlyByPC · · Score: 2, 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 and connoisseur of pretty shiny things.
    11. Re:From the license... by OwnedByTwoCats · · Score: 2, Insightful

      why would it not be a commercially viable product?

      Tiny User Base. So there's no incentive to be a developer for the platform. Doesn't support UNIX/POSIX standards, so it's not easy to port existing software to the platform. Freely available OSs have orders of magnitudes more users and developers, and far more reference material making them easier to learn. Who cares about fitting on a 1.4 MB floppy when 1 GB USB drives are practically free?

    12. Re:From the license... by gt6062b · · Score: 2, Funny

      So Johnny 5 didn't want to be turned into assembly code?

      Can't blame him, I wouldn't want that either.

    13. Re:From the license... by __aaxwdb6741 · · Score: 5, Insightful

      You are all incorrect in assuming that legalese (should|can|does|will) make any sense from a technical point of view.

    14. Re:From the license... by yesteraeon · · Score: 5, Insightful

      So if I find a book lying in the street can I pick it up and read it, or do I need to call the publisher to get a license? I think you're overstating the scope of copyright just a *tad*.

    15. Re:From the license... by pyster · · Score: 2, Interesting

      Commodore users were used to machine language monitors, where you could switch from hex, to binary, to ascii, to assembly. Assembly on this level is machine language, and anyone who says different is just an idiot. Its not compiled, it is just ran by executing a particular memory location. JSR = 20 = 32 = " " = 100000. Some of the better ML monitors actually displayed the opcodes with asm code. http://www.atariarchives.org/mlb/chapter1.php - this book points these facts out very clearly. Pretty much making them all the same low level languages. Now, when you start to use psudo ops, lables, variables, libraries, self relocating code, ect... its not on the same low level, but is still low level.

    16. Re:From the license... by GreatBunzinni · · Score: 4, Interesting

      If you had read the article you would know that they adopted FASM as their language/compiler, which offers features such as macros. As soon as you are producing source code files to be processed by programs whose work goes beyond simply mapping your instructions to machine code then we are no longer talking about assemblers. As soon as your code starts relying on features such as macros, libraries and other high-level abstractions then we have entered firmly in compiler country. After all, just because you name something as "assembly" it doesn't mean that the step between writing code and generating object code doesn't have a lot of abstraction in between. Just think of HLA for example.

      --
      Slashdot, fix your code or at least hire someone who is competent at it to do it for you.
    17. Re:From the license... by TheRaven64 · · Score: 3, Insightful
      Fitting onto a 1.44MB floppy is useful in some embedded contexts, because it means that it will also fit onto a small ROM chip or possible the on-die flash in a microcontroller. Unfortunately, being written entirely in x86 assembly disqualifies it from any such situation.

      I played with Menuet a year or so ago, and it is very impressive how much they've squeezed into such a small space. It boots almost instantly with a responsive GUI and a number of applications. It's not so impressive, however, when you compare it to something like RiscOS, which did the same thing on a 25MHz ARM2 with 1MB of RAM, or comparable operating systems of the time. It does highlight how poor an effort DOS was (although it requires protected mode, so won't run on anything before an 80386), but I think we already knew that.

      --
      I am TheRaven on Soylent News
    18. Re:From the license... by GIL_Dude · · Score: 5, Funny

      That must have sucked when they had a heap overflow. Someone could also step on them and seriously flatten the stack. I guess if there were too many, you could always throw the exceptions at someone, huh?

    19. Re:From the license... by norminator · · Score: 4, Funny

      I had to use butterflies:

      I opened my hands and let the delicate wings flap once. The disturbance ripples outward, changing the flow of the eddy currents in the upper atmosphere. These cause momentary pockets of higher-pressure air to form, which act as lenses that deflect incoming cosmic rays, focusing them to strike the drive platter and flip the desired bit.

      *shamelessly stolen from XKCD

    20. Re:From the license... by m.ducharme · · Score: 3, Funny

      For those of you not interested in following the link...there's an Emacs command for that.

      --
      Rule of Slashdot #0: You and people like you are not representative of the larger population. - A.C.
    21. Re:From the license... by tlhIngan · · Score: 2, Informative

      What puzzles me (apart from the amusing bit about decompiling something that was never compiled) is the prohibition on disassembly. Given the pretty much trivial mapping between assembly mnemonics and the actual binary files they distribute, it seems a silly thing to prohibit.

      You lose a lot on a disassembly though.

      Comments for one, and non-public symbols for another (including stuff like variable names, structure names and composition, etc), plus any oddball globals referenced through a base pointer. You lose enough that the disassembly is hard to look at, and this is stuff you lose with a basic 2-pass assembler.

      More advanced assemblers include functionality like macros, call handling (write stuff like "function do_something(param1, param2, param3)", "call do_something(r0, local_variable, constant)", and "return blah" and the assembler sets up the callstack, figures out a place for the the locals, etc), even conditionals (write "if (variable > something)" than a series of compare/test and branch instructions) and structure support. Often called "high-level assembly" because it ends up appearing a mix of assembly and C. Far more advanced than the basic 2-pass, but less advanced than a full-fledged C compiler. It's a great way to generate entry points that are architecture ABI compliant, while for the fast call stuff you can use your normal branch instructions.

    22. Re:From the license... by mR.bRiGhTsId3 · · Score: 2, Insightful

      I'm going to go out on a limb and say they re-used the license that was initially written with higher-level languages in mind. It prohibits 2 things they wanted to prohibit and prohibits a 3rd action that isn't possible. Why mess with a license that already says what you want.

    23. Re:From the license... by manifoldronin · · Score: 2, Funny

      why would it not be a commericially viable product?

      also if they just stuck it out there for anyone to fork off and do what they want with it - then they can quickly remove any chance of it being commericially viable.

      It's impressive work - let them share it how they want.

      I have a feeling that the Year of the MenuetOS on Desktop is coming soon.

      --
      Tyranny isn't the worst enemy of a democracy. Cynicism is.
    24. Re:From the license... by Khyber · · Score: 2, 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.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    25. Re:From the license... by Bigjeff5 · · Score: 2, Informative

      It's copyright, not readright. The copyright limits what you can -copy-, not read.

      In this case, under the terms of the license you are free to use (i.e. "read") the program, free of charge, but as soon as you disassemble it your right to use the software is revoked. What's tricky with software, is that in the simple act of "reading" involves copying the program several times (moving it from one drive to another, loading it into ram, loading the machine code into the cpu cache, etc).

      Now, reverse-engineering is legal, so this is not much more than a CYA on their part, and an attempt to discourage the disassembly of their product. However, technically speaking, if you run it through a disassembler your right to use the software is revoked. If it went to court, though, it would probably be considered a fair use given the case-law behind reverse-engineering.

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
    26. Re:From the license... by Shikaku · · Score: 2, Funny

      2009 is the year of the Emacs desktop!

    27. Re:From the license... by Bigjeff5 · · Score: 2, Informative

      We would write the code in assembly, then run a couple of command line programs over it to compile it into something that would actually run on the chip, then burn it to the firmware.

      That's an assembler, not a compiler. Assembly language is a unified set of mnemonics that translate into machine code. For assembly language to be assembled into a binary that the machine can run, you need an assembler that assembles assembly language into machine code.

      Compiled languages (like C, C++, C#, Fortran, VB, etc) run through a compiler, which compiles the high-level language into what is the equivalent of an assembly language, before assembling it into the binary machine-readable code.

      It's called a compiler because it takes the commands you entered in the source code and compiles all the instructions necessary to execute those commands into machine readable code. In assembly, you are already writing all the instructions in machine code format, you are simply using mnemonics to make it easier. The assembler replaces the mnemonics with the correct machine instructions and away you go.

      There are also interpreted languages, like Java or Python and others, which are not compiled - they are assembled on the fly by an interpreter.

      Programming in assembly is basically removing a step in the process, and it is very hardcore as far as programming goes. The only thing more hardcore would be programming directly into machine language, which needs no assembling or compiling. Of course, if you do that your code will only work on one specific type of CPU - like the intel 80386 or the 80486 or pentium pro, etc. The machine language for each of those is slightly different, programming in assembly avoids that pitfall. Programming in a compiled language makes your program portable across hardware architectures, and interpreted languages are potentially portable across all architectures and OS's - so long as a compatible interpreter exists for a given setup.

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
    28. Re:From the license... by Nefarious+Wheel · · Score: 2, Insightful

      Correct. And then we're also talking about information that can't be recovered by decompiling binaries, so the point is moot.

      Once you're done debugging, you don't need the symbol tables any more, yes? We may need the comfort of rich commentary and maintainability, but the system really only needs the instructions, opcodes, addresses, literals and data in the binary code to work. [Decompiled|Disassembled] stripped binaries are very hard to make sense of.

      In the olden days, we obscured code by renaming variable and constant names with some variation of "I"'s and "1"'s and "O"'s and "0"'s. Not as effective as adding the "strip symbol table" switch to the compiles, but far more fun, which mattered then. "O000O01I = o0oo0OI1" and variations were good for inducing headache. We took DRM into our own hands in those days.

      Ahh, to be a sadistic, bastard developer again. I miss that.

      --
      Do not mock my vision of impractical footwear
  2. But by rodrigoandrade · · Score: 3, Funny

    Does it run Linux?

    Oh wait...

  3. What! by jozmala · · Score: 2, Funny

    It seems their webserver isn't written in assembler.

    --
    ©God :Copyright is exclusive right for creator to determine the use of his creation.
  4. It's not FOSS? by Nursie · · Score: 3, Insightful

    It's free as in beer, AFAICT, but not open. That seems strange to me.

    1. Re:It's not FOSS? by Anonymous Coward · · Score: 5, Informative

      for anyone wanting to tinker - it had been forked before they closed it
      http://wiki.kolibrios.org/
      http://www.kolibrios.org/?p=SVN&kind=dir&loc=/kernel/trunk

    2. Re:It's not FOSS? by arndawg · · Score: 5, Funny

      Imagine what today's world would be like if Linus had gotten pissed when people started working with the Linux Kernel.

      I'm guessing the population in the western world would be higher.

    3. Re:It's not FOSS? by Nursie · · Score: 2, Funny

      There's always some smart-arse coming up with reasons to disallow free beer at work, dammit.

    4. Re:It's not FOSS? by pete_norm · · Score: 3, Funny

      All 5 of them?

  5. Stupid license. No thanks. by Desler · · Score: 4, Insightful

    Menuet64 Copyright (c) 2005-2009 Ville Turjanmaa

    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.

    Probably won't gain much steam with a license like that. Enjoy your obscurity and 3 users.

    1. Re:Stupid license. No thanks. by damburger · · Score: 5, Insightful

      More to the point, the prohibition on disassembly makes it impossible to independently verify their claim it was written in assembly language without violating their license, and that claim is central to the idea of this being an interesting research project.

      --
      If we can put a man on the moon, why can't we shoot people for Apollo-related non-sequiturs?
    2. Re:Stupid license. No thanks. by mdwh2 · · Score: 2, Insightful

      No software got popular with such a restrictive licence! Heaven forbid they give it away free for personal use, all the most popular OSs are free for all!

      (I don't disagree with you that it might seem a pointless licence, depending on what their plans for it are, but I don't think this has much relevance to popularity.)

    3. Re:Stupid license. No thanks. by Desler · · Score: 4, Insightful

      No software got popular with such a restrictive licence! Heaven forbid they give it away free for personal use, all the most popular OSs are free for all!

      The only non-free OSes that have have actually been used by more than 5 people actually provided more features than "Can play a 13 year old game fast".

      (I don't disagree with you that it might seem a pointless licence, depending on what their plans for it are, but I don't think this has much relevance to popularity.)

      Actually it does. Since this is clearly not a commercially viable OS the only segment of the population that might possibly use it would be tinkerers in the FOSS crowd, but they are going to be turned off by the license. There is really no viable reason to run the OS if you aren't allowed to tinker with the source code.

    4. Re:Stupid license. No thanks. by geckipede · · Score: 3, Insightful

      A far more serious issue in gaining popularity for this project is going to be hardware support. I've actually tried this OS, and discovered that if you cram everything into one floppy disc, there isn't much room left for a range of drivers. I'm fairly sure that this thing was designed and written to work on the developer's own computer, and practically nothing else.

    5. Re:Stupid license. No thanks. by babyrat · · Score: 2, Insightful

      Truthfully, though neat as a "Gee whiz" type of thing, I just don't see much practical application for Menuet.

      I recall hearing the same arguments regarding Linux and 386BSD back in the early 90's.

    6. Re:Stupid license. No thanks. by Verdatum · · Score: 3, Insightful

      Yeah? Well, you're a meanie-head!

    7. Re:Stupid license. No thanks. by Verdatum · · Score: 3, Interesting

      I realize this doesn't actually defeat your point, but still, to quote Linus' newsgroup post introducing Linux, "It is NOT portable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(."

    8. Re:Stupid license. No thanks. by ae1294 · · Score: 4, Insightful

      Probably won't gain much steam with a license like that. Enjoy your obscurity and 3 users.

      SO what?

      At least the they are doing something interesting... Maybe they will find someone who needs a really small and quick OS that is hacker-unfriendly. I'd personally love to see ATM machines running something like this instead of Win2k and XP....

      If by some oddball chance they can make some money off their hobby more power to them... Anyone who can code a OS in ASM is ok in my book and you got no room to judge them just because they are covering all their bases. I mean do you really not think some company wouldn't come and grab up all their work and laugh after spitting in these guys faces?

    9. Re:Stupid license. No thanks. by Desler · · Score: 2, Insightful

      At least the they are doing something interesting...

      What is interesting or novel about this? There have been numerous OSes written in assembly language. That was pretty much what you did before C came along and even for quite some time after wards. Secondly, writing an OS kernel in assembly was a project that many people did while in school making this pretty mundane to be honest.

      I mean do you really not think some company wouldn't come and grab up all their work and laugh after spitting in these guys faces

      Since no company stole the work during the years while it was under the GPL, I see no reason why they would have had to worry about it enough to change the license for that reason. Secondly, why would some company want to steal an OS that has little to no features when they could just incorporate the code from a BSD instead?

    10. Re:Stupid license. No thanks. by Joe+Jay+Bee · · Score: 3, Informative

      Score: 4, Insightful

      Sarcastic moderation on Slashdot? Fuck yes.

    11. Re:Stupid license. No thanks. by BikeHelmet · · Score: 2, Insightful

      Or you could pop a quick email off explaining what you want to do, and get permission.

  6. Not the best choice of languages by Anonymous Coward · · Score: 5, Insightful

    In today's multi-level cache, highly pipelined CPU environment, hand optimized assembly is not usually the best choice when compared to a good compiler. It's easier for bugs to hide, and small mistakes can cost way more than any possible optimization is going to buy you.

    1. Re:Not the best choice of languages by damburger · · Score: 4, Funny

      You are right of course. What they need is some kind of software tool that can automatically and quickly generate code optimized for any new hardware that comes out. Rather than code in the particular assembly language of the processor of the day they could write out their algorithms in some kind of abstract, human readable script, which the aforementioned tool would then convert to assembly language.

      Why has nobody thought to create such a useful tool for these poor chaps??

      --
      If we can put a man on the moon, why can't we shoot people for Apollo-related non-sequiturs?
    2. Re:Not the best choice of languages by jnaujok · · Score: 5, Insightful

      Spoken like someone who's never coded in Assembly. While I almost never touch assembly any more, there's very little fact in your statement. In assembler, everything is in front of you. There's no need to worry about what the libraries are doing, or whether the call to some function is going to cause side effects or something you didn't intend, or whether some compiler quirk is going to make your code take ten times longer to run.

      Having written in assembly on 8048, 8051, 8086 and DEC Vax boxes, I can tell you right now that debugging most of that code was a lot easier than chasing down the side effect from some array overwrite on leaked memory from a third-party library that you didn't even know was being linked into your code.

      Writing in a compiled language is easier, faster, and usually has a better set of pre-written functionality, but never, ever claim that it's going to be more optimized. Even with pipelining updates from the compilers that help the look-ahead caches on the CPU, there's very few times that hand-coded assembler isn't going to be faster.

      Go look at the assembler that some of these compilers produce. It's frightening to see the amount of overhead they cost on even simple assignment operations. I saw one compiler (Microsoft's Visual C++) that took a simple x=10; in C++ and turned it into 15 assembly language operations that, had it been coded by hand, would have been one MOV statement. The compiler turned it into conditional conversions for type, did some byte order and range checking on it (for a hard assign to a constant -- rolls eyes) and then finally did the same MOV AX, 0x0a that you would have coded by hand.

      --
      Life, the Universe, and Everything... in my image.
    3. Re:Not the best choice of languages by Desler · · Score: 5, Insightful
      Actually his points are quite valid. It is not a good choice to write everything in assembly when the speedups you gain in most places is not worth the amount of time and effort you spend in hand-optimizing the code. And considering how many bugs I've seen in people's asm code that they didn't spot till later his second point is also true.

      Even with pipelining updates from the compilers that help the look-ahead caches on the CPU, there's very few times that hand-coded assembler isn't going to be faster.

      The GP never made that claim.

    4. Re:Not the best choice of languages by Rockoon · · Score: 2, Informative

      ..and thats why the fastest encryption libraries are written in high level languages, right?

      oh, erm.. encryption algorithms need the exact things you claim compilers are great at, yet the fastest encryption libraries are in hand-written assembler.

      The fact is that this "compilers are better than humans" meme is complete bullshit and has always been bullshit. This fact can clearly be demonstrated by looking at the change logs of those compilers. For well over a decade this meme has been out there and for well over a decade there has been continual performance improvements to those compilers..

      ..and to top it all off, if you arent using ICC then your compiler is shitty even compared to other compilers. The easiest optimization a VC or GCC programmer can make is to switch to ICC.

      What it all boils down to is that HLL's use an abstract machine that has nothing at all to do with the real world details of computing on a specific architecture, and that my friend is why hand written essembler will always win the performance war.

      --
      "His name was James Damore."
    5. Re:Not the best choice of languages by rodsoft · · Score: 2, Informative

      Go look at the assembler that some of these compilers produce. It's frightening to see the amount of overhead they cost on even simple assignment operations.

      I doubt this kind of code is being generated in *RELEASE* builds. I often check the code being generated in inner loops and most of the time it's the Right Thing (tm). I'm pretty amused to see that the compiler can aggregate calls to sin/cos with the same argument into a single fsincos call, or vectorize some loops over arrays. That's like having the best of two worlds: human readable code that maps directly to the problem at hand AND very well optimized generated code. And given a new CPU and a compiler that understands its architecture and can take advantage of it, my higher level code will profit from it with minimal change. PS: higher level code -> C++

    6. Re:Not the best choice of languages by Cereal+Box · · Score: 2, Insightful

      Assembly is best for optimizing limited sections of code where your specific domain knowledge can allow you to make optimizations the compiler wouldn't know about. It makes sense in those situations, and that's it. Writing an entire, non-trivial application (or OS in this case) is a waste of time since

      • you're going to spend far more time coding than you would in a high-level language
      • your chance of introducing bugs is far greater
      • your code loses portability

      And most importantly, for everything except the most critical number-crunching algorithms your app deals with, any performance edge you may gain against a compiler will be so minuscule as to not matter.

    7. Re:Not the best choice of languages by Hurricane78 · · Score: 3, 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.

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    8. Re:Not the best choice of languages by operagost · · Score: 2, Insightful
      From the GP post:

      In today's multi-level cache, highly pipelined CPU environment

      None of the CPUs you mentioned have those features.

      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    9. Re:Not the best choice of languages by TheRaven64 · · Score: 4, Insightful
      Which encryption routines are these and what architecture are they written for? The fastest encryption routines I'm aware of are written in GLSL which is not just compiled, it's compiled to bytecode then JIT-compiled by the driver when the program is loaded! The second fastest use dedicated crypto hardware, via (C) ioctl() functions calling a driver, which is written in C. Oh and:

      For well over a decade this meme has been out there and for well over a decade there has been continual performance improvements to those compilers.

      Just because version n+1 of a compiler is better than version n of a compiler doesn't mean that version n isn't better than a human. Maybe you can do cross-module function specialisation in your head, but the rest of us aren't so lucky.

      --
      I am TheRaven on Soylent News
    10. Re:Not the best choice of languages by adisakp · · Score: 5, Informative

      Writing in a compiled language is easier, faster, and usually has a better set of pre-written functionality, but never, ever claim that it's going to be more optimized. Even with pipelining updates from the compilers that help the look-ahead caches on the CPU, there's very few times that hand-coded assembler isn't going to be faster.

      As CPU's become more complex, this is less and less true. For example, even on the PS2, they created a tool called VCL that preprocessed assembler for you for maximum usage of registers, unrolling, and pipelining. It generated better optimized code than 99% of of coders out there could do on their own and at a fraction of the effort to seriously fully optimize pipelined assembler -- not to mention the asm code was much more maintainable since with handrolled manually pipelined code you may have to re-optimize everything if you change a single register or just a few instructions. Also, things like the auto-unroll and auto-register-assignment a were huge time saver (it could unroll a loop NX and allocate NX registers to interleave SIMD operations to hide latencies).

      That's not to say that a really great ASM programmer wouldn't do better than VCL, but he would have to work much much harder. You'd have to track all the registers yourself, remember the pipelining rules and latencies for every single instruction, be willing to experiment with unrolling every loop and counting cycles between unrolled (with prologs/epilogs) and normal versions, know all the possible instruction swaps, synchronize the integer and vector pipelines manually, try nearly all possible instruction orders, etc. Certainly an average assembler programmer wouldn't do as well.

    11. Re:Not the best choice of languages by Just+Some+Guy · · Score: 2, Insightful

      That's not to say that a really great ASM programmer wouldn't do better than VCL, but he would have to work much much harder. You'd have to [...]

      ...start from scratch when someone rolls out a different chip design that obsoletes all your assumptions or when you learn a new optimization technique. I'd much rather write at a higher level and let new versions of the compiler handle updated architectures, and automatically adjust all my old code whenever their optimizers improve.

      --
      Dewey, what part of this looks like authorities should be involved?
    12. Re:Not the best choice of languages by microbee · · Score: 2, Insightful

      Well I guess the compilers/CPU architecture have advanced enough that some of your old experience doesn't apply anymore.

  7. That's just dumb. And kinda cool. by localman57 · · Score: 5, Interesting

    The article is slashdotted, so I'll post a thought without RTFA. I do embedded firmware for a living; assembly programming is part of my job. But unless you have to fit all of your software into a $.42 micro, there's no reason to write all your software in assembly. Typically, you get most of your performance gains by rewriting 5% or less of the software in assembly [Citation needed... :-)]. As for the rest, go with C or higher for maintainability and portability.

    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.

  8. They should... by oldhack · · Score: 4, Funny

    Man, they should, like, totally port that to ARM. ;-)

    --
    Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
  9. "it can even fit on a floppy disk"... by martas · · Score: 5, Funny

    *blink*

    is that some kind of new super-awesome flexible organic flash memory?

    1. Re:"it can even fit on a floppy disk"... by RyuuzakiTetsuya · · Score: 2, Funny

      No, it's yet another proprietary Sony format that Sony is going to try to force on consumers.

      RIOT AGAINST SONY AND THEIR "FLOPPY" DISKS! PROPRIETARY I SAY!

      --
      Non impediti ratione cogitationus.
  10. Not that amazing by jdunn14 · · Score: 4, 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

    1. Re:Not that amazing by Massacrifice · · Score: 3, 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.

      --
      -- Home is where you eat your heart out.
    2. Re:Not that amazing by dawnpatrol1623 · · Score: 2, Insightful

      I agree, Synthesis was a much bigger achievement with a much grander vision.

    3. Re:Not that amazing by Lemming+Mark · · Score: 3, Insightful

      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.

      Yeah, I read somewhere that that was the reason everybody's given up on the Synthesis techniques today. A shame, in a way, as it was a really cool system.

    4. Re:Not that amazing by TheRaven64 · · Score: 2, Insightful

      As someone who hacks on LLVM... you don't want to put it in the kernel unless you like crashes whenever it hits an assert() statement. In would like to integrate it into the loader though, so the first time you run a program it runs a JIT-compiled version with profiling code all over the place then emits an optimised static-compiled version for later (I've started doing this a bit with LanguageKit, but it would be better if it moved a layer down the stack). Unfortunately, the link-time optimisation stuff in LLVM isn't really well-designed for keeping code in separate modules, which is important if you want to take advantage of shared libraries (you don't want every program to have its own copy of libc, for example. If I did that, my memory would currently have 500MB filled with libc copies). Hopefully this will change soon...

      --
      I am TheRaven on Soylent News
    5. Re:Not that amazing by noidentity · · Score: 3, Informative

      Yes, Synthesis is very cool. Apparently file buffers were handled with on-the-fly code with the buffer pointer embedded within it, and without explicit checks, instead relying on an unmapped page just past the end and a page fault handler to refill the buffer (at least that's how I remember the author explaining it to me). I believe the author is also the one who original wrote the Superoptimizer.

    6. Re:Not that amazing by noidentity · · Score: 2, Informative

      I found a better description of how it essentially does just-in-time compilation, treating even the pointer to the file, buffer etc. as constants, thus resulting in different compiled code for each file opened.

      (argh, link was borked in the previous post)

  11. Followup to Menuet by halfdan+the+black · · Score: 5, Funny

    I think I might work on a sequel...
    Build a 747 with nothing but stone knives and bear skins...

    1. Re:Followup to Menuet by mikael · · Score: 2, Funny
      --
      Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
    2. Re:Followup to Menuet by fahrbot-bot · · Score: 2, Informative

      macguiver, is that you?

      Actually, that would be Mr. Spock (to Edith Keeler), from TOS episode, "The City on the Edge of Forever":

      I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins.

      Please turn in your Geek card :-)

      --
      It must have been something you assimilated. . . .
  12. Thanks for your great accomplishments! by Shin-LaC · · Score: 2, Funny

    Hard drive makers, you have my eternal gratitude.

  13. Re:That's just dumb. And kinda cool. by cabjf · · Score: 3, Informative

    I agree, the major advantages of assembly for that other 95 percent would be negated by a good C or higher compiler that will probably write more efficient and faster binaries than most programmers could using assembly.

  14. Re:That's kinda cool. by b4dc0d3r · · Score: 2, Insightful

    The point was to write an OS in assembly, so all of your analysis is irrelevant.

    It's monumentally cool, and academic. The point wasn't to have a portable OS, and assembly can be very maintainable if structured correctly.

    If they wanted a lightweight, portable OS they would have chosen a different language.

  15. Kolibri: a Menuet offshoot by dargndorp · · Score: 4, Informative

    Since all links in the article submission seem to be slashdotted, an offshoot of Menuet OS named KolibriOS is located at http://www.kolibrios.org/?&lang=en.

    1. Re:Kolibri: a Menuet offshoot by impaledsunset · · Score: 2, Insightful

      How is KolibriOS "based on" Menuet, given than the former is GPL, and the latter is under a proprietary license? Their history page seems empty, and the only description I found on their page is in Russian, which I'm not good in.

    2. Re:Kolibri: a Menuet offshoot by MBGMorden · · Score: 4, Informative

      Kolibri is a fork of the 32-bit Menuet OS which WAS GPL. When Menuet went proprietary then community forked the GPL version.

      --
      "People who think they know everything are very annoying to those of us who do."-Mark Twain
  16. Fast due to assembly or fast because it's minimal? by Walter+White · · Score: 5, Insightful

    I have to wonder if it is small and fast because when writing in assembly it is easier to resist the urge to add features. Todays compilers are pretty good and can produce pretty tight binaries. However, you can write (and debug) a lot more code in a given time using a high level language.

  17. obsolete technology by gsslay · · Score: 5, Funny

    (it can even fit on a floppy disk, despite having a GUI)

    Excellent, but if we're going to measure these things in obsolete technology;

    - How many parchments would I need to copy it?
    - Could my team of monks transcribe it in its entirety before the Feast of All Hallows Eve?
    - If the Germans intercepted a morse transmissions of it, how long would it take them to crack the code and scupper our plans to retake mainland Europe?

  18. Re:That's just dumb. And kinda cool. by timeOday · · Score: 4, Interesting

    Interestingly, their homepage does not tout execution speed as a motivation: "Menuet has no roots within UNIX or the POSIX standards, nor is it based on any operating system. The design goal has been to remove the extra layers between different parts of an OS, which normally complicate programming and create bugs." It sounds to me more like they are fed up with all the clutter and layers of abstraction in a modern OS and want to see what happens if you start with a clean slate. Then again, without open source, the aesthetic appeal of this "clean" approach is limited.

  19. Re:Quake? by bluefoxlucid · · Score: 2, Informative

    Quake is a highly parallel program with dozens or hundreds of threads running at once just to support its physics, AI, and player control operations. The original DOS version brought its own threading library (compiled in); as Quake was written on more modern OSes and ported to DOS, the original implementation used OS calls while the DOS version used an application-level thread manager.

  20. What's a Floppy Disk? by mdwh2 · · Score: 2, Informative

    it can even fit on a floppy disk, despite having a GUI

    Those of us who still remember floppy disks should also remember that having a GUI with an OS that fits on a floppy is nothing new. For the most recent example, see the QNX floppy demo. (Was QNX written in assembly?)

  21. Re:That's just dumb. And kinda cool. by hey! · · Score: 4, Informative

    I agree. Every time I've ever profiled code, I've been amazed at how much time is spent in such tiny portions of the code.

    It's an interesting exercise though. I've only done a little assembler, but my thoughts were that if I did more of this I could get pretty good at it. The trick in any kind of programming is to learn to express *ideas*. I learned several different programming paradigms over the course of my career, and while I'm doing OO like everyone else these days, having tried functional programming makes me a better programmer.

    I could imagine doing non-trivial systems in assembler, but mainly if the problem domain and its solutions are very well understood. When you see that 1% of your code is taking 99% of your execution time, you *could* tighten that code and get an immediate payback, or you could try understand the problem better in order to find a more efficient algorithm. If you can improve your algorithms, that's almost always going to be a bigger win.

    We've been making essentially modern operating systems (virtual memory, process scheduling etc.) for a long time. If you just wanted to implement the textbook approaches for everything, and didn't care about architecture portability, it seems pretty feasible for a couple of guys to make a reasonably credible OS in assembler, provided they knew their OS stuff and were very good assembly programmers. Obviously the C with assembly for tight loops approach is a quicker path to a usable system, but the fact that they're assembly enthusiasts probably means they'll get more benefit out assembler where it is most useful and less benefit out of C where assembler is least useful than a sane programmer would. And it's always worthwhile to demonstrate the limits of conventional wisdom.

    SInce you work in embedded systems, I don't have to tell you that upgrading your processor in six months isn't always an option.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  22. Re:That's kinda cool. by El_Muerte_TDS · · Score: 3, Insightful

    What's academic about writing an OS in assembly?

  23. networking by james_shoemaker · · Score: 4, Interesting

    Too bad it doesn't have wireless networking support, it looked to be the perfect thing to make older notebook computers useful.

    1. Re:networking by couchslug · · Score: 3, Informative

      Damn Small Linux and Puppy Linux work well on older machines. Give 'em a try.

      http://www.damnsmalllinux.org/

      www.puppylinux.org/

      --
      "This post is an artistic work of fiction and falsehood. Only a fool would take anything posted here as fact."
  24. No by hasbeard · · Score: 4, Funny

    No, a floppy disk is what you get when you leave a DVD in the back window of your car on a hot day.

  25. Ehhh..... by OwnedByTwoCats · · Score: 5, Insightful

    Ehhh. The whole effort doesn't impress me. There are/were Linux distros that fit onto a floppy. OSs were written in Assembly for years.

    If they can demonstrate that "remov[ing] the extra layers between different parts of an OS" simplifies programming and eliminates bugs, then they'll have something interesting. And they can have a flame war with the microkernel folks, who assert that separating the OS into separate parts that are independent and can be thoroughly tested simplifies programming and eliminates bugs.

    Abstractions have a purpose; they make it easier to think about things. There are no "Files" or "Folders" (or "Directories", for those of a Unix persuasion) on your hard drive; there are only a sequence of blocks. The Operating System provides the abstraction of files. Various protocols and their implementations then provide an abstraction that "Files" and "Folders" on remote machines are just like "Files" and "Folders" on the local drive.

    If abstractions make life complicated for the OS developer, but easier for the user, is it a win? It depends on whether the OS has more developers or users.

  26. Given that by warrax_666 · · Score: 2, Informative

    Given that most assemblers are macro assemblers, I'd imagine that disassembly doesn't give the original source code back. You get an equivalent source code, but it might be considerably harder to read (depending on macro usage, obviously).

    --
    HAND.
  27. Re:That's just dumb. And kinda cool. by FlyByPC · · Score: 2, 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 (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).

    --
    Paleotechnologist and connoisseur of pretty shiny things.
  28. Re:That's just dumb. And kinda cool. by orzetto · · Score: 2

    Typically, you get most of your performance gains by rewriting 5% or less of the software in assembly [Citation needed... :-)]

    <ref>Donald Knuth, in "Structured Programming with Goto Statements". Computing Surveys 6:4 (December 1974), p. 267: "Experience has shown [...] that most of the running time in non-IO-bound programs is concentrated in about 3% of the source text".</ref>

    --
    Victims of 9/11: <3000. Traffic in the US: >30,000/y
  29. Re:That's kinda cool. by pnewhook · · Score: 2, Informative

    What's academic about writing an OS in assembly?

    Actually writing an OS in assembler on a 680x0 was part of my engineering degree. Also had to write a real time multithread scheduler.

    --
    Tesla was a genius. Edison however was a overrated hack who liked to torture puppies.
  30. Assembly language doesn't scale by Joce640k · · Score: 3, 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++.

    --
    No sig today...
  31. My Javascript OS by Maltheus · · Score: 3, Funny

    I guess now is not the right time to announce my OS written entirely in Javascript. It can already play the Bill Gates Pie in the Face game.

  32. Re:Yes! by Just+Some+Guy · · Score: 4, Funny

    Can't put one past you, can they.

    --
    Dewey, what part of this looks like authorities should be involved?
  33. Re:That's kinda cool. by El_Muerte_TDS · · Score: 3, Insightful

    I also had to create slides for a presentation for my degree, but that doesn't make it academic.

  34. menuet 32-bit is Open Source by Anonymous Coward · · Score: 2, Insightful

    Hey tards, you do know the 32-bit version is open-source, don't you? Go examine that. But, I bet none of you who are criticizing it being in assembly can even read ANY assembly.

  35. Re:Should have used Java by Vovk · · Score: 2, Funny

    you fool! Java's 50,000% speed increase in respect to C, C++ will never overcome the benefits of programming in FORTRAN!

    Real programmers program in FORTRAN! It is the perfect and most complete programming language! FORTRAN is simultaneously the language of the future AND the past!

    Anything C can do, FORTRAN can do better AND automatically! FORTRAN will take us to new heights as a human race!

    FORTRAN will make your computer do work before you even think it!

  36. System Libraries exception by tepples · · Score: 2, Informative

    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?

    It depends on how one defines "integrate". If "integrate" just means porting to its API, then porting a GPL app to MenuetOS doesn't bring the operating system under GPL any more than porting it Windows. Both GPL versions 2 and 3 have an exception for linking to an operating system's System Libraries.

  37. Cool GUI. by Pedrito · · Score: 2, Funny

    Wow, it's been since Windows 1.x that I've seen a GUI that looked like it was written in assembly. How retro.

  38. Am I hearing you correctly? by k.a.f. · · Score: 2, Informative

    Interestingly, their homepage does not tout execution speed as a motivation: "Menuet has no roots within UNIX or the POSIX standards, nor is it based on any operating system. The design goal has been to remove the extra layers between different parts of an OS, which normally complicate programming and create bugs."

    Layers complicate programming and create bugs? Really? As in, "the whole modular programming thing is just a fad"? If these guys can actually honestly claim that they program better in the big ball of mud paradigm, they must be super-geniuses, and trying to collaborate would be impossible for the normal geek anyway.

    1. Re:Am I hearing you correctly? by timeOday · · Score: 2, Insightful
      Well, they said "extra layers," not all layers. Obviously, what is "extra" becomes a matter of taste. But it is true that most OS's carry a huge burden of legacy compatibility. Another problem is "feature bloat" with lots of code to support features that weren't that useful after all. (For example, the POSIX apis for networking seem awfully obtuse, mainly because they treat TCP/IP as just one of many network protocols, even though nobody uses the others any more).

      All of this is just the normal software cycle - hopefully you start with a good design that represents the problems at hand at the time. But eventually the requirements change and the original design becomes insufficient, or outright irrelevant, or muddled by refactoring by people with different designs in mind (or outright hacking), until eventually you get a strong urge to chuck the whole thing and start over - which is what they are doing.

  39. Re:Quake? by TheRaven64 · · Score: 3, Insightful

    Citation massively needed. I've poked around briefly in the Quake source code and found nothing like this (although it does make some use of coroutines). And, even if true, the fact that it contains its own threading implementation and doesn't require anything more than the OS than timer interrupts does nothing to counter the grandparent's point. Quake has been ported to Java and, even with the software renderer, ran well several years ago on a then-modern CPU, so it's hardly an example of something particularly demanding on either the CPU or the OS.

    --
    I am TheRaven on Soylent News
  40. Re:Fast due to assembly or fast because it's minim by TheRaven64 · · Score: 2, Insightful

    The one implies the other. It is very hard to write large, structured, maintainable, assembly code. If your goal is to write structured, maintainable, assembly code then you end up with small and simple code out of necessity.

    --
    I am TheRaven on Soylent News
  41. Re:Should have used Java by Desler · · Score: 2, Insightful

    I know this is being sarcastic, but if you are doing huge amounts of number crunching you are better off writing it in FORTRAN as it will be faster.

  42. Mac OS 6 by 4D6963 · · Score: 2, 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.

    --
    You just got troll'd!
  43. Re:Should have used Java by SL+Baur · · Score: 2, Informative

    Whoosh. The point of doing number crunching in FORTRAN is that FORTRAN does not reorder expressions. This is critical to maintain accuracy in certain computations.

    Who cares how fast it is if you come up with the wrong answer?