7 ms·
OMU – “One Man Unix”
- bryanlarsen 6y agoYou don't need an MMU nor tons of RAM to do multitasking, just a timer interrupt. It's a lot easier if you require position independent code rather than doing fixups. The 6809 is a beautiful instruction set that makes position independent re-entrant code easy. Of course an MMU and/or lots of RAM does make multitasking a lot easier. OS-9 is an awesome UNIX-like for the 6809 that can do it in 64K or less.
- kiwidrew 6y agoIndeed, hooking the timer (or keyboard) interrupt was also the way to do "multitasking" (TSRs) in x86 real mode under MS-DOS. The much-maligned x86 segment registers do come in handy here: they provide hardware-accelerated position independent memory addressing! Most DOS utility programs were small enough to fit in a single 64K segment, and provided they never touched the segment registers, these programs were trivially relocatable to any memory address.
- butterisgood 6y agoSpinnaker Sidekick worked this way I believe but wasn’t compatible with some software (presumably those that touched segment registers)
- Avshalom 6y agothe open source NitrOS9 is still active even. https://sourceforge.net/p/nitros9/code/ci/default/tree/ https://sourceforge.net/p/nitros9/code/ci/default/tree/
- moonchild 6y agoYou don't even need a timer interrupt, if userspace is well-behaved. Especially if user input is interrupt-based (think ^C to cancel; triggers context switch -> signal, can also have a kernel fallback for buggy userspace that tries to ignore the signal and refuses to yield).
- dfox 6y agoWhat you need timer interrupt for is “true” preemptive multitasking/threading. For many applications that makes quite large difference in programmer comfort (ie. you can just run CPU-bound computation without any regard to yielding to other tasks). On the other hand you can successfully create create multitasking-like user experience without any OS level support for that simply by making everything event-driven.
- slackfan 6y agoThe userspace, however, can never be assumed to be well-behaved.
- marcodiego 6y agoA MMU is not needed for multi-tasking, but it is needed for memory protection. I wonder how well a system could work if its binaries were written on a bytecode that could be compiled to safe native code, making sure that it would not access non-permitted memory. This bytecode would be compiled at program load time. This could guarantee memory safety and a very small performance penalty.
- pjmlp 6y agoPlenty of mainframes have worked like that. IBM mainframes still do on their classical mode, the bytecode gets AOT compiled at installation time, or when the binaries need to be refreshed due to changes on the hardware. Burroughs B5500, nowadays still sold by Unisys as ClearPath MCP, was already doing this in 1961.
- skissane 6y ago> IBM mainframes still do on their classical mode, the bytecode gets AOT compiled at installation time, or when the binaries need to be refreshed due to changes on the hardware. I suspect in this comment you are confusing IBM i and its predecessors (i5, AS/400, System/38) with IBM mainframes (z, 390, 370, 360). The former do what you are talking about, the later don't. In proper IBM terminology, the former are called midrange systems, not mainframes.
- pjmlp 6y agoNope, IBM z still has language environments, and I call all of them mainframes, instead of precise definitions, because everyone without experience has a vague idea what a mainframe is, whereas midrange systems, most likely requires a Wikipedia visit for most of the audience.
- skissane 6y ago> Nope, IBM z still has language environments What are you talking about? When you say "IBM z", which OS are you talking about – z/OS, z/VM, z/VSE, z/TPF or z/Linux? Which "language environments" are you referring to? Do you mean "z/OS Language Environment"? That doesn't involve "bytecode" in the sense that OPM/EPM/ILE on OS/400 do. LE (on z/OS, z/VM and z/VSE) and ILE (on OS/400) are descendants of the same code base (and I believe that code base was even ported to OS/2 at one point), but ILE on OS/400 does some very OS/400-specific things which never happened on MVS, VM/CMS, DOS/VSE or OS/2. You started out by saying: > IBM mainframes still do on their classical mode, the bytecode gets AOT compiled at installation time, or when the binaries need to be refreshed due to changes on the hardware. That is kind of true for IBM i, but just false for IBM z. > I call all of them mainframes, instead of precise definitions, because everyone without experience has a vague idea what a mainframe is, whereas midrange systems, most likely requires a Wikipedia visit for most of the audience. While "midrange" is a bit of an obscure IBMism, most people have heard of "minicomputer", and have the historic understanding of a "minicomputer" as something in between a microcomputer and a mainframe. I think "minicomputer" would be more accurate than "mainframe" when referring to the S/38 and its successors. Calling the later "mainframes" is just going to confuse anyone familiar with the proper IBM terminology. I get the impression you like to make comments like "IBM did X years before this did" but they make you come across as someone opining on something they don't know a lot about, and you end up saying things which make people who know more about the topic than you do cringe.
- tambourine_man 6y agoI have a huge respect and admiration for anyone who embarks on a journey of writing something like an OS and compiler from scratch.
- d_tr 6y agoI am a couple of months into studying math for creating my own programming language. The larger goal is a complete system in an FPGA, having a few central ideas about how I want it to be, but the language seems like the hardest part of the "project", by far I would say. Having finished intro books on logic, automata and category theory, I am now starting "Type Theory and Formal Proof" and writing a general purpose parser. Even if I end up, for whatever reason, abandoning it before doing anything, the journey is definitely worth it.
- tambourine_man 6y agoI hope you pull through and show us your work here. I love playing with low level stuff, but never manage to delve into an ambitious project. Bon voyage :)
- ajxs 6y agoCoincidentally I just embarked on learning about the 6809 architecture. I became interested in the architecture after discovering a generation of synthesizers, such as Yamaha's DX line or Ensoniq's ESQ-1/SQ-80, in the mid 1980s were built around CPUs using it. I've been disassembling the freely available Operating System ROMs in an attempt to learn more about how these devices were programmed. The differences between the 6809 and modern architectures makes for some interesting learning!
- retrac 6y ago> The differences between the 6809 and modern architectures makes for some interesting learning! Funnily enough, the 6809 is by far the most "modern" 8-bit design. It was the last major one, released after the Intel 8086 and some other 16 bit designs. Stack-relative addressing (with two stacks!), position-independent code, 16 bit arithmetic, hardware multiplication, and high code density. Very nice compared with the likes of the Z80 or 6502.
- anta40 6y agoImagine you are interviewing a developer and find this line in his/her CV: Personal achivement: - I built my own OS and C compiler Looks really impressive today, but perhaps it was the norm 3 or 4 decads ago. Anyway, I envy such people who can do that. Let me try that once again.... :)
- bombcar 6y agoIt’s a feat - but do remember that a simple OS and a simple compiler are NOT the beasts we think of today. DOS for example is not much more than a standard library- and early UNIX wasn’t much more.
- simonblack 6y agoSounds like a good project. Version 7 was where the flood gates of UNIX finally opened. Even Microsoft had a version, 'Xenix', which eventually became SCO UNIX. I sometimes wonder what the world would be like if Microsoft had continued in the UNIX universe, instead of in their own isolated development. Coherent was the v-7 clone by the Mark Williams Company that introduced me to the wonderful world of UNIX. It's now open-sourced, and I have used it in a Linux x86 VM.