Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memorymap.c: initialize mappings array with zeros #108

Merged
merged 1 commit into from
Oct 13, 2018
Merged

memorymap.c: initialize mappings array with zeros #108

merged 1 commit into from
Oct 13, 2018

Conversation

pavelkryukov
Copy link
Contributor

@pavelkryukov pavelkryukov commented Oct 6, 2018

For my experiments, I used to create memory_map on dynamic memory, and it was not initialized with zeroes by default.

@tj90241
Copy link
Collaborator

tj90241 commented Oct 13, 2018

Are you sure about this one? The device (and thus bus structure, etc.) should be allocated by cen64_alloc here: https://github.com/tj90241/cen64/blob/72c778c3bfb25262498af6a21e8dec828a28be19/cen64.c#L175

This function is a wrapper around the OS's allocator, which is expected to wipe pages prior to returning them (and where the OS maybe does not, cen64 does):
https://github.com/tj90241/cen64/blob/master/os/posix/alloc.c#L41

@pavelkryukov
Copy link
Contributor Author

pavelkryukov commented Oct 13, 2018

Hmm. that would be hard to reproduce...
I found that I do not need to allocate memory_map on heap and removed the patch which triggered the issue.

And, just to mention: I used Windows Subsystem on Linux when I got rubbish in that structure.

@tj90241
Copy link
Collaborator

tj90241 commented Oct 13, 2018

Bahhh, Microsoft strikes again... ok, sounds like this is needed then until we figure out something better.

@tj90241 tj90241 merged commit 06de46e into n64dev:master Oct 13, 2018
@pavelkryukov pavelkryukov deleted the patch-2 branch October 13, 2018 01:13
@pavelkryukov
Copy link
Contributor Author

pavelkryukov commented Oct 13, 2018

(Spoiler alert: CEN64 does not start audio and video on WSL anyway. Luckily, I do not need them yet)

@tj90241
Copy link
Collaborator

tj90241 commented Oct 13, 2018

Interesting integration of your simulator into CEN64 btw, will look at this sometime!

@pavelkryukov
Copy link
Contributor Author

Thanks! Our simulator is still far away from being functionally compatible with MIPS ISA.
For now, it executes only the first instruction (lui $t1, 0x3400) as the second instruction is CP0 which we do not yet support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants