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

KUDOS: How do I halt the simulator? #25

Open
oleks opened this issue May 6, 2016 · 7 comments
Open

KUDOS: How do I halt the simulator? #25

oleks opened this issue May 6, 2016 · 7 comments

Comments

@oleks
Copy link
Collaborator

oleks commented May 6, 2016

I thought syscall was the way?

This seems to run forever: DIKU-EDU/kudos@cb64335

@JanmanX
Copy link
Owner

JanmanX commented May 8, 2016

Right now, the simulator is hardcoded to exit on syscall, when $v0 = 10. The value in $v1 is returned as a result.

@JanmanX JanmanX closed this as completed May 8, 2016
@oleks
Copy link
Collaborator Author

oleks commented May 8, 2016

You mean like this? KUDOS still runs forever..

DIKU-EDU/kudos@8f8c781

@oleks oleks reopened this May 8, 2016
@JanmanX
Copy link
Owner

JanmanX commented May 8, 2016

The code at DIKU-EDU/kudos@8f8c781 should work (unless $v0 is not 10 after the ORI).

I've found some issues with address translation, getting the simulator stuck in certain conditions. I suspect the simulator does not even reach the exit code. I will investigate further.

@JanmanX
Copy link
Owner

JanmanX commented May 8, 2016

Commit b05e449 seems to be able to successfully run the minimal version of KUDOS, with this code in kudos/init/mips32/_boot.S

  #  ori v0, 10                                                                 
  jal init                                                                      

  addi v0, $0, 10                                                                                                     
  syscall 

(I am not quite sure why $v0 is set prior jumping to init, nor why it is set using ORI?)

@oleks
Copy link
Collaborator Author

oleks commented May 8, 2016

Right, I made a typeo!

@oleks
Copy link
Collaborator Author

oleks commented May 8, 2016

A typeo wrt. to putting ori before jumping to init, and not giving it an two arguments. I don't understand why that even compiles.. I used ori out of habit as it can be used as you use addiu, but doesn't require the support of signed/unsigned operations in a simulator.

@JanmanX
Copy link
Owner

JanmanX commented May 20, 2016

A shutdown device has been implemented in the simulator, but the "$v0 = 10, syscall" method will still remain in the simulator for now, as a fail-safe shutdown method.

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