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

Resolve "Add Kernel Logger" #372

Merged
merged 9 commits into from
Feb 12, 2022
Merged

Resolve "Add Kernel Logger" #372

merged 9 commits into from
Feb 12, 2022

Conversation

Kfeavel
Copy link
Member

@Kfeavel Kfeavel commented Feb 8, 2022

Closes #357

@Kfeavel Kfeavel added feature Additional functionality enhancement An improvement on a pre-existing code labels Feb 8, 2022
@Kfeavel Kfeavel self-assigned this Feb 8, 2022
@Kfeavel
Copy link
Member Author

Kfeavel commented Feb 8, 2022

As of right now the Logger constructor is not getting called at all and I'm at a complete loss as to why that would be. I've tried moving it into the global namespace, calling the constructor manually, printing inside it, and just about anything else. No indication that it's getting initialized. When I moved it to the global namespace, the constructor appeared in the .ctors section according to Ghidra, but m_logLevel was still 0 (lTrace) despite the code showing it should be set to 3 (lInfo).

Edit: I wonder if this is also why the prime number "program" is no longer working... If the bitset it uses isn't being defaulted to 1 instead of 0 then it would explain the regression. This could also be related to what order objects are being linked into the kernel. According to the OSDev Wiki, linking crti.o, crtbegin.o, crtn.o and crtend.o must be done in a specific order otherwise odd behavior might occur. @micahswitzer is there a way we could force SCons to link those objects in a certain order?

@Kfeavel
Copy link
Member Author

Kfeavel commented Feb 9, 2022

Global constructor issue was resolved (at least in part) in #373. However, even though things like the primes task are now working properly, the static Logger instance is still not being constructed properly. The log level is being ignored.

@Kfeavel
Copy link
Member Author

Kfeavel commented Feb 12, 2022

@micahswitzer raises the point that having something to replace all of the __func__ arguments would be nice. I propose that once we create the standard library directory, we can add a SourceLocation class that mimics the functionality of std::source_location

@Kfeavel Kfeavel marked this pull request as ready for review February 12, 2022 22:36
@Kfeavel Kfeavel merged commit fb69dd2 into dev Feb 12, 2022
@repo-ranger repo-ranger bot deleted the 357-kernel-logger branch February 12, 2022 22:48
@Kfeavel Kfeavel mentioned this pull request Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement on a pre-existing code feature Additional functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Kernel Logger
2 participants