how to port an os
I wrote an OS www.o3one.org. Now suppose I want to port it to run on Xen.
I think the way to look at it is, although I'm porting to an x86, it's
not a PC but some other system design that uses a crippled x86 CPU (no ring 0, etc).
Are there docs that describe the boot environment, how to do stuff like the equivalent of move to CR3, the pseudo-IO controllers available, and what the exception and interrupt delivery is like and so forth?
I looked through the website and .tar file, is it somewhere else or did I just not see it?
Thanks,
Mike
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
Quoted 5 lines
I wrote an OS www.o3one.org. Now suppose I want to port it to run on Xen.
I think the way to look at it is, although I'm porting to an x86, it's
not a PC but some other system design that uses a crippled x86 CPU (no ring 0, etc).
Well, it may not be that hard for you, since you say that you mostly run in ring-3 already, with explicit traps to ring-0 to do privileged stuff. Those traps will simply get replaced with appropriate calls to Xen.
Quoted 6 lines
Are there docs that describe the boot environment, how to do stuff like the equivalent of move to CR3, the pseudo-IO controllers available, and what the exception and interrupt delivery is like and so forth?
I looked through the website and .tar file, is it somewhere else or did I just not see it?
We're very ill-disciplined when it comes to writing documentation. :-)
The porting job isn't that hard really. I/O is somewhat trickier in recent versions since we moved device drivers out of Xen and into isolated execution domains -- so you now have to do IPC to do I/O, and communicate with a system controller to set up the IPC channels at start of day. However, there is a bunch of code in our Linux port that can be pulled out and used by other people -- the licensing is GPL at the moment, but the appropriate files are entirely our own copyright and really ought to be explicitly relicensed under something BSDish. We can motivate ourselves to do this if it is an issue for anyone.
If you know your way around Linux at all then browsing the sparse source tree of our port will set you on the right path pretty quickly. Otherwise, we can guide you in a step-wise fashion (we've done this for one or two ports already).
Hmmmm.... I /really/ ought to write a proper interface manual. :-(
-- Keir
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
Quoted 6 lines
I wrote an OS www.o3one.org. Now suppose I want to port it to run on Xen.
I think the way to look at it is, although I'm porting to an x86, it's
not a PC but some other system design that uses a crippled x86 CPU (no ring 0, etc).
Quoted 6 lines
Are there docs that describe the boot environment, how to do stuff like the equivalent of move to CR3, the pseudo-IO controllers available, and what the exception and interrupt delivery is like and so forth?
I looked through the website and .tar file, is it somewhere else or did I just not see it?
Oops... forgot to add a little sales pitch! :-
I think that Xen is an excellent platform for 'one-man' OSes such as your own, whose usual bugbear is hardware compatibility (not enough hours in the day for one developer to write or even port all the necessary drivers).
You could port drivers from Linux, but this would not be a one-off effort as you then end up tracking bug fixes, porting new drivers, and so on. And you get bound up in the GPL.
You could wait for UDI drivers to become the de facto driver standard (I noted a section on UDI on your website). Could be waiting a while there, I think. :-)
Or, you can use Xen and use existing device drivers in their native environment in separate, isolated execution domains. For example, boot your system with a control OS (e.g., Linux) and run all your device drivers in there, and have the functionality exported to other domains via high-performance shared-memory interfaces.
Cheers,
Keir
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com