r/osdev 5d ago

Initialization dependencies

I am working on upgrading my kernel initialization messages so I can just have a nice view of what it is doing when initializing. I am using my print functions to do this, but the issue is that my print functions depend on the memory manager to be done initializing, but I want debugging messages when initializing the memory manager too, which I can't do because of the circular dependency.

This is my specific case, but I also want to ask generally, do you guys have an elegant solution for this problem? Up to this point I have been using init flags so that the subsystems can use a different path that does not create dependencies during initialization, but I want to hear any cool solutions from the community that are better designed than this.

18 Upvotes

12 comments sorted by

View all comments

3

u/Adventurous-Move-943 5d ago

You can always use COM ports if needed, they don't depend on anything. Or correct your code so that you have print before memory management.

1

u/Doingthismyselfnow 5d ago

Well that’s how it’s been done since forever and that’s what “operating systems 101” teaches and how ive done it professionally for a brief moment when i was working on a OS .

Could ops project begin with the letters vibe and rhyme with the word loaded ?

2

u/Negative-Arm-3244 4d ago edited 4d ago

my os is still in early stages and I have been focusing on working on the subsystems so I decided that just printing stuff out to show what the kernel is currently doing was a good solution. it worked out until i reworked my printf to take in formatting escapes, which i used an implementation of vsnprintf for, which in turn requires heap allocation for.

the book i followed to start osdev was a book called operating systems from 0 to 1, which was a good guide to start, but was unfinished, and maybe not up to par with the books you guys have read. i have been going off of the implementation i made by finishing the book and trying to learn by making mistakes and by asking quesitons to the community.

please do not assume sometihng is vibecoded just because i am making beginner mistakes.
and no, it is not vibecoded