Object-Orientated Design for a Small OS
Posted: Sun Sep 14, 2008 2:09 am
Hi everyone,
Been a *long* time since I've been around here, I didn't realise how much I missed OS development!
And so, as well as working on Pedigree with JamesM (which I'll be rejoining later this year, not out of school yet ), I'm looking at making my own little OS for the sole purpose of writing networking code. So, it'll have a very simple device interface and I won't be looking at spending much time on a CLI or stdlib or anything. Just a tiny little system that I can build my network stack on.
However, I don't want to take someone else's code for this core system. I really like coding stuff like this myself (ie, GDT et al) . The trouble is, I am looking at the moment at a more OO design (so C++ for sure) and as such am trying to figure out the best way to pull it off.
I was thinking of having (at the least) static objects for each individual element (eg, GDT, IDT, Console, device manager), so a call to setup the GDT is as simple as GDT::Init(), or similar. However, it sort of feels like this defeats the purpose of such a design (and is super-duper unportable). I also want to try to make the design as robust as possible so I don't have to worry about the kernel itself breaking when I want to test the network stuff (ie, no packets coming in shouldn't be caused by the kernel).
Any tips or ideas or criticism would be appreciated!
Been a *long* time since I've been around here, I didn't realise how much I missed OS development!
And so, as well as working on Pedigree with JamesM (which I'll be rejoining later this year, not out of school yet ), I'm looking at making my own little OS for the sole purpose of writing networking code. So, it'll have a very simple device interface and I won't be looking at spending much time on a CLI or stdlib or anything. Just a tiny little system that I can build my network stack on.
However, I don't want to take someone else's code for this core system. I really like coding stuff like this myself (ie, GDT et al) . The trouble is, I am looking at the moment at a more OO design (so C++ for sure) and as such am trying to figure out the best way to pull it off.
I was thinking of having (at the least) static objects for each individual element (eg, GDT, IDT, Console, device manager), so a call to setup the GDT is as simple as GDT::Init(), or similar. However, it sort of feels like this defeats the purpose of such a design (and is super-duper unportable). I also want to try to make the design as robust as possible so I don't have to worry about the kernel itself breaking when I want to test the network stuff (ie, no packets coming in shouldn't be caused by the kernel).
Any tips or ideas or criticism would be appreciated!