Homebrew CPU

hggh1 pts0 comments

Homebrew CPU Home Page

[ Home ] [ New Stuff ] [ Minix Port ] [ Magic-2? ] [ Overview ] [ Photo Gallery ] [ Construction ] [ Technical Info ] [ My Other Projects ] [ Links ]

Magic-1 is a<br>completely homebuilt minicomputer. It doesn't use an off-the-shelf<br>microprocessor, but instead has a custom CPU made out of 74<br>Series TTL chips. Altogether there are more than 200 chips in Magic-1<br>connected together with thousands of individually wrapped wires. And, it<br>works. Not only the hardware, but a full software stack. There's a ANSI C<br>cross-compiler for Magic-1 (retargeted<br>LCC), a fully<br>multi-user, multi-tasking port of the<br>Minix 2 operating system. a TCP/IP stack and hundreds of programs.

Except when<br>I'm working on it, Magic-1 is connected to the net. It serves web pages at http://www.magic-1.org,<br>and by clicking here you can telnet in and<br>play Original Adventure<br>or run a few other old classics such as<br>Eliza,<br>Conway's Life or<br>Hunt the Wumpus.<br>To log in, use the id "guest" and the password "magic". Before the Minix<br>port was completed, Magic-1 was running a very simple homebrew operating system.<br>It also had a simple guestbook program. Many thousands of people have<br>telnetted into Magic-1 from around the world, and between 2004 and the summer of<br>2007 they left 1388 guestbook messages. I've<br>preserved the messsages here.

This web site<br>has served as the development repository for the project, and contains lots of<br>pictures documenting the construction, as well as full documentation and

diaries stretching back to the project's beginning in 2001.<br>You can also find a few videos of Magic-1 running, including the first time it<br>worked.

Start here,<br>and then check out the Overview, New Stuff and Photo Gallery. To dig deeper, browse through<br>Technical Info,<br>Construction - and if you're really<br>interested, you can even download a complete set of Magic-1's schematics.

Although<br>Magic-1 is a custom computer, it no longer is one-of-a-kind. Aidil Jazmi<br>of Universiti Teknologi Petronas in<br>Malaysia duplicated Magic-1 as a school project.<br>You can read about his work<br>here.

NEW (8/30/2016): Because of automated script attacks at the standard telnet port (23), Magic-1 will now be using an odd telnet port number: 51515. So, to telnet in to magic-1, do: "telnet magic-1.org 51515".

Magic

In the summer of 1980 I celebrated my freshly minted B.S. in Journalism by<br>blowing most of the cash I collected in graduation gifts on a TRS-80 Model 1<br>computer. Sitting on the floor of my apartment I fired it up, typed in<br>the sample BASIC program and then "RUN".

WHAT IS YOUR NAME?

"BILL", I responded.

HI BILL

Wow! I was blown away. This was just a machine, but I<br>could interact with it using language that we<br>both understood. As a Liberal Arts graduate with next to no technical<br>background, I found this completely astonishing. Over the next year, I<br>continued to play with my TRS-80 Model 1 while working as a journalist on a small-town Kansas<br>newspaper. I decided that I really wanted to learn more<br>about how computers worked, so I went back to college and picked up a M.S. in<br>Computer Science.

More than 20 years later, I found myself with an urge to touch<br>that magic again by building my own computer from scratch. By<br>"scratch", I meant designing my own instruction set, wire-wrapping a<br>CPU out of a pile of 74 series TTL devices and writing (or porting) my own assembler, compiler,<br>linker, text editor and operating system.

I'm calling this computer the "Magic-1", or M-1 for short. It's a<br>one-address, microprogrammed machine with one-byte opcodes. It<br>features 8/16-bit data operations, functioning on an 8-bit wide data bus with<br>16-bit addresses (mapped via 2K-byte pages into a 22-bit physical address<br>space). Code and data address spaces can be shared or disjoint,<br>giving each process up to 128K bytes of addressing. User and<br>supervisor modes exist, along with hardware address translation, memory-mapped<br>IO, and support for DMA and externally-generated interrupts. As far as<br>components go, it is built entirely out of 74LS and 74F-series TTL devices plus<br>modern SRAM and EPROMs for the microcode store. After redesigning<br>the memory access mechanism several years into the project, Magic-1 runs at 4.09<br>Mhz.

Goals

OK, so I understand wanting to do your own CPU, buy why<br>on earth are you doing it this way? I mean, why TTL - why not<br>FPGA? And really, 16-bit virtual addresses in a 22-bit physical<br>address space! What's the deal with that?

I guess any project should start off with some notion what of<br>what you're trying to achieve. My high-level project goals were:

Touch the magic. By this I meant to gain a deeper<br>understanding of how computers work, and specifically computers similar to<br>those of the late 70's and early 80's that first fired my interest.<br>For this reason, the Z80 loomed large in my mind throughout the design<br>process, and running with an 8-bit data bus and 16-bit addresses just seemed<br>right. Although I was largely trying to use parts that would have...

magic project port telnet computer address

Related Articles