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

New Feature - Virtual Memory and Exception Handling #22

Open
psyker156 opened this issue May 31, 2018 · 1 comment
Open

New Feature - Virtual Memory and Exception Handling #22

psyker156 opened this issue May 31, 2018 · 1 comment

Comments

@psyker156
Copy link
Contributor

All, I am currently working on implementing a virtual memory controller. This also requires an exception handler mechanism.

This is the work I have done so far:
Added virtual memory controller
Added VMR (virtual memory register) to the execution unit
Added SVMR instruction to allow loading the VMR (this works like the SIVR instruction)
Added some testing files in the testFiles folder
Added support for exception handling on (only element generating exceptions at the moment is the InstructionFetchUnit, a lot more work needs to be done)
Did some work on debugger to face a couple of edge cases
Did a lot of work on test cases (a lot more work needs to be done)

These changes will be submitted with some important changes.
For example, previously, exceptions that would have resulted in the VM "crashing" with an error message, can now, in some case, be passed directly to the core as an exception (allowing user code to deal with it). At the moment, exceptions are treated almost the same as interrupt. The difference being that exception can't be masked.
The virtual memory system will itself have the following features:
512KB Pages (yes I know this is outstandingly large but I don't think this to be such an issue on a training environment... if anything this is desirable as it allows for a simpler translation table)
The ability to set 3 flags in each translation table entry:
E - Executable
P - Privileged
A - Available
This will allow for a Kernel/User mode feature to be implemented in the near future along with the mechanism required for someone to implement paging (as in swapping) and execution protection mechanism (this is the only one that is currently in, not fully tested)

As you can guess, implementing this feature is quite a task. The current state of my fork is relatively crude as I have not reviewed my own work yet. - A lot of cleanup is required on my part right now.

If you are interested in having a look, you can find the work in the virtualmemory branch in my own fork.
https://github.com/psyker156/spartacus/tree/virtualmemory

@psyker156
Copy link
Contributor Author

Making a lot of progress... I should be able to go for a PR sometimes mid week next week. Those who have intention to code review, please feel free to drop by my fork and have a look at what's done so far. Lots of refactoring and testing ahead of me right now but I'd rather get comments before PR than after so that this can go in as fast as possible.

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

No branches or pull requests

2 participants