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

Tips for implementing x86_64 support #648

Closed
Omay238 opened this issue May 6, 2022 · 1 comment
Closed

Tips for implementing x86_64 support #648

Omay238 opened this issue May 6, 2022 · 1 comment
Labels

Comments

@Omay238
Copy link

Omay238 commented May 6, 2022

I'm going to attempt to make x86_64, so how would people suggest I do this? Any useful resources?

@copy copy added the question label May 6, 2022
@copy
Copy link
Owner

copy commented May 6, 2022

Heads-up: This is probably a 3-6 month project (full-time).

The Intel software developer's manual is the main reference: https://cdrdv2.intel.com/v1/dl/getContent/671200
wiki.osdev.org is sometimes useful, e.g. https://wiki.osdev.org/Paging

I'd suggest starting with disabling the jit, because that's a complex project by itself.

Breaking it down:

  • Add support for switching to long mode
  • Extend the instruction decoder generator (gen/generate_interpreter.js), note that some regular instructions (e.g. the brilliant single-byte inc esp instruction) become prefixes
  • Add support for 64-bit paging (see Add support for PAE (#97) #599 for an example of adding a new paging mode)
    • Probably requires adding support for NX pages, i.e. memory access from eip need an extra check
  • Make register 64 bits wide (existing instructions might need to special care; for example, mov eax, ebx clears the upper bits of rax)
  • Make 64-bit variants of all instructions

@copy copy changed the title Tips Tips for implementing x86_64 support May 20, 2022
@copy copy closed this as completed May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants