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

Update stage_3.s #230

Closed
wants to merge 1 commit into from
Closed

Update stage_3.s #230

wants to merge 1 commit into from

Conversation

prinzdezibel
Copy link

  • Data descriptor is not needed in long mode
  • 41th bit of code descriptor is unused in long mode

- Data descriptor is not needed in long mode
- 41th bit of code descriptor is unused in long mode
@phil-opp
Copy link
Member

Thanks for the PR!

  • Data descriptor is not needed in long mode

You're right that it is not needed in this case, but you still need them for system calls. I'm fine with removing it here.

  • 41th bit of code descriptor is unused in long mode

The AMD manual states that this bit is ignored, but I can't find anything like this in the Intel manual. There are some slight differences between the two sometimes, so I think it's better to keep the readable bit if there is any doubt.

@prinzdezibel
Copy link
Author

prinzdezibel commented Apr 10, 2022

@phil-opp , regarding the WRITABLE descriptor flag (41th bit) I am refering to

https://github.com/rust-osdev/x86_64/blob/8922d8d0b8532324237c2384bdddc91c335bc54f/src/structures/gdt.rs#L208

which states it's not needed in long mode.. Also I've read it in your blog_os tutorial, IIRC.

https://os.phil-opp.com/entering-longmode/#loading-the-gdt

   dq (1<<43) | (1<<44) | (1<<47) | (1<<53) ; code segment

Thank you for your great OS development & Rust tutorial. This is an invaluable source of extremly useful information.

@phil-opp
Copy link
Member

phil-opp commented Jan 2, 2023

Looks like this PR fell off my raday, sorry! With #232 merged, the stage_3.s assembly file no longer exists, so i think we can close this PR.

@phil-opp phil-opp closed this Jan 2, 2023
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.

2 participants