bootloader
bootloader copied to clipboard
Update stage_3.s
- Data descriptor is not needed in long mode
- 41th bit of code descriptor is unused in long mode
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.
@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.
Looks like this PR fell off my raday, sorry! With https://github.com/rust-osdev/bootloader/pull/232 merged, the stage_3.s assembly file no longer exists, so i think we can close this PR.