I'd love comments on this. As we identify them, we can also try to come up with a step by step. Maybe eventually automate some of them...
At some point I'm going to have to write a review of See MIPS Run, but until I do....
This is the book to learn MIPS at the Metal. I've spent the past couple of days getting my mind around the machine instructions for setting up and controlling the Cache, or translation lookaside buffer. THe book does apretty decnet job of explaining how to transform a 4G address space into a significantly smaller amount of ram, and how to keep a 4k chunck of that in cache. Why, because MIPS is a RISC chip, and stuff that other chips do in hardware here get to be done in software.
Get to be? Huh. Yep, seems that differeent types of systems need different types of setups. MIPS allows you to do alot of stuff in software and to customize it for an end applications. Not only can you switch the endianess of the CPU (A discussion in itself) you can control the page size, and the algorithm to swap pages from cache and main memory.
Aside from a good review on operating system principles, getting into MIPS has been a great refresher in Assembly, something I haven't had to deal with on any processor but the x86 in a long time.
Another intersting thing about MIPS is that certain instructions take so long that you can't use the result of them in the next instruction. Fetching from memory takes long enough that if you want to use the result of that fetch immediately, you have to place a nop (no operation) instruction immediately following it. A cool thing is that you can put several loads in a row. Each fills the delay of the previous.Branch instrcutions work the same way. Seems most compilers are smart enough to optimize for this.
Specifically...MIPS 4Kc.
So I can set the various LEDs using a simple C (I almost said script) program. Some interesting things about it:
It needs a function called int __start() or it won't load. This is run first, not int main(). I am fairly sure this has something to do with the loader script.
If I try anything that references memory opertations I get an error basciaclly saying I violated the Memory Table. Basically, I think I need to initialize the memory mangement elements of the CPU before I can do anything.
The problem that I am having is that to do so, I need to write in assmebler, and I haven't been able to Assmeble my Assembly files. Ah toolchains.
I am finally trying to hack the linux kernel...sort of.
A friend got his hands on a MIPS board and we are trying to Port Linux to it. First step...to build the toolchain. I am currrently following the steps in the OReilly Embedded Linux book .
I should rephrase what so many people have had to find out for themselves:
The toolchain has to be build in order.
There are patches specific to the board/chip/archiceture.
You have to have the right versions of GCC etc.
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the Poster. The Rest © 1997-2008 SourceForge, Inc.