Originally posted by: Lord Banshee
Nope i loved my Assembly class, well it was called Microprocessor Applications. We used a 68HC12 and implemented all kinds of different hardware to the MCU and interfaced it will Assembly and i have to say i learned a lot and has to be one of the most fun EE class i have taken. We also had to use MIPS assembly in our Computer Arch class, but in that class we actually design the CPU and insturctions out of HDL, so i guess that includes everything
exdeath you have any links getting started with a PS2? That sounds pretty cool if it don't require me to buy too much.
http://ps2dev.org/
I haven't been keeping up to date with the tool chains so I don't know what is current or obselete, but my old/current setup for raw hardware coding (no OS or libraries) is:
1) Old style PS2 with brick style Sony network adapter (non USB) (or slim PS2)
2) mod chip. I prefer the DMS3/4 chips with the 'devolution' feature and boot from memory card option.
3) pukklink & ps2link, the IP boot loader server that boots the PS2 at power on and the PC client that allows you to send EE (Emotion Engine, R5900 main CPU) and IOP (I/O processor, the PS1 on a chip that also handles sound and peripheral I/O in PS2 mode) programs to the PS2. It also remaps the cdrom device path to a network share on your PC to emulate CD access so you don't need to waste time burning CDs with every build.
4) GNU PS2 SDK and compilers and C runtime libs.
5) The Linux kit. You don't need the whole kit, the hard drive, or even Linux, you just want the register level hardware documentation and user manuals that document instruction sets, bus operation, DMA, etc., which is like 6 separate large PDF files. I prefer not to use the Linux SDK itself because you are barred access from many things, including graphics. But those .pdf files are absolutely essential.
Basically you burn pukklink to a CD, follow the instructions for the DMS mod chip to go into devolution mode to copy the boot image off the CD onto the memory card, and from then on all I have to do when I want to dev is power on the PS2, hold triangle, and select pukklink from the applications menu and the PS2 boots and initializes the network adapter, and waits.
Then on the PC side, you set up your dev environment (i used VS6 rigged to use the PS2 GNU build tools including the seperate vector unit assembler). Then you use PS2Link IIRC to communicate with pukklink to reboot, send .elf and .irx modules and execute them, etc.
First things first, you have to learn the GS (graphics synthesizer) which is a 2D raster engine (accepts XYZ and STQ). Communication with the GS is done via 128 bit wide GIF (Graphics InterFace) packets stuffed through a single memory address I/O port. There are four ways of getting data there, via EE, DMA, VIF2, and VU2, but you can start simply by poking carefully assembled data packets through the GIF FIFO manually one qword (128bit) at a time.
First thing you'll need to do on power on is initialize the CRTC and set up a display mode for both the CRTC and the GS. After that you can just send simple commands to draw non perspective corrected non textured no depth buffered 2D solid quads and stuff like that just to see something on the TV and verify that you have a running program, etc. Then take it from there.
I believe STDOUT, and thus printf, is mapped to a console in ps2link so you could just start with the typical printf("Hello World!\n"); and upon executing the .elf on the PS2 you'd see "Hello World!" print to the ps2link console on the PC. Very useful debugging feature as the PS2 itself has no native text mode and you'd otherwise have to implement textured font sprites.
I believe the default behavior of crt0.s either goes into an infinite loop or halts the EE when your program ends (main returns) where you can then automatically reset it when you run another .elf.