Portable OS??
Portable OS??
is it possible to make a OS that can be used on both MAC and PCs??? ( and others if possible ) with out doing porting another specific version to that platform??
Re: Portable OS??
Hi,
why not? I mean if some coder can write a multi platform virus... :)
mark
why not? I mean if some coder can write a multi platform virus... :)
mark
Re: Portable OS??
Hm, if the code runs on both platforms without porting it, it has to be quiet high-level (no processor specific code etc.). Not the thing I would like for a kernel, wouldn't be to fast I guess.
Also you can't use the same assembly code (and you will need at least some, I think), interrupts etc.
But you could implement kind of an abstraction layer which "converts" functions from your OS to the apropriate hardware specifics. Then you would only have to port this layer not the OS. Qube does it this way AFAIK.
citizen428
P.S.:
Please anybody correct me if I'm wrong, I'm quite new to this OS Dev thing!
Also you can't use the same assembly code (and you will need at least some, I think), interrupts etc.
But you could implement kind of an abstraction layer which "converts" functions from your OS to the apropriate hardware specifics. Then you would only have to port this layer not the OS. Qube does it this way AFAIK.
citizen428
P.S.:
Please anybody correct me if I'm wrong, I'm quite new to this OS Dev thing!
Re: Portable OS??
That makes sence to me. I think, VIS, that if you want to write a multi-platform, there'd be a lot of bumps [im new to OSDEV, too.......] like, for instance, what do you do if user has a Mac [one button] mouse? Would you program the shift (or ctrl, whichever it is now) key to do the same as a right-click? That's just one thing.
Same here about correcting me if im wrong, this just stands out to me as a gen. programmer.
Same here about correcting me if im wrong, this just stands out to me as a gen. programmer.
Re: Portable OS??
I'm pretty sure that you would have to compile it for each platform(Mac, PC).
K.J.
K.J.
Re: Portable OS??
Yes and No. Large parts of your OS can be very portable. Linux, WinNT3/4, Solaris8, even the now defunct BeOS have multiple versions for different processors that are largely built from the same codebase. There is a powderkeg of a flamewar that can be fought over this, but judging by your question, I'll assume that you favor C-like portability over ASM-like bare metal speed (so no one go off and flame me here) and use a less neutral tone....
Unfortunately for us advocates of portability, there are components of an OS that have to be coded with at least ASM wrappers and often full ASM functions. Also, you should be careful of design desisions that lock you into a specific processor (like using segmented memory on x86). I strongly suggest two documents to read. They can both be very challenging to work through even for experienced C programmers but they should illuminate this for you. They are:
http://www.drpaulcarter.com/pcasm/index.php
Dr Carter's PC ASM tutorial (a TON of great info on how ASM works on a practical level with a specific focus on interfacing with C/C++)
...and...
Intel's 386 Programming Reference. No link because it can be found in MANY places, just search for it. It's _dry_ , but it's chocked full of critical information that you will HAVE to know if you want to build an OS on x86.
You should also bear in mind that your development environment under the two platforms will be wildly different on such basic things as 'How do I boot my kernel?' You should figure out what some of the logistical questions you must ask are first (like the boot question above), and then do some research. Once you get started understanding the problems and know _which_ questions to ask you'll be able to find a lot of the information you need on the web. You'll be surprised how much easy some things will turn out to be and how insanely hard some things will turn out to be.
Good luck and don't forget to share your experiences!
Unfortunately for us advocates of portability, there are components of an OS that have to be coded with at least ASM wrappers and often full ASM functions. Also, you should be careful of design desisions that lock you into a specific processor (like using segmented memory on x86). I strongly suggest two documents to read. They can both be very challenging to work through even for experienced C programmers but they should illuminate this for you. They are:
http://www.drpaulcarter.com/pcasm/index.php
Dr Carter's PC ASM tutorial (a TON of great info on how ASM works on a practical level with a specific focus on interfacing with C/C++)
...and...
Intel's 386 Programming Reference. No link because it can be found in MANY places, just search for it. It's _dry_ , but it's chocked full of critical information that you will HAVE to know if you want to build an OS on x86.
You should also bear in mind that your development environment under the two platforms will be wildly different on such basic things as 'How do I boot my kernel?' You should figure out what some of the logistical questions you must ask are first (like the boot question above), and then do some research. Once you get started understanding the problems and know _which_ questions to ask you'll be able to find a lot of the information you need on the web. You'll be surprised how much easy some things will turn out to be and how insanely hard some things will turn out to be.
Good luck and don't forget to share your experiences!
Re: Portable OS??
I writing a JAVA Operating System for x86.
Only the kernel depends on the platform.
All higher level functions are designed using JAVA. That means that you can run the code on any virtual machine without compilation.
Imagine you can do the same project on a mac, JAVA object could be shared freely.
Only the kernel depends on the platform.
All higher level functions are designed using JAVA. That means that you can run the code on any virtual machine without compilation.
Imagine you can do the same project on a mac, JAVA object could be shared freely.