Archived

This topic is now archived and is closed to further replies.

johnc82

Bulding an operating system

Recommended Posts

hi...... I wonder anyone here experince before building an operating system.....and by the way where can i find some resources about it? Thanks..

Share this post


Link to post
Share on other sites
quote:
Original post by johnc82
hi......


I wonder anyone here experince before building an operating system.....and by the way where can i find some resources about it?


Thanks..



I certainly have never done anything like that. Too big a project for me
And some resources right here : http://www.nondot.org/sabre/os/articles.

Share this post


Link to post
Share on other sites
I think you should take a look at some source / documentation from a Open Source system to see how things are built. Linux might be an alternative.. :-)

But, this is a pretty complex task...

----------------------------------------------
Petter Nordlander

"There are only 10 kinds of people in the world. The who understand binary and those who don''t"

Share this post


Link to post
Share on other sites
Thanks for the reply....

however i wanted the OS to be build fully on assembly......
need more assembly tutorial..........

Share this post


Link to post
Share on other sites
First, building an OS from scratch is an unbelievably immense task. The software alone would be incredibly complex, but then you also have to consider being compatible with all the types of PC hardware out there - this means also an writing an untold amount of drivers.

Second, why do you want it to be completely in assembly? Are you mad?

Why do you want to do this? What need cannot be fulfilled by Linux or Windows?

Regards,
Jeff

Edit: I'm not saying that all possible needs can be fulfilled by Linux or Windows, but I was just curious - it sounds like you're a one-man team with not much experience so I'm trying to understand why you want to do this? Is it purely for educational/hobby?

[edited by - rypyr on August 5, 2003 12:55:55 PM]

Share this post


Link to post
Share on other sites
Writing an OS is a task that requires much knowledge. Expect to spend many hours in a good academic library, learning about scheduling algorithms, page replacement algorithms, filesystem theory, implementation of efficient synchronization primitives, etc., etc., etc. It''s not a project to undertake if you don''t have a LOT of uninterrupted free time to work on it.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
Typically the OS loader is in assembly. The rest of the kernel is in some other language, usually C. C++ can be used as long as you understand the possible pitfalls, i.e. global objects needed to be initialized properly before main is called, you have to have a heap manager in place before doing any sort of allocations (i.e. no std library early on in the bootstrap), execptions can''t be used unless you are somehow able to figure out how to emulate the exception handling mechansim of the OS and/or compiler your compiler was originally written for, etc, etc.

Share this post


Link to post
Share on other sites
Building an entire OS from assembly would be like having to create all the bricks for the Great Wall of China, and then building it.

Share this post


Link to post
Share on other sites
Why do you want to build your own OS?

Just download Linux and modify it and call it Xinux. Simple.
Or hack into the M$ server and download Windows and call it Windows Pirated Edition.






WiseElben.com - Game programming tutorials, articles, and community.

E-mail:wiseelben@wiseelben.com
AIM: WiseElben
ICQ: 299127026

[edited by - GameDev Staff on September 27, 1989 9X:58:97 XMS] For violating Article 43 Page 456 Paragraph 251 Line .042

Share this post


Link to post
Share on other sites
I fear that all of this criticism is going to cause you to invoke some will power saying "they said I couldn''t...but I did," when you''re are SERIOUSLY going to fail. I''m scared for j00 :|

Share this post


Link to post
Share on other sites
Strange. At no point does "johnc82" say anything about developing an OS for the PC platform, yet everyone has made this assumption.

It''s quite feasible to build a basic OS on a fairly closed platform. If it''s for educational purposes, it''s even fun. Pick a device with stable hardware and start reading hardware specs. I''ve seen an OS built for GBA. I''ve written mini-OSes for the older platforms I wrote games for. (Sinclair ZX Spectrum and Commodore Amiga.)

It''s not THAT hard, just as long as you aim for a sensible target.

--
Sean Timarco Baggaley

Share this post


Link to post
Share on other sites
Just pulling some of my University textbooks off the shelf...

"Modern Operating Systems"
Andrew S. Tanenbaum
ISBN 0-13-588187-0
- A general overview of the concepts involved.

"Microcomputer Systems: The 8086/8088 Family"
Yu-Cheng Liu, Glenn A. Gibson
ISBN 0-13-580499-X
- Assembly for early x86 systems

"Real-Time Concepts for Embedded Systems"
Qing Li
ISBN 1-57820-124-1
- A recent acquisition of mine in case you''re interested in embedded systems.

In addition, you can find plenty of assembly resources on the web. Other OS concepts, such as multitasking, filesystems, device drivers, etc. can also be found by doing searches on Google.

Share this post


Link to post
Share on other sites
thank for the reply....


1)the reason i want to build OS is for eduction purpose....... there are not much type of crossplatform OS... and some fo them are not fully or strongly implemented in OO mannager.... if LINUX can do it so am I :D .....

2)the reason of using assembly is because it consider the lowest level programming language that can directly communicate with the hardware itself........... although it very havoctic and challenging..... (like now I''m trying to slove the string problems.... which already almost a month :-P..... thanks to int 21H (DOS Interrupt)).... plus it can be use for reverse engineering

3)of course everthing start has to start from small and simple......... and accomplish it piece by piece (OO) :-P

Share this post


Link to post
Share on other sites
Writing an OS isn't as hard as some of you seem to think, there's tons of hobbyist developers hard at work on their own projects. Obviously you'll never have something like Windows, but that's not really a reasonable goal.

Writing it completely in assembly is inane, however.

Check out the MegaTokyo boards.



[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people

[edited by - wild_pointer on August 6, 2003 6:19:15 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by johnc82
thank for the reply....


1)the reason i want to build OS is for eduction purpose....... there are not much type of crossplatform OS... and some fo them are not fully or strongly implemented in OO mannager.... if LINUX can do it so am I :D .....

2)the reason of using assembly is because it consider the lowest level programming language that can directly communicate with the hardware itself........... although it very havoctic and challenging..... (like now I''m trying to slove the string problems.... which already almost a month :-P..... thanks to int 21H (DOS Interrupt)).... plus it can be use for reverse engineering

3)of course everthing start has to start from small and simple......... and accomplish it piece by piece (OO) :-P


First off, if you''re trying to solve a string problem by using int 21h, you''re already on the wrong path. You have no dos interrupts when you boot your machine with your own boot loader (or even someone elses), so forget about int 21h. If you are going for a real mode (16-bit) operating system (much simpler than 32-bit pmode), look into interrupt 10h to do any video stuff. Also, if you decide to do the 32-bit pmode, you lose even the bios interrupts unless you implement some sort of v86 call gate. I wrote a 16-bit OS that loaded, loaded an .exe compiled in turbo c/c++ (using my custom libs) and ran my software 3d engine (with texture mapping). It had read only fat12 support, and a few other goodies, but was pretty minimal and didn''t take that long to write. I am now attempting to write a 32-bit pmode OS, and am moving on to the memory manager and multi-tasking stuff, then it''s onto the keyboard, mouse and video drivers. So far it''s 100% assembly .

Share this post


Link to post
Share on other sites
Hey, don''t kill the guy... if I had the knowledge and enough time, i''d like to write an OS myself, just for the cause of EXPERIENCE.

But i can assure you, i wouldn''t write the entire OS in assembly, just the loader as soemone mentioned and the core files. the HAL.DLL in Win2K / WinXP is written in assemby...

Share this post


Link to post
Share on other sites
It's not that assembly is hard, but making long, logical, and maintainable programs with it is!

HALs are one field where it's usable, however: there the code needs to be run as close to the actual hardware as possible.

[edited by - Nik02 on August 6, 2003 6:55:32 AM]

Share this post


Link to post
Share on other sites
I have an pdf ebook tutorial called MMURTLV which is a 32 bit OS written by some guy and goes through each step in his book. Strangely enough I got the book from a Princeton website I believe. The book is still in print and sold in bookstores yet it was freely available from a reputable school website. I downloaded it anyhow! I might try to find the url or someone can type in OS in google and you might come out with the url. I haven''t gotten into it yet though but it seems to be a good book for a beginner. If anyone can''t find the url I''ll upload it to my server and let you download it just email me.

Share this post


Link to post
Share on other sites
quote:
Original post by Metus
the HAL.DLL in Win2K / WinXP is written in assemby...


just interested to know how you know that

Share this post


Link to post
Share on other sites
A few links to get you started:

http://my.execpc.com/~geezer/osd/index.htm

http://www.osdever.net/

I've tried the task myself and it requires a LOT of time for research and getting the things to work. Also, you would want to use a PC emulator like Bochs (http://bochs.sourceforge.net/) to try your OS.

Good Luck!

[edited by - ALiENiD on August 6, 2003 7:59:16 AM]

[edited by - ALiENiD on August 6, 2003 7:59:34 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by petewood
quote:
Original post by Metus
the HAL.DLL in Win2K / WinXP is written in assemby...


just interested to know how you know that



Hehe... I did take a Win2K MCSE course a back later and there was a lot of cool things about the HAL and the design of the Win2k system in those books... =)

Share this post


Link to post
Share on other sites
Get some books on theory, download (and read) alot of those pdf''s you''ll find at OS sites'' like Nemesis, Roadrunner... Get the book that the other guy mentioned with MMURTL OS. Also get a book on UNIX internals, or download a book on linux internals... i had also found the source for linux ver .1 or 1.0 or something wasn''t that many files to look through and follow. You''ll also need some books on abstract hardware theory and PC (or whatever platform you want to make it for) hardware reference. (again you can find pdf''s around the web) Finally go here http://www.cs.utah.edu/flux/oskit/, it will help you put off dealing with some of the low levelstuff early on. I downloaded it a long time ago so i don''t know if its still free but that is how i remember it. Anyhow

Share this post


Link to post
Share on other sites