Separating Architecture Specific Code
Posted: Fri Jan 04, 2008 3:45 am
Hello,
As I'm implementing this at the moment, I nearly put it in the OS Development forum, but I'm not talking code, so went for this one...
I am trying to separate out the architecture dependent part of my OS from the architecture independent stuff - much in the same way as Linux has an /arch directory. At the moment, I am just at the 'planning' stage of this but have ended up with this kind of list (certainly not exhaustive!):
Architecture Dependent (must be rewritten for each arch):
* Memory Management (but looking through Linux source, a lot of mm seems to be in the main source tree outside /arch)
* Interrupt Handling <-- this leads me to think that almost the entire scheduler must be in the architecture dependent portion???
* System Call interface (can then call code in the architecture independent section).
* Device detection code (but driver interface is arch dependent).
Architecture Independent:
* VFS
* Driver Interface
* Executable Relocator (but the part that prepares a new process for execution must be arch dependent).
* All the higher level stuff such as window manager, apps and so on.
I guess more will come to light as I start implementing things. The problem for me at the moment is that firstly, the line between what should be in /arch and what should not seems a little blurred at present. This is especially the case when there is something I think of as one 'unit', such as the MM, which may be split between '/arch' and the rest of the source tree.
Also, given the lists above, it looks like there is a hell of a lot of stuff to go in the /arch directories.
I'm going to start off by implementing an x86 port for an x86_64 kernel.
All thoughts / hints appreciated!
Cheers,
Adam
As I'm implementing this at the moment, I nearly put it in the OS Development forum, but I'm not talking code, so went for this one...
I am trying to separate out the architecture dependent part of my OS from the architecture independent stuff - much in the same way as Linux has an /arch directory. At the moment, I am just at the 'planning' stage of this but have ended up with this kind of list (certainly not exhaustive!):
Architecture Dependent (must be rewritten for each arch):
* Memory Management (but looking through Linux source, a lot of mm seems to be in the main source tree outside /arch)
* Interrupt Handling <-- this leads me to think that almost the entire scheduler must be in the architecture dependent portion???
* System Call interface (can then call code in the architecture independent section).
* Device detection code (but driver interface is arch dependent).
Architecture Independent:
* VFS
* Driver Interface
* Executable Relocator (but the part that prepares a new process for execution must be arch dependent).
* All the higher level stuff such as window manager, apps and so on.
I guess more will come to light as I start implementing things. The problem for me at the moment is that firstly, the line between what should be in /arch and what should not seems a little blurred at present. This is especially the case when there is something I think of as one 'unit', such as the MM, which may be split between '/arch' and the rest of the source tree.
Also, given the lists above, it looks like there is a hell of a lot of stuff to go in the /arch directories.
I'm going to start off by implementing an x86 port for an x86_64 kernel.
All thoughts / hints appreciated!
Cheers,
Adam