5 ms·
I built a small multitasking kernel with a friend with a 68000 (m68000) in college. We implemented it on breadboards, I think with 30 or so feet of jumpers [0].
by dymk 4y ago
I built a small multitasking kernel with a friend with a 68000 (m68000) in college. We implemented it on breadboards, I think with 30 or so feet of jumpers [0]. I had very little prior embedded experience, so it was trial by fire.
It was a wonderful introduction to how kernels work (or at least concurrency and scheduling) at their most basic level, without having to deal with the complexity of virtual address spaces, memory protection, or the byzantine bring-up dance of register prodding that x86_64 needs. It prepared me well for my operating systems class the next year, and as far as I can tell, was the eye-catcher project that got me an internship on a team doing kernel development the following summer.
The instruction set is also a dream. Super CISC-y, yet more enjoyable (and IMO easier to grok) than x86. Take a look: http://wpage.unina.it/rcanonic/didattica/ce1/docs/68000.pdf http://wpage.unina.it/rcanonic/didattica/ce1/docs/68000.pdf
My favorite is DBcc - "Test condition, decrement, and branch". All in one instruction.
[0] - https://i.imgur.com/MKD7wTv.jpg https://i.imgur.com/MKD7wTv.jpg
Here's the code - I have no idea how it works anymore, and I believe it's incomplete compared to what I had running. The complete code archive I think is lost to time - https://github.com/dymk/68k/blob/master/projects/libraries/libmultitask/sched.s https://github.com/dymk/68k/blob/master/projects/libraries/l...
My friend wrote up a much more comprehensive document on the build:
https://github.com/ZigZagJoe/68k https://github.com/ZigZagJoe/68k
https://docs.google.com/document/d/1ejW_Ist19tIXeA5HtEWixaLoc0-sR_q8bySJj5Sa7iY/edit https://docs.google.com/document/d/1ejW_Ist19tIXeA5HtEWixaLo...
- pinewurst 4y agoThe 6800 is nothing like the 68000.
- dymk 4y agoWell, it was the predecessor :)
- djmips 4y agoSort of. I mean they were both made by Motorola and both had then #6800 in them...
- mek6800d2 4y agoThere was the 6809 in between. I remember BYTE magazine's cover story, "A Microprocessor for the Revolution". Well, not quite, as it turned out! :)
- mark-r 4y agoI never got to use the 6800, but did use both the 6809 and 68000 in assembler. Both were a joy to work with.
- KerrAvon 4y agoI never encountered the 6800, but I did talk to people in the 90's who thought the 6800 was pretty bad and the 6809 pretty good. The 68000 is really a different class of CPU entirely, so I'm not sure why folks are discussing it here. Only the name is similar.
- danachow 4y agoThe 6809 had some hobbyist/consumer prominence on this side of the pond in the TRS-80 CoCo - and some European similars. And there was a multitasking OS written for it - OS-9. OS-9 has an interesting history in its own right. It was ported to a wide range of subsequent architectures. All sorts of applications - Fairlight synths, Philips CD-i, most of the traffic lights in the US in the 80s and 90s to name a few.
- ncmncm 4y agoThe 6809 was used in a production gadget, the Vectrex, the only vector-graphic consumer videogame console. It came with a screen that worked like an oscilloscope -- no raster, just an electron beam sweeping along the line. So, no jaggies. As it was necessarily monotone, games came with clear plastic color overlays for the screen. 6809 was notable as the first 8-bit microprocessor with a multiply instruction: 8x8->16 bits.
- ddingus 4y agoIt was also in some Williams games, including my favorite: DEFENDER. Crazy what could be done just pushing pixels at 1Mhz!
- deleted 4y ago[deleted]
- systems_glitch 4y agoVery cool! Do note that the Wikipedia page is about the 6800 (Sixty-Eight Hundred), though, not the 68K. A generation earlier, 8-bit, far less popular in end-user applications than the 68K. Still a good processor.
- deaddodo 4y agoIt was only unpopular because the 6502 was built by the same engineers and came out relatively soon after at a much lower price point. In fact, the 6501 (architecturally the same as a 6502) was pin compatible with the 6800 and was discontinued after a lawsuit. I actually preferred aspects of the 6800 series, particularly the addressing options.
- Teknoman117 4y agoI think the x86_64 chips are fairly unique in terms of how hilariously awful the bring-up process is. I'd hate to be a microcode engineer on one of them. So much state. Then throw virtualization into the mix.
- deaddodo 4y agoThey’re only terrible because they needed to be backwards compatible with 32-bit x86 code. Once they’ve been bootstrapped into pure 64-bit mode, they’re a bit better.
- Doctor_Fegg 4y ago> "Test condition, decrement, and branch". All in one instruction The Z80 had that too - DJNZ (Decrement and Jump if Not Zero). Standard way of writing loops.
- drfuchs 4y agoThe IBM 360 had BCT back in 1964. Rumor had it that it was created for Fortran DO statements (“for-loops”), but IBM’s compiler never emitted it. “The BCT instruction subtracts 1 from the value of the contents of the target register specified in the first argument. If the value in the target register after the subtraction is zero, no branch occurs. Otherwise the program branches to the specified address.”
- ataylor284_ 4y agoThe 8080 lacked this, but even though the 8086 was more or less based on the 8080, this probably inspired the 8086 LOOPNZ instruction. Same idea, hardcoded to use the CX register instead of B on the Z80. The unoffical nicknames for the AX, BX, CX, DX were accumulator, base, count, and data. CX was used for the count for all looping and string move instructions. Similarly, BX was special purpose for indirect operations and AX/DX for certain logic and arithmetic instructions.
- bonzini 4y agoAX/CX/DX/BX (in machine code this is the order from 000 to 011) were intended as equivalent to AF/BC/DE/HL.
- tom_ 4y agoDJNZ only does the decrement and branch if zero part. That's implicit in DBcc, which also initially checks the condition and is equivalent to NOP when true.
- classichasclass 4y agoPowerPC bdnz says hi, though it is restricted to one special purpose register (CTR, the counter).
- tablespoon 4y ago> We implemented it on breadboards, I think with 30 or so feet of jumpers [0]... > [0] - https://i.imgur.com/MKD7wTv.jpg https://i.imgur.com/MKD7wTv.jpg Based on your description, I expected to see a picture of 30 feet of breadboards filled with jumpers (https://en.wikipedia.org/wiki/Jumper_(computing) https://en.wikipedia.org/wiki/Jumper_(computing)), maybe used as ROM or something. Your actual project was unfortunately much less ridiculous.
- keithnz 4y agoI built a multi tasking kernel for the 6809, which was an extended version of the 6800 rather than the 68000 series, which is quite a different kind of a CPU. It was fun! Also created a double sided PCB using laser printers and then ironing the layout onto photo etching PCBs.
- anonymousiam 4y agoThere was also OS9 (Microware, not Apple). It was very Unix-like, but not fully POSIX, and very poorly documented. After initial development on the 6809, they released a port for 68K. https://en.wikipedia.org/wiki/OS-9 https://en.wikipedia.org/wiki/OS-9
- gbraad 4y agoThis article refers to the 6800 which isn't the same. Also, that's a 68008 (with the 'simplified' 8bit data and smaller address bus). Both somebow 8bit :-P
- dymk 4y agoIt certainly made it easier to wire up :) I would not want to hand-wire a 32 bit databus.
- gbraad 4y agoIt was considered as the 'cheaper' option by Commodore for the Amiga. Luckily they didn't add the prices dropped for the regular 68000 chip. It is only hsndy when considering interfacing with just older 68xx peripheral chips. Note: I did wirewrap the full bus for a 68000 schoolproject, plus the address split for high and low addresses (like an odd/even rom) IIRC.