Building A Computer From Scratch? 68
wackybrit asks: "The economy has given many of us the chance to go and work on some side projects. I was reading "Interview With Bill Gates" and have been inspired to create my own computer from parts, to write my own interpreter, and to really see if I could do what Gates and Allen did back then. With the Internet as a reference guide, it should be easy. However, things are not always so easy. I might be a techie, but I have no idea how memory chips hook up, how a data bus really works, and how to tie everything up. Do you Slashdot folk have any handy tips or resources I can refer to for building my own machine from scratch?" If you had a chance to build your own computer, would you make yours similar to existing designs (ala the PC, or the Mac), or would you do it differently?
Personally (Score:2, Insightful)
Re:Personally (Score:2)
The road most travelled (Score:1)
Why not try going down a less travelled road. To make a computer from scratch is sort of like building a car from scratch.
Why not try to find something relatively new? Maybe a PVR. There are plenty of sites that have instructions but it's still a relatively new tech unlike PC's.
Then again, why should I cast stones/doubt? I'm not coming up with many alternatives.
Re:The road most travelled (Score:5, Informative)
Huh? I suspect you didn't understand the question. You're thinking about plugging together a bunch of boards you picked up at Micro Center or George's Local Computer Shop or whatever. That is NOT building from SCRATCH any more than microwaving a TV dinner is cooking food from scratch.
The article is asking about designing a computer from the component level. That is, getting individual chips, etc. and working from there. For that, I'd recommend taking some digital logic courses, or studying the equivalent material online.
To really know what you're doing, at least well enough to build an early 80s-level computer, you'll need to know the following:
That's what I'd recommend. Also, go find schematics for those old machines (Apple ][ computers used to come with schematics, for instance), and study those. Good luck.
--JoeRe:The road most travelled (Score:2)
I don't think you've understood the response
I think was the poster was suggesting is that instead of making a Personal Computer (i.e. a board with PC buses (PCI, AGP, blah, blah) and standard memory interface), build a single-function board such as a PVR or something of that nature.
Same basic idea of connecting a processor (I personally would recommend a StrongArm) with some memory (just some SDRAM) and then some MPEG encoder/decoder and video decoding chips. Not to mention a tuner (I have not been able to find these very easily though).
I would have to tend to agree that this is a more sensible approach. There are many single board computer projects (LART immediately comes to mind) but I don't know of an open PVR board project (although there are many commerical PVR boards out there).
Re:The road most travelled (Score:1)
Sounds like fun (Score:2)
A basic handbook of computer architecture is probably very necessary, so let me suggest the one that everyone's probably read: Hennessy & Patterson. [amazon.com]
Good luck!
Re:Sounds like fun (Score:2)
I've found (and understood) good books on Computational Theory, so I figure I am capable of understanding Computer Architecture from a book as well, if it was presented well.
Re:Sounds like fun (Score:1)
Re:Sounds like fun (Score:1)
Re:Sounds like fun (Score:1)
C-64 schematics? (Score:1)
now where did i put that damn thing?
Good book (Score:3, Informative)
Even if you don't actually build a computer, you'll feel like you've done when you make it through this book. Bebop To The Boolean Boogie and Designus Maximus Unleashed are also very good tutorials.
These books aren't going to teach you how to build with off-the-shelf components. They're going to help you understand bus-level logic and so forth.
From there, you may want to look into the How to Write Your Own Operating System [mega-tokyo.com] page, which will help you get something running on the ahrdware you put together.
Go simple (Score:4, Informative)
Use a 65816 or even a 6502. Don't plan on making this your main machine. Just go with what's easy to build, because you're going to make a hell of a lot of mistakes.
The advantage of a simple processor with a narrow bus and address space and with well-defined behaviors is that you're going to spend a whole lot less time debugging bad traces and similar basic mistakes, and more time getting at the real meat of the system.
You might also grab a copy of Embedded Systems or similar and grab one of the many microcontrollers advertised therein, with a decent amount of RAM and basic I/O controllers on the chip. Getting memory working involves a lot of busywork, connecting pins over and over and over and over and over.
Another user suggested getting the C64 programmer's reference manual and looking at the schematic in the back. This would be a good start. Look at at least a few reference designs before anything else. Most of the really old systems had complete schematics available so your average electronics repair shop could troubleshoot them.
Re:Go simple - processor (Score:1, Informative)
Re:Go simple (Score:2)
Then again, I guess that's moot nowdays... he almost certainly can find a few static 32k's for less than a buck (the cache ram off a 486 works nicely). In that case, 6502 asm is nicer than z80, I never did like the idea of io ports.
Most modern IDE hard drives aren't easy to interface to an 8bit data bus. Go with a cheap Compact flash chip, which is ide-like and 8 bits wide. Cheap, can get them at walmart, and they have a crapload of storage for a 8bitter.
Keyboard is tough, I wouldn't want to interface a ps2 to the thing, and yet it's a pain to build your own matrix keyboard (though the concept is simple enough). Maybe a serial port for this?
Monitor is another problem, but probably a cheap serial lcd would work nicely. Heck, earthlcd.com has some kickass pixel lcd's, in the sub $50 range. Could actually have it do pacman like games and whatnot, if he cared to. Though serial would be simpler.
Note: Don't listen to the morons that will try to push a Strongarm or something on you... that's an intermediate (or higher) level project.
Re:Go simple (Score:1)
If you don't like using io ports, just memory map all your I/O on your Z-80 design.
Really, the 6502 is one of the weaker 8 bit architectures, and the Z-80 is one of the stronger.
People like the 6502, IMHO, mostly out of the historical fact that Apple used it on their 8 bit machines. That's not really enough of a reason anymore.
Or, of course, you could design your machine using my namesake chip as one of the central chips and go all low level TTL. You'll probably want a 74S182 then, too (look ahead carry generator).
Re:Go simple (Score:2)
Again, I think that a cpu built out of 74xx is an intermediate level project. I'm not sure that I'm really up to that myself. Not a project he shouldn't pursue, but would be difficult and dissappointing this far along. Definitely something you'd do before trying to implement acpu on fpga...
Re:Building your own (Score:1)
Starting places (Score:4, Informative)
I would suggest that you look at sites like 6502.org [6502.org], www.coprolite.com [coprolite.com], Mark-8 [his.com], POD 6502 [hccnet.nl] or Grant Searle's collection of sites build your own UK101 [freeserve.co.uk], build your own ZX-80 [freeserve.co.uk] and build your own Jupiter Ace [freeserve.co.uk]...
These are all quite good sites, and you can study their designs to learn how they work.
Hope this helps!
Don't beat yourself up... (Score:1)
So if you fail to get your basic interpreter under 4K don't beat yourself up - you probably have a job to go to.
Re:Don't beat yourself up... (Score:3, Interesting)
BG and PA came from privileged backgrounds, but so have plenty of people who didn't manage to build multibillion empires.
Sure, their family's wealth may have given them an extra cushion (as well as a chance to play with some swell DEC's in high school), but their achievements were on their own in ways that money didn't buy.
In business, Bill Gates may be an asshole, but he also has a legitimate claim as a pioneer in personal computing. The Gates and Allen did write the first programming language for the first personal computer.
And Linux Torvalds wrote linux when he had barely a pot to piss in, while living with his mother and sister.
Money didn't buy any of these people's success.
Re:I respect that.... (Score:1)
Other Interview Better (Score:2)
Re:Other Interview Better (Score:1)
Some of you boys have a weird fetish on this Gates guy.
I read that interview, and he really doesn't say anything too shocking.
All he basically says is that most users don't complain about real bugs, not in a strict technical sense. He does open the possibility that some people don't know how to use their software. Big Whoop.
He then goes on to say that MS never markets its new versions on bug fixes, but on new features. Again, big whoop.
Whoever posted the interview doesn't know the difference between bad design and a technical bug.
I don't know why I'm even bothering (this is the second Gates basher I've taken on in this topic).
It's just that the stupid, uninformed, deliberately-misleading MS bashing is starting to get dull.
There are plenty of legitimate MS bashing arguments. But how about moving on?
If it were me.. (Score:2)
Re:If it were me.. (Score:1)
Re:If it were me.. (Score:2)
Maybe someone who'd like to build something REAL for a change?
It fun (Score:3, Informative)
IT IS VERY BORING TO DO. The first machine has almost 4,000 wires. I made 6 mistakes.
I got the plans from Kilobaud Mag. They did a three part artical.
Been there, done that. (Score:3, Insightful)
If you want to do this today, you might consider designing your own CPU and implementing it with an FPGA. Look into the Forth processors; they're about the minimum useful machine you can build.
Really? (Score:1)
In you opinion, how many people typically did this? Do you know of any references to others?
Re:Really? (Score:1)
It's one of those things that seems interesting at first, but then you realize your talents are better spent working at higher levels of abstraction.
This I understand... (Score:2)
But this guy was describing building a computer from telephone relay equipment, etc in the 60's! More or less on his own time, in high school!
I just wonder how often this occurred - I have yet to find an old Popular Science or Popular Mechanics article from the period discussing such projects (ie, homebrew computers from the 1960's) - the closest I have found was a telephone dialer system for an alarm (with complete plans for a rotary telephone), and a later book detailing building a simple calculator based on transistor logic (from the very early 1970's). I haven't found anything on people homebrewing machines in the 1960's from scavenged telephone equipment parts.
It isn't that I don't believe it impossible - I know full well that people could do this, and knew that at least a few people had done it - but how many? Was any of these efforts documented?
The closest I have come to "early homebrew computer documentation" was an old stapled, photocopied "pamphlet" from 1975 (I think) detailing how to build a computer "from scratch" - even so, it detailed info on logic circuitry, etc (74xx series), and so wasn't in the era of relay logic.
I tend to think that some of these people who possibly built such machines might have been technicians who worked on "relay ladder logic" for process control, and came home to build similar systems, but with their own curious designs - but this is just a theory, with no proof in any manner...
Re:This I understand... (Score:1)
Consider some stufy material. (Score:2, Informative)
Other posters who suggest that you do some studying are not unwise. Digital logic is straightforward when you have a background in combinatorial logic and a few other concepts up to about 25MHz. Designs with that level of clock speed can easily be wire-wrapped. Beyond that, you are going to have to start considering high-speed design issues when you route your boards.
One of the most rewarding things that I did as an undergrad was design my own SBC around a Motorola 68HC11 to run the mechanics for a 3-D scanning system that interfaced to an SGI workstation.
I really think that if this interests you, you should pursue it . The current 'state of the hobby' is now so advanced that it is somewhat mind numbing what can be done with some FPGAs and some software to layout a PCB.
The Motorola Dragonball family (or it's decendants) are an excellent 68000 core family of chips that are easy to use and you can design a modestly useful machine around them with a classic buss / memory mapped IO architecture without working up too much of a sweat.
Good Luck!Start small (and simple) (Score:5, Informative)
The first thing you need to do is to understand all the logic gates and how they work, and then work with the various logic gate chips (the 74 series) to get various simple experiments working. This will get you familiar with HOW the circuits are passing information around, as well as give you some experience with wiring the components together in a useful fashion.
After that, CPU's and memory are just largescale versions of your typical logic chips. Of course, its not as simple as it sounds and you definitely have your work cut out for you if you plan to do it completely from scratch. If you want to follow some old schematics your job will be simpler, but that might defeat some of the purpose.
As for programming, you'll be starting at the raw assembly level. You'll also need some type of interface to input and view data, as well as storage. In the beginning, you can use programmable rom chips to hold enough operating system information to get you going. Yes, you will have to develop at least a simple operating system.
Hope I didn't scare you too much. If you manage to get all that working, you'll be in a great position to move onto something more complex. Today's computers won't even seem that complex anymore, it will simply be a matter of scale.
-Restil
Re:Start small (and simple) (Score:2, Informative)
Whilst you're reading up on this you'll probably find that most electronics text books include chapters on computers.
My personal favourite "The Art of Electronics" [artofelectronics.com] by Horowitz and Hill walks you through an example of incorporating a 68008 (I think, I haven't actually got my copy of it available at the moment) into an instrument (ie. specialized rather then general purpose computer) they construct in chapter 11.
If you want to start off really simple (think more of really simple programable calculator kind of level) then something more along the lines of a PIC 16fxx microcontroller from Microchip [microchip.com] is a good starting point, as you can have something up and running very quickly with just a breadboard, the microcontroller and a handful of discrete components (and maybe some LED's for output) using a PC to program the device, and then slowly add to the base design with some external memory, and LCD display, a numeric keypad for input, and so on ...
m68k cpu (Score:3, Insightful)
Re:m68k cpu (Score:1)
To get a simple computer board going you only need a 68k8, some ROM and RAM and some programmable logic circuits. (To control the signals to ROM/RAM circuits.) When we started on the project it seemed rather hard, after only a few weeks now I'm confident that we could have done a lot more fun stuff. (Given the time to do so naturally.)
We're creating a MOD player btw, this involves some slightly more hardcore circuits, mainly a medium sized Lattice (FPGA).
Re:m68k cpu (Score:1)
Re:m68k cpu (Score:1)
Gates may be good at taking credit for others... (Score:5, Informative)
I have seen second or third-year MIPT (Moscow Institute of Physics and Technology, in Russia) students building 8080 or Z80-based computers in 1987-89, and tweaking a lot of hardware and software in them, but I don't know if that can be really described as "from scratch" -- at that particular place there were two or three dominant base designs, with some simple "OS" written by different people, including a bunch of BASIC interpreters, editors, assembler, etc. (those things were too small to run CP/M). Making those things required mostly knowledge of electronics plus understanding of microprocessors, knowledge of 8080 instruction set, and some programming skills, not necessarily all in one person, and when I studied there I have seen, I think, about one of those things per four-people dorm room. Of course, that was in the FRTK (mostly EE) students' dorm, and at the time the most common computer that we used at the school was a russian clone of PDP-11.
Re:Gates may be good at taking credit for others.. (Score:1)
All you need is the intel docs, really. There are oodles of schematics on line, as well as a number of books on it.
From the ground up (Score:1)
A different starting point - divide and conquer (Score:3, Insightful)
One Task: Learn about hardware construction on some simpler projects. Learn by building from working schematics.
The Other Task: Learn about computer design with simulation. Go get Icarus Verilog. (http://www.icarus.com/eda/verilog/index.html) There are microprocessor netlists available, get one. (Don't have a URL handy.) Learn to simulate it, learn Verilog, (or VHDL) then start designing your own.
Put the Two Together: Once you know how to work with hardware, and once you have a design that will simulate correctly, start thinking about building it. Besides, this is the way it's done in the Real World. Nobody comes up with a schematic, implement it in hardware, then begin debugging, any more. You don't start to touch hardware until you have a reasonable belief that your design will work, from simulation. Even then, there will still be plenty of room for debug on hardware.
One book to buy.... (Score:3, Informative)
This will walk you through analog and digital circuit design and construction, and culminates with the building of a 68000 based fully functioning computer with I/O, buses, the works.
I had the pleasure of taking an electronics course taught by Mr. Hayes, and building your very own computer is fun. It is also time consuming, complicated, and frustrating. You'll also need a moderate amount of equipment such as an oscilloscope, power supply, function generator, DVM, and the like.
Gates and Allen (Score:2, Informative)
You're thinking of Jobs and Woz
Doug Jones' Ultimate RISC (Score:1)
Jeff
Want a real challenge? (Score:1)
That'll keep you busy for awhile.
Good luck... (Score:2)
First off, read all of the comments here, they contain good advice.
Second, realise this, which I have rarely seen talked about:
Computers are nothing more than extremely complex player pianos.
Honestly. Think of memory as a very long (but non infinite, though it can be considered an endless loop, because when the address register of the machine "rolls over", you start at address zero again) roll of player piano music, the holes representing instructions and data, and the rate at which the computer runs (the clock) the speed at which the roll is moving (tempo?).
Anyhow, that is all a computer really is - sure, some instructions may say "move to this point on the roll (address)" or "play this note (add this number to this register)" - but all in all, it is the same.
Most of what computing is today was thought out in mechanical arrangements by Charles Babbage in the 1800's - because computer ARE inherently mechanical (read the book "The Difference Engine" for more).
Now, this doesn't explain how modern processors work. Modern processors perform some extreme "magic" - but most of what they do isn't that arcane, and you certainly aren't suggesting that you want to build an 1.5 GHz Athlon or something (and you would be insane to try to do that at home).
One thing to keep in mind is that if you are doing this at home, don't try to go much beyond 2 MHz - otherwise you will drive yourself batty trying to figure out certain problems that only appear when you run at full speed vs single stepping the clock, etc (ie, speeds of signals in the bus not arriving at proper times, etc) - if you are thinking about building such a faster machine without a logic analyzer (I think that is right - kinda like a combo logic probe with multiple inputs and an oscope like trace screen), you will be in for some surprises (read "Soul of a New Machine" for fun in this regard).
Good luck - and remember to document your progress, and let us know about it!
How about an IBM System 360/370 emulation using (Score:1)
I've done it... (Score:1)
The first was a group of 7400 logic chips wired together to form a 6-bit computer with a real simple instruction set. I'm pretyt sure it would have worked properly - had access to memory etc.
The second was really a C64 and all of it's components re-designed / simplified. I added banked memory / a lcd controller driver etc.
I was always too lazy with these guys to actually build the stupid thing. I now look back and wish I had built the 6-bit 7400 one...
*sigh*