Articles for beginners explaining computer architecture

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Locked
Guest

Articles for beginners explaining computer architecture

Post by Guest »

This article was linked from a recent Slashdot posting explaining concepts of computer architecture. Since it is oriented towards the MIPS architecture, I figured it should be of interest to many folx who are new to:
1. Programming Sony consoles.
2. Programming on something where understanding how the CPU works actually matters.
3. Programming in general.

http://www.aselabs.com/articles.php?id=167 [main article]
http://en.wikipedia.org/wiki/MIPS_architecture [another good backgrounder]
http://hardware.slashdot.org/article.pl ... 19&tid=137 [Referenced from this Slashdot]

EDIT: Some slashdot posts raised issues that the original article seems to be avoiding crediting other original authors to the point where it could be plagiarism. Given that this material is so short, if you are interested to learn more, please by all means look for more authoritative sources.
qleyo
Posts: 21
Joined: Fri May 06, 2005 4:34 am
Location: Nottingham, UK
Contact:

Post by qleyo »

EDIT: Another useful link > How do I get started in PSP programming?

Out of curiousity is the sony firmware written in mainly C or assembly? or both?
Last edited by qleyo on Thu Jul 21, 2005 6:51 pm, edited 4 times in total.
Raoul
Posts: 8
Joined: Tue May 10, 2005 9:26 am

Post by Raoul »

Most probably both
agentbob
Posts: 8
Joined: Tue May 10, 2005 1:49 pm

Post by agentbob »

qleyo wrote:Out of curiousity is the sony firmware written in C or assembly? or both?
Ah, the language question. I'm guessing you might know this already, but since this is a newbie thread, let me ask "who cares"?

Language choice is often a matter of preference. You see, the only instructions the CPU is going to understand is machine langauage, or plain old 1's and 0's. The first computers had to be programmed this way, 10101100, etc... You can can imagine how difficult it would be to do that for even a simple program. So, programmers made abstractions to simplify the process. Instead of writing 10 to tell the computer to add something, they wrote ADD and ran that through another program that turned ADD back into 10. This is basic fuction of an assembler. The assembly language can be futher abstracted to make even higher level languages like C, which use compilers to write assembly langauge. (Actually, most compilers today are smart enough to go straight from C to machine language)

So what does this all mean with reguard to your question? It doesn't matter what language Sony used. They could've used ada or Fortran or COBOL for that matter. It all gets compiled down to the same machine language. That said, I agree with Raoul.... they probably use a little of both C and asm for the PSP firmware.
Guest

Post by Guest »

Even for small embedded systems, most kernels are still written in C. Small parts of the code for system bootstrap (startup, from power-on/reset for example) would normally still be done in hand-coded assembly. Occasionally parts of device drivers will be in hand-coded assembly as needed.

But nowadays, just about any embedded OS is still too large to do even small portions in assembly. It will be done in C almost without exception. Larger OS's include more and more C++, but its hard to think of anything other language that might be used.*

* OpenBoot (bios kinda thing) and some other small embedded stuff are often done in Forth. So, for example, that Sun workstation, or even Apple Macintosh, are controlled at power-on by a boot firmware written in Forth. But this firmware's primary job is to find a real OS someplace such as on disk, dvd, or network, and to take over further booting of the system.
razorrifh
Posts: 23
Joined: Sat Jun 04, 2005 2:15 am
Location: Penn State
Contact:

other good resources...

Post by razorrifh »

here are some other good resources:
what a stack overflow is and how to use them
http://www.hxdef.org/knowhow/stackover.txt (someone posted this on these forums, sorry but i forgot who)

coding for the mips proc
http://phrack.org/show.php?p=56&a=15 (this was posted on here too, by 0xdf maybe?)

designing embeded hardware by john catsonlis
explains how computers/processors work in detailed manors and how electronic devices function that arent traditional computers.
http://search.barnesandnoble.com/bookse ... 7558&itm=1

code - charles petzold
explains how computers came about through some good examples and how it all relates to one another.
http://search.barnesandnoble.com/bookse ... 1319&itm=1

teach yourself electricity and electronics -Stan Gibilisco
this book is a fricken beast. like 800 some odd pages. learn all you'd ever want to know about electrictity... and electronics!
http://search.barnesandnoble.com/bookse ... 7301&itm=2


hacking the xbox - Andrew Bunnie Huang
this isnt the best written or published book (spelling and grammar mistakes) but with the troubled history of it getting published, its acceptable. definately a good read in my opinion. it explains stuff about jtags, why the tsop is flashable in the xbox, the encryption techniques, ect.
http://search.barnesandnoble.com/bookse ... 0291&itm=1

i suggest reading all you can, even if you dont understand it... cuz itll help later! and even if it doesnt, you can still feel like a geek by being able to say you read it :p hope this helps someone.
qleyo
Posts: 21
Joined: Fri May 06, 2005 4:34 am
Location: Nottingham, UK
Contact:

Post by qleyo »

agentbob wrote:
Ah, the language question. I'm guessing you might know this already, but since this is a newbie thread, let me ask "who cares"?

Language choice is often a matter of preference.
I strongly disagree, theres alot of factors that come into place in the "real world" of course i'm not going to go into this as its of no use to you.
Lets say the business guys up there like to hear anyway of saving, and assembly programmers cost more money (well here they do). Right now i'm converting an alarm system firmware for a PIC from assembly to C for an alarm company solely because of these factors.
agentbob wrote:You see, the only instructions the CPU is going to understand is machine langauage, or plain old 1's and 0's.
I program in 6 languages (C, assembly, VHDL being amongs these) and about to start a PhD, researching FPGAs and pipelines.
I fully understand the microprocessor architecture, probably more than you can even comprehend. This little tutorial of yours is pretty unecessary and insulting. perhaps useful to others...
I'm a sony dev newbie. Not a programming newbie.
agentbob wrote: So what does this all mean with reguard to your question?
Not very useful and verbose. "C, assembly or both" is what I expected
agentbob wrote: It doesn't matter what language Sony used. They could've used ada or Fortran or COBOL for that matter..
It does, depending on what angle you are looking at it form. They would be silly to use a strict language as Ada (I use VHDL too which is pretty similar). Someone I know who works for a company that makes US army equipment was telling me how they plan to drop Ada and use C and C++ instead.
Compilers have come a long way. And for easier maintanance C and C++ win hands down.

I was just being curious.
Last edited by qleyo on Mon Jul 18, 2005 10:31 pm, edited 3 times in total.
qleyo
Posts: 21
Joined: Fri May 06, 2005 4:34 am
Location: Nottingham, UK
Contact:

Post by qleyo »

Raoul wrote:Most probably both
Thanks, thats what I presumed.
agentbob
Posts: 8
Joined: Tue May 10, 2005 1:49 pm

Post by agentbob »

qleyo wrote: I strongly disagree, theres alot of factors that come into place in the "real world" ... assembly programmers cost more money
A wholy valid point I would consider beyond the scope of a "beginner" thread.
qleyo wrote: I program in 6 languages (C, assembly, VHDL being amongs these) and about to start a PhD, researching FPGAs and pipelines.
I fully understand the microprocessor architecture, probably more than you can even comprehend.
Congratulations on starting your PhD. You must truely value the learning process and understand the significance of trying to educate others.
qleyo wrote: This little tutorial of yours is pretty unecessary and insulting.
Please, forgive me. I never meant to insult anyone. You see, it's just that this is a beginner thread about computer hardware, so I figured most of the people reading it would be beginners. How could I have possibly known that someone posting a question in this beginner thread would be working on a PhD in computer science and know far more than anyone else here could possibly comprehend? I don't know, maybe I thought I had premptively avoided this confrontation by saying in the very first sentence of my post, "I'm guessing you might know this already"... which obviously you do.
qleyo wrote: Not very useful and verbose. "C, assembly or both" is what I expected
If you already knew the answer, then why fucking ask the question? If you're so goddamned educated you should've been able to figure that one out on your own, PSP newbie or otherwise. What'd you expect someone to say, Forth?
qleyo wrote: It does, depending on what angle you are looking at it form.
Yes, of course for logistical reasons, it matters.
qleyo wrote: I was just being curious.
Of course you were.
qleyo
Posts: 21
Joined: Fri May 06, 2005 4:34 am
Location: Nottingham, UK
Contact:

Post by qleyo »

If you already knew the answer, then why fucking ask the question? If you're so goddamned educated you should've been able to figure that one out on your own, PSP newbie or otherwise. What'd you expect someone to say, Forth?
No I did not say I knew the answer, I said I was expecting more of "assembly" or "C" or "both" as an answer not a tutorial on how programs and computers work and its an Electronics Engineering research program not computer science. And considering I'm english I might as well correct what you "call" english, Assembly OR C means I expect one OR the other, forth?

It was a simple question, infuture do not start a "debate" or "tutorial" if you like on a something like this. Its like me asking you does the car use petrol on diesel and you start going about something the way cars work. You do not impose your opinion on others. And every sentence in your post should honestly start with "IMO" not just straight sentences

edit: Mods are you trying to tell me there is no prune feature that common a swear word? There was a 13 year on here the other day.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Quit your bitching, asshat. We're not here to host your hissyfits or police what you deem as bad for children.

Locked due to a lack of development content.
Locked