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

[metal] Fix bug: do not initialize IDT & TSS if unneeded #654

Merged
merged 1 commit into from
Oct 11, 2022
Merged

[metal] Fix bug: do not initialize IDT & TSS if unneeded #654

merged 1 commit into from
Oct 11, 2022

Conversation

tkchia
Copy link
Contributor

@tkchia tkchia commented Oct 10, 2022

libc/intrin/interrupts.S should not be linked in unless an IDT (or TSS) is explicitly requested somewhere (i.e. it should probably not be a mandatory module).

@tkchia tkchia marked this pull request as draft October 10, 2022 10:37
@tkchia tkchia marked this pull request as ready for review October 10, 2022 10:41
libc/intrin/interrupts.S should not be linked in unless
an IDT (or TSS) is explicitly requested somewhere (i.e.
it should probably not be a mandatory module).
@tkchia
Copy link
Contributor Author

tkchia commented Oct 10, 2022

It turns out that I misremembered how the PROVIDE_HIDDEN() linker script directive really works.

PROVIDE_HIDDEN(_tss = 0); means the linker would try very hard to look for a _tss symbol within all the code libraries, and only assign a default value if it cannot find it.

What I really wanted to do was to have the linker look for a _tss symbol only if it is really needed — which is better done with a weak symbol.

Thank you!

tkchia referenced this pull request Oct 10, 2022
- Change IDT code so kprintf() isn't mandatory dependency
- Document current intentions around pthread_cancel()
- Make _npassert() an _unassert() in MODE=tiny
Copy link
Owner

@jart jart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Rock on that it's possible to be non-mandatory.

@jart jart merged commit 31dab8a into jart:master Oct 11, 2022
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