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

18 of 419 comments (clear)

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

  2. 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.
  3. Re:Stupid license. No thanks. by i.r.id10t · · Score: 1, 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?

    --
    Don't blame me, I voted for Kodos
  4. 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?
  5. 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.

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

  8. Been done already... by Anonymous Coward · · 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)

  9. 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.
  10. 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...
  11. 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.

  12. 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.
  13. 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.
  14. 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 :-(."

  15. 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.
  16. Re:Stupid license. No thanks. by Anonymous Coward · · 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."

  17. 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!