Page 1 of 1
Some qs after reading some posts
Posted: Fri Jul 29, 2005 11:00 pm
by Fahad
Hi!
I am a beginner and have some questions.
1. Why would any one want to develop a new OS. I mean there is linux. Why not just grab its source code and change it to your liking?
2. What is the first language I should start to learn to develop an OS? Which should be the second language? Is there a need for a second or third language? I have some programming experience.
3. Some one said that "You will need to figure out how to convert the exe to a flat binary image, or just add support for PE format in your OS." Does that mean I can some how install Windows programms and driver on my own 'from the scratch' OS?
4. I need to read a book on Os theory. Some thing basic. Can some one please send me a link or two to zip/rar on the net.
Thanks
Fahad
Re: Some qs after reading some posts
Posted: Fri Jul 29, 2005 11:00 pm
by smiddy
Hi Fahad, and welcome to the forum.
I'll try to tackle each question one at a time.
Your first question is a very good one. Why the heck would someone want to spend their time learning everything there is to know about a hardware platform in order to write an operating system for it when there are several available, not to mention Linux, where you have the source code? In my defense, I am doing it to learn the platform a little better than I know it now. I personally don't expect to win any awards or compete against Windows, Linux, Unix, DOS, et al. It is the sheer pleasure of learning something I don't already know.
For your second question, it really depends on what you intend to do. If as you hint at, are going to redo linux, you'll definitely need to know C. Though, as Dex will say, some assembly is required. But if you take my approach and are learning as you go, you have the time to just do it from assembly as you'll understand the nuts and bolts of what is happening a lot better that way, in my opinion (mileage varys with hom you ask).
For your third question I am not currently at a stage in my own operating systems development where I am running programs yet. I've been tinkering with my system for about 18 months now, when the time is available. I do know what these are but haven;t considered a way to implement and executeable format until I have my command line interface 100% (that really means never, so 85% is more realistic). I have considered PE format and there is a way to implent it where you don;t use Windows API. It is the structure of the program you need in order to place it where it needs to go and run within your OS that is important. Will Windows driver/applications work on your OS, not unless you provide a compatible API that will furnish those apps with what they are looking for to run properly. Just a word of advice, your executeable format is important, but is probably the least of your worries until you have a working kernel. By that time you would have considered the memory allocation routines and considered the type of memory layout you are going to employ. This will play heavily in how you employ executeable code.
I have one book by Abraham Silberschatz and James L. Perterson: Operating System Concepts Alternate Edition. ISBN: 0-201-18760-4 It is a bit dated but has a lot of fundamentals that are useful. As for some technical reading I found this one night surfing:
http://www.freeinfosociety.com/computer ... nical.html
It should give you some insight into how DOS was made and how a single tasking OS works.
Hopefully this isn't too overwhealming, but the course of OS development, by one man, isn't a small slope, but a steep learning curve for years of enjoyment (or hatred as some my say).
Re: Some qs after reading some posts
Posted: Sat Jul 30, 2005 11:00 pm
by Legend
It would take a lot longer to modify Linux to my idea, then it would take to reimplement everything. That is because I would do a lot of things completely different already in the design, as a result at best I could port some drivers over.
Re: Some qs after reading some posts
Posted: Sat Jul 30, 2005 11:00 pm
by Osbios
Most people rewrite a os to learn the hardware stuff and understand whats happening inside of OSs.
Why not linux? : currently the source of linux is over 100MB. Ok the drivers are the biger part, but you can not learn realy good with source of other OSs. And by the way: some usable-OS projects use Linux as base. (
http://www.aros.org/)
Re: Some qs after reading some posts
Posted: Sat Jul 30, 2005 11:00 pm
by Legend
Now is this more like what Cygwin with Posix is for Windows?
Re: Some qs after reading some posts
Posted: Sat Jul 30, 2005 11:00 pm
by Fahad
Hi!
I want to start building my own OS for the following reasons.
1. I am not happy with windows. Linux is not as friendly with the hardware as Windows is. Since I already had hardware
problems with linux I thought it was better to spend the time and energy to make the hardware work with my OS rather than
with linux.
2. As you guys mentioned, creating your own OS, helps to understand 'more throughly' whats going on under the hood.
3. I want to help others, since I was helped by others and it is only possible when I really know my stuff.
I knew that going through the Linux code wont be easy and if I put the same effort into building a new OS, it would teach me
a lot more. I just wanted to make sure that this was a good reason for building a new OS.
I also wanted to create an OS that could run applications/drivers that are made for other OSs. I knew about API but was not
sure if there was or not, a way to get the apps working with my API if I made it similar to windows API. I guess I should
have asked it in this way.
Can I create the API of my OS similar to Widow's or to Mac's Or may be both? I know it would mean a lot of trial and error
but is it possible or practical?
So far I understand that I need to learn C(may be C++) and Assembly to achieve my own OS.
What should I start to learn first? Assembly or C.
Thanks
Fahad
Re: Some qs after reading some posts
Posted: Sat Jul 30, 2005 11:00 pm
by smiddy
The Windows API is do-able. The Mac stuff I can not answer and will defer to other's who know it better; though I suspect you'll need to emulate the Mac, being on a different archetecture.
I would say C will give you a great foundation. C will lead you into assembly anyhow, when you are ready.
Good luck!
Re: Some qs after reading some posts
Posted: Sat Jul 30, 2005 11:00 pm
by Fahad
Hi!
I have found the following books on the net. Which one would you say that I should read first. Please put a number beside the
names.
Operating.System.Concepts,.5th.Edition.rar
Developing Your Own 32 Bit Computer Operating System
Brooks-Cole - Understanding Operating Systems (Flynn, Scan) - 1991
McGraw-Hill - The Operating Systems Handbook - Fake Your Way Through Minis and Mainframes - 1994
Prentice Hall Ptr - Modern Operating Systems(2Nd)
operating system kernel for all real time systems
Operating System-Design and Implementation
Modern Operating Systems(2nd)
Operating_system_concepts_6ed
Smiddy there are two Operating System Concepts titles. are they the one you asked me to read.
Thanks
Fahad
Re: Some qs after reading some posts
Posted: Sat Jul 30, 2005 11:00 pm
by Legend
You can provide the Interrupt Service Handler that Windows Programs use to communicate with the kernel, but be warned that this is only a small piece of the puzzle. At least on an advanced stage, things like the registry, COM, etc. will require work, too.
The same applies in some ways to other APIs, too.
Re: Some qs after reading some posts
Posted: Sun Jul 31, 2005 11:00 pm
by smiddy
That appears to be a different one. this one is dated 1988, with copyrights of 1985 and 1983. Different authors too.
Woops, my mistake, that 6th edition is probably the one as Silberschatz is one of the authors.
Re: Some qs after reading some posts
Posted: Tue Aug 02, 2005 11:00 pm
by Fahad
Hi!
I have started reading the book. Seems to be any easy one. thnaks.
One more qs. Can I create an OS in BASIC. There are hardcore BASIC programmers out there who say that any thing is possible in BASIC. So may be I can. I know that BASIC is far more easier then C/C++ but what would be easier, creating an OS with C or with BASIC?
Thanks
Fahad
http://k.domaindlx.com/nxrb/
Re: Some qs after reading some posts
Posted: Fri Aug 05, 2005 11:00 pm
by carbonBased
Sure you can create an OS in BASIC... if you have an interpretor that will assemble/run code based on your OS spec... which would have to be written in a lower level language (probably C)... in other words... it's hardly worth the effort, in my opinion.
--Jeff
Re: Some qs after reading some posts
Posted: Sat Aug 06, 2005 11:00 pm
by carbonBased
I feel I should go into more detail here... that wasn't much of an answer, now that I read it
In "true" basic, you cannot write an OS. BASIC does not provide the mechanisms to query and utilize all aspects of the processor... and, of course, it's interpretted.
IF you were to extend BASIC to provide everything it's missing (which is a lot, I might add) then you could write an OS-ish type program, but it would still be interpretted.
To finally run it on its own, you'd need a way to combine your own BASIC interpretter that would run directly on-top of the hardware, and parse and execute your BASIC source. In this sense, you've almost got an OS running by using BASIC... however:
1. You'd have to write your own BASIC interpretter, and the interpretter would be written in assembly and C, no doubt, and would actually be a core OS in itself.
2. This isn't truely BASIC, as you'd have to extend it quite a fair bit
3. Your OS would be slower then the average OS because it would have to be interpretted.
4. This is way too much effort in my opinion. I do, however, think, that a BASIC-like language that's been extended to provide more OS commands would be a very cool scripting language that could be used to check the health or query the OS when it's finally be written (ie, it could be a programmer's shell).
--Jeff