Page 1 of 2

New to OS programming - Some questions...

Posted: Sun Jan 15, 2006 12:00 am
by Mastermind
Hello everybody! I have been programming since I was 8 years old, and I am experienced with some in-depth programming with C, and I know the basics of C++. I am also pretty good with programming in assembly code. I am trying to build an operating system, and I have a few requirements that I would like for it:

1. Compatibility with linux programs
2. Able to use an X Window system
3. Can do basic networking
4. Can do plug-and-play
5. Must run on the Intel x86, AMD x86, and the AMD 64 based processors
6. Supports directories (folders)
7. Can support OpenGL for graphics programming

Now, I am going to start with the basics of getting just basic commands and a bootup, but I would like to make the system able to support graphics with the X Window desktop system. I know that it usually runs on a linux/unix based system, so I would like to have some support for linux in my OS. Ho would I implement support for it? And would it just be a matter of installing the x window system once my ois has support for linux?

Re: New to OS programming - Some questions...

Posted: Sun Jan 15, 2006 12:00 am
by rexlunae
You aren't being specific enough. How will your linux compatibility work? Will you support binary compatibility, such that programs compiled for linux just work, or will you just have source support such that programs written for Linux will compile and run on your os? Or do you mean you do something else entirely?

I fear that you may be making the same mistake that many people posting here make. They defined what they want in terms of high level features, without spending time to design how they will implement the features they want, and then just begin hacking away at it. Then, they start a thread here about how they want to create an OS that will run Windows, MacOS X, and Linux apps, with the one little problem being that they really don't know how, and the other little problem being that they haven't even considered the problems with such a system or how long it will take to implement.

At least the project you have chosen sounds like it is reasonable in scope, in that it is probably not impossible for a small team of developers to make an OS with some kind of Linux compatibility. But what do you want the OS to be? Is it just going to be a Linux clone (in which case you might just want to use Linux) or is it going to have some new ideas and grow in a different direction from Linux, and just use Linux compatibility to ease the adoption of the OS by providing a large number of programs that are immediatly available?

Re: New to OS programming - Some questions...

Posted: Mon Jan 16, 2006 12:00 am
by Legend
Mastermind wrote: 1. Compatibility with linux programs
2. Able to use an X Window system
3. Can do basic networking
4. Can do plug-and-play
5. Must run on the Intel x86, AMD x86, and the AMD 64 based processors
6. Supports directories (folders)
7. Can support OpenGL for graphics programming
Start reading http://en.wikipedia.org/wiki/Single_UNIX_Specification and implement yet another *nix or *nix-alike os like AIX, Irix, Linux, *BSD, etc.

That will at least solve 1, 2, 6 and 7 and help on 3.

Re: New to OS programming - Some questions...

Posted: Mon Jan 16, 2006 12:00 am
by Mastermind
Hi,

Well, I am new to OS programming so I am just learning right now. I would like to have it so programs that have binary compatibility where all programs that are compiled on or for a linux system will be able to run on the OS that I am developing. I would also like to then implement an x window system (kde or gnome) that would allow me to not have to focus on reinventing the wheel for a GUI system. Right now, I am just aiming at getting the OS to be able to boot, use the command line, open files, restart and shutdown.

I was then going to add support for drivers and try to implement plug and play into the OS. After that, I would focus on adding commands to handel files, and then test out some of the drivers. When all is complete there, I am going to add networking to the OS. Then, it would be a matter of adding compatibility for a UNIX like system, and then intergrate an x window gui.

Re: New to OS programming - Some questions...

Posted: Mon Jan 16, 2006 12:00 am
by Legend
Well binary compatibility with linux is a problem, as the different distributions are not fully binary compatible with each other already. ;)

Re: New to OS programming - Some questions...

Posted: Mon Jan 16, 2006 12:00 am
by Mastermind
Hi again! Well, I want to get a base OS up that I will develop on my own. In the base I would like to include:

Bootlog
Kernel
Basic File Handeling
Drivers (with plug and play)
Directories/Subdirectories
Command Line
Calculator
FTP (To test internet connection)
Networking (WAN and LAN)
Account Program (To test multitasking)
Multitasking
x86 for Intel and AMD and the AMD 64 chipsets

I would then like to have enough compatibility with linux/unix to be able to install an x window system on, and that will be basically it. It would then be a matter of getting compatibility with OpenGL and some other libraries and programs to be able to then have a full package.

Re: New to OS programming - Some questions...

Posted: Mon Jan 16, 2006 12:00 am
by Legend
Well, you'll want implement POSIX.

Re: New to OS programming - Some questions...

Posted: Mon Jan 16, 2006 12:00 am
by rexlunae
Mastermind wrote: Bootlog
Kernel
Basic File Handeling
Drivers (with plug and play)
Directories/Subdirectories
Command Line
Calculator
FTP (To test internet connection)
Networking (WAN and LAN)
Account Program (To test multitasking)
Multitasking
x86 for Intel and AMD and the AMD 64 chipsets
Of course the quickest way to implement all this functionality would be to use Linux. Unless you have some reason for wanting to reimplement the whole thing yourself...

Re: New to OS programming - Some questions...

Posted: Mon Jan 16, 2006 12:00 am
by Da_Maestro
While you're at it, I'd like an alternative to windows, so implement windows compadability as well ;)

Re: New to OS programming - Some questions...

Posted: Tue Jan 17, 2006 12:00 am
by Mastermind
Don't be a noob. You cannot have full Windows compatibility. I am going to just try to get some Linux compatibility for my OS. I really just want to have an X Window system and directories right now. I am basicly done with work on the main OS. I can give you a download very soon.

Re: New to OS programming - Some questions...

Posted: Tue Jan 17, 2006 12:00 am
by Legend
Hmm, ReactOS as an OS and Wine as an Implementation of the Win32 API try to have compatibility.

Re: New to OS programming - Some questions...

Posted: Tue Jan 17, 2006 12:00 am
by rexlunae
Mastermind wrote:I really just want to have an X Window system and directories right now. I am basicly done with work on the main OS.
I'm not sure which scares me more, the fact that you consider the work on the main OS almost done, and you just started, or the fact that being almost done, you still have no idea how to support Linux software. You must be writting BIOS OS XP. It might be a problem to get any Linux software working if that is the case.

In order to support Linux binaries, you will need to implement all the Linux system calls. Linux programs make system calls on x86 with interrupt 0x80. You will need to put a handler in your IDT for this. If you don't know what an IDT is, you are doing things terribly wrong, in which case I recommend googling for "protected mode" as a starting point.

Re: New to OS programming - Some questions...

Posted: Tue Jan 17, 2006 12:00 am
by Da_Maestro
lol. Reinterpret my statement assuming that I understand every word you say, and assuming that I am a fat, sarcastic, star-trek fan.

Re: New to OS programming - Some questions...

Posted: Fri Jan 20, 2006 12:00 am
by blackcatcoder
full compabitlity with linux or windows ?

That's only a question of time. I think it would last you at least 2 to 3 years to implement full compability for linux or windows in your Os ;-)

I've also done some implementation of linux libs to my os and it was a lot of work to get only some libs running ;-)!

Re: New to OS programming - Some questions...

Posted: Fri Jan 20, 2006 12:00 am
by Mastermind
First (to clarify), I have been working for 6 months on just the command line with text only programs and some graphical implementation. I am completely new to OS programming, so this is just a starting point for me to learn how it all works out. I am planning on getting the whole OS done in another year. I really just want some thing that I can put LINUX programs onto. I hate windows and I just would like linux compatibility. I know that it will be hard, and it will take much extra time, so I really would like to know your opinions on if I should just write my kernel to have all linux functions for the OS in it and just go from there, or if I will have to do something else.