WDC offers free C Compiler/Optimizer and more

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: WDC offers free C Compiler/Optimizer and more

Post by lidnariq »

charly400 wrote:I used mmap to sample files in memory, I know people who while debugging an application dump the trace in memory reserved by mmap, it is faster than generating a file,
mmap is literally just a software interface to an MMU and disk cache. There's no way it's substantively faster than explicitly using PI load commands.
it is possible to generate a DMA in N64 from a device like a disk, a page fault occurs when the page is not in memory, but on the disk
What I've read about the N64 implies that using the MMU apparently causes a dramatic performance hit: page faults are incredibly expensive due to the N64's memory bandwidth; it's best to explicitly move things in or out of memory predictively instead of rely on a fault.
charly400
Posts: 17
Joined: Thu Apr 19, 2018 12:19 am

Re: WDC offers free C Compiler/Optimizer and more

Post by charly400 »

I made a mistake, since the debugging process control the registers so control the program flow, I was writing about that when I wrote about mmap
I believed that N64 only handled virtual memory, you say that is it possible to access the RAM directly?, can you access all the registers of the processor directly or does it have something like protected mode?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: WDC offers free C Compiler/Optimizer and more

Post by lidnariq »

The N64 has an MMU with TLB, yes, but it also has an MMU bypass. Reportedly most games use the bypass, because there's not much advantage when it's a single-user single-process system that's usually cooperatively threaded.

More detail
charly400
Posts: 17
Joined: Thu Apr 19, 2018 12:19 am

Re: WDC offers free C Compiler/Optimizer and more

Post by charly400 »

lidnariq wrote:The N64 has an MMU with TLB, yes, but it also has an MMU bypass. Reportedly most games use the bypass, because there's not much advantage when it's a single-user single-process system that's usually cooperatively threaded.

More detail
I have read that the only addresses that the cpu handles are virtual, you say that disabling MMU translation allows direct access to physical addresses?, that's great, i have read in n64 wiki, that in kseg1 and kseg0 virtual addresses = physical addresses, that is, direct mapping by the MMU but without translation, and it is possible with pointers to see the content of the TLB, but from ksseg and kseg3 modes
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: WDC offers free C Compiler/Optimizer and more

Post by lidnariq »

charly400 wrote:I have read that the only addresses that the cpu handles are virtual
Technically correct.
you say that disabling MMU translation allows direct access to physical addresses?
No, you cannot disable the MMU translation.
Part of the memory map is a direct fixed mapping from virtual addresses to physical addresses, with granularity of 512 MiB. (The entire virtual memory range from 0x8000_0000 through 0x9FFF_FFFF, as it says on the wiki, directly addresses physical memory from 0x0000_0000 through 0x1FFF_FFFF.

Physical addresses from 0x0000_0000 through 0x04FF_FFFF, and 0x1FC0_0000 through 0x1FCF_FFFF correspond to devices internal to the RCP; the rest is access to the Parallel Interface. Given how tricky direct PI interface is, I have a hunch that this direct map was only made available so that the PIF's initial program loader didn't have to use the DMA hardware.)

Physical addresses above 0x2000_0000 are technically possible, but apparently unseen.
charly400
Posts: 17
Joined: Thu Apr 19, 2018 12:19 am

Re: WDC offers free C Compiler/Optimizer and more

Post by charly400 »

lidnariq wrote: Part of the memory map is a direct fixed mapping from virtual addresses to physical addresses, with granularity of 512 MiB. (The entire virtual memory range from 0x8000_0000 through 0x9FFF_FFFF, as it says on the wiki, directly addresses physical memory from 0x0000_0000 through 0x1FFF_FFFF.
I understand, it means that this virtual memory, is never located in another place in ram but always in the addresses from 0x0000_0000 through 0x1FFF_FFFF, in ram
lidnariq wrote: Physical addresses from 0x0000_0000 through 0x04FF_FFFF, and 0x1FC0_0000 through 0x1FCF_FFFF correspond to devices internal to the RCP; the rest is access to the Parallel Interface. Given how tricky direct PI interface is, I have a hunch that this direct map was only made available so that the PIF's initial program loader didn't have to use the DMA hardware.)
ok, so, knowing where the program can be located you do not need the DMA system with the MMU to do it, and it is also faster to access the RAM directly.
So the initial position of the program using the MMU is not fixed in RAM = another translation for the program segments, which is what happens when loading a rom through the MMU
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: WDC offers free C Compiler/Optimizer and more

Post by Pokun »

tepples wrote:
Pokun wrote:First time I hear someone call the SNES a modern console. It has more things in common with the NES than the Playstation
I assume you mean the release PlayStation, not the early PlayStation that plays Magic Floor and little else. :P
Yes I mean the release PS. I know it is the Super Famicom's illegitimate child (it even inherited the controller) and the story about the Nintendo PlayStation prototype that was found and repaired.
The biggest reason I've always seen the 32-/64-bit era as a "modern" era in my mind is probably because it's the era when 3D games became standard, that's a huge change in most genres of games that has changed little since. The next biggest reason is that the 32-/64-bit era was designed to use high level programming languages while the 16-bit era was still mostly into assembly.
User avatar
Señor Ventura
Posts: 233
Joined: Sat Aug 20, 2016 3:58 am

Re: WDC offers free C Compiler/Optimizer and more

Post by Señor Ventura »

It doesn't send any email when it is registered :?:
Post Reply