Oh god, not spinlocks!
Yes spinlocks.
When I wrote my memory allocation code I didn't have thread safety in mind, however while walking the dog I got to the conclusion it was better to make it safe than to do it when multiprocessing is actually implemented. That's why I have implemented spinlocks.
Why spinlocks?
They're simple and easy to understand. I know that they have drawbacks such as wasted CPU-cycles and everything, but right now it's the only form of mutex I can implement with the existing resources.
Right now I'm thinking about paged memory and how to implement it. The concept is rather simple, but the implementation needs some careful planning, as the memory allocation code needed too. (Remember, the memory allocation code cost me 2 rewrites to get it right.)
Where will we go when paging is finished?
I don't know yet. I will either start work on the (A)PIC or on image loading. The latter has a higher priority, but on the other hand, when loading from disk it can be nice to have the disk warn you that it's cache is ready.
Why were you doing this again?
I just want to learn as much as possible about the workings of the PC at software level, and I think the best way to do that is to understand a kernel. And think about it, what is the best way to learn the ways of the kernel? Right, to write one your self.
How long is this project going to last?
I seriously haven't got a clue. I think I'll write my kernel, finish it and then play with it a little. I doubt that this kernel will ever take off, since it's just for plain fun. I would think it's cool however if other people start writing software for the system and help me making it usable. As for now however, it still has a long, long, long, loooong way to go before it's anywhere near that point.
No comments:
Post a Comment