Skip to content

New Feature - Virtual Memory and Exception Handling #22

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions