Modified MIPS 4300i Emulation

Started by
2 comments, last by DakeDesu 17 years, 6 months ago
Well, not entire sure where this should go, but I plan to create an emulator for a modified version of the Nintendo 64. What would happen is me and a friend are modifying the SGI MIPS 4300i board the N64 uses to (A) contain more than 8 MiB of RAM that it had at the peak of its use and (B) Be a laptop. Yes, we know the N64 itself was notoriously slow. That is because in order to make it affordable for home use Nintendo turned it into a cripple of a computer. The biggest problem I am seeing is it only had a max of 8 MiB of RAM, meanwhile other MIPS 4300i boards are being used in two generation old arcade hardware. Yes, that is right, the same equipment used in the N64 is still used in some arcades. Anyways, a few of the goals are to port Linux to it (yes, I know about the iX project. From what I gather it discontinued a long time ago while not making anything). I do know where to find information on the hardware. In fact I have been making a wiki for the purpose of storing that information. I also plan on making an emulator for the modified version of the N64, as it will contain things that most N64s do not contain. Such as a keyboard. If the mips-*-elf target is not fixed in binutils by the time the emulator is done, I may also work on binutils in attempt to patch that problem. I just need a few tips on this. Yes, I know emulation is a touchy topic, but unless SGI complains, which I doubt they will, I will continue on with the project. My main questions are:
  1. Is there any manner I should use to limit memory? Since we most likely will know the memory ahead of time, we won't allow the emulator to use more than that. Yes, we do plan on expanding from 8MiB. I am not sure if malloc has a function to limit memory.
  2. What does immediate mean in ASM terms? I keep seeing mnemomics like Add Immediate.
  3. Any suggestions of how to seperating processors? I was thinking just having different interpretors for each processor implemented as different objects based on a similar base object.
  4. Are Traps like throw and catch of C++? They seem to be commonly listed under exceptions, but they seem to be more of a way to talk between CPUs
  5. Do processors run at the same time? From what I gather with most multiprocessor systems, the processors only run one at a time.
  6. What is the point of the MPU on the MIPS 4300i board? From what I gathered, the memory on the N64 is not limited like most consoles, where you only have X memory for Y. IIRC on the MIPS 4300i allows programmers to use memory as wished.
  7. Any FAQs for developing for binutils? From what I gathered the mips-*-elf target is broken right now (this based on an error I got while trying to install it in FreeBSD)
Thank you for your time, I will also Google more on this matter.
[ Six Hour Game Contest | ( Thread | Blog | Wiki | 6hour Bio ) ][ Website | (Blog | Gallery ) ]
Advertisement

Immediate means that there is constant data as part of the the machine code
statement instead of accessing data from a register (or indirectly from a memory register).

Multiprocessors usually run simultaneously unless they are a master/slave arrangement like a Arithmetic Co-processor (which sometimes the CPU waits for
results).


For TRAPS you probably want to look under 'Interrupts'
Quote:Original post by DakeDesu

Is there any manner I should use to limit memory? Since we most likely will know the memory ahead of time, we won't allow the emulator to use more than that. Yes, we do plan on expanding from 8MiB. I am not sure if malloc has a function to limit memory.

Allocate a single block of memory equal to the maximum amount and use custom memory allocation function to allocate portions of this memory. This will also help simplify emulation of the memory map logic.
Quote:
What does immediate mean in ASM terms? I keep seeing mnemomics like Add Immediate.

An operand is embedded into the instruction (or instruction stream.)
Quote:
Any suggestions of how to seperating processors? I was thinking just having different interpretors for each processor implemented as different objects based on a similar base object.

Sure, why not? Lots of ways to do it.
Quote:
Are Traps like throw and catch of C++? They seem to be commonly listed under exceptions, but they seem to be more of a way to talk between CPUs

They're basically interrupts IIRC, or closely related.
Quote:
Do processors run at the same time? From what I gather with most multiprocessor systems, the processors only run one at a time.

They generally run simultaneously, such as the CPU and GPU, they generally only wait for the other when they have nothing else to do.
Quote:
What is the point of the MPU on the MIPS 4300i board? From what I gathered, the memory on the N64 is not limited like most consoles, where you only have X memory for Y. IIRC on the MIPS 4300i allows programmers to use memory as wished.

The MMU likely impliments memory map logic. While the 4-8 MiB is likely linearly addressed (physically speaking) it may not be so logically which is to say that the memory map may not appear linear to the CPU or GPU. It may also mirror memory at several address ranges. Sometimes these memory mirrors have different characteristics, such as being read only (despite being a mirror of read/write memory) or memory within a certain mirror's address range may prevent it from being cached (to prevent cache pollution with "random" memory access patterns.)
Any FAQs for developing for binutils? From what I gathered the mips-*-elf target is broken right now (this based on an error I got while trying to install it in FreeBSD)

Not sure, don't really keep up on it.

Okay update:

I am still researching the hardware, but I am also working to implement an interpretor for MIPS 4K ASM (please don't attack me with the difference between Machine Code, Bytecode, Assembler, ASM, etc.. I've tried memorising the techniques and probably won't until I am given some propper way to remember them).

The Interpretor would contain a console, as in a text based interface for seeing STDOUT, STDERR, and possibly for the Interpretor to have its own STDIN (which would be kept away from the ASM language).

A few questions:

1) Once I get display up, I was thinking of just making a wrapper to an SDL_Surface. Are there any better solutions than this?

2) When using instructions with immediate alternatives, should I be strict and force people to use the immediate instruction when they want so, or allow them to use it at their discretion (changing it internally), or should I allow for pragmas to be setup (like have at the beginning of the assembler @pragma-immediate, to force it into a stricter mode to help them debug)?
[ Six Hour Game Contest | ( Thread | Blog | Wiki | 6hour Bio ) ][ Website | (Blog | Gallery ) ]

This topic is closed to new replies.

Advertisement