Quantcast

Maximum PC

It is currently Sun Apr 20, 2014 2:57 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Creating you own operating system
PostPosted: Tue Dec 21, 2004 5:00 pm 
7yrs+11,000 Posts
7yrs+11,000 Posts
User avatar

Joined: Tue Jul 27, 2004 5:44 pm
Posts: 11242
Location: The kitten above is not on fire.
How is it done. And is it even possible?


Top
  Profile  
 
 Post subject: Re: Creating you own operating system
PostPosted: Tue Dec 21, 2004 5:05 pm 
I'd rather be modding!
I'd rather be modding!
User avatar

Joined: Fri Jun 25, 2004 3:47 pm
Posts: 3731
Location: Las Vegas
gamerfreak wrote:
How is it done. And is it even possible?


Its possible, but you would have to be a geek to the nines.

There are books on the subject. The problem is that you have to start very low level code wise - you have to talk to the chip, and thats not easy. You gotta know things only the king of geeks wants to know.

Manta


Top
  Profile  
 
 Post subject:
PostPosted: Tue Dec 21, 2004 5:17 pm 
Team Member Top 100
Team Member Top 100

Joined: Fri Sep 17, 2004 5:35 pm
Posts: 1176
First, create a bootloader. This must be done in pure assembly -- no C yet. It has to go on the master boot record. You can call code from other sectors, but you must have the beginning code there.

Then, you can create a compiler (if you create your own executable format), or use GCC if you want to use ELF. Once you have a compiler and linker working, create a kernel. This will handle all the OS functions: memory management, drivers, multitasking (optional, but not so optional these days), etc. This can (and should!) be made in C (so you should have a compiler ;)). Now you need to build the other parts of the OS: graphics libraries, drivers for hardware, etc.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 8:10 am 
Little Foot
Little Foot

Joined: Wed Nov 10, 2004 7:28 am
Posts: 155
Thats interesting I thought that the majority of the OS was programmed in assembly not C.


Top
  Profile  
 
 Post subject: Re: Creating you own operating system
PostPosted: Wed Dec 22, 2004 11:47 am 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24218
Location: Granite Heaven
gamerfreak wrote:
How is it done. And is it even possible?


Several people have done it.

Read a book. I'm sorry if this sound patronising, but creating an OS is one of the most complicated tasks a programmer can undertake. There are so many issues, concepts, and problems to address before you can even begin, that a solid grounding in CS and OS fundamentals is an absolute must.

For a single person, to create a 'modern' multimedia capable OS from scratch, is several lifetimes of work.


Top
  Profile  
 
 Post subject: Re: Creating you own operating system
PostPosted: Wed Dec 22, 2004 12:55 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
gamerfreak wrote:
How is it done. And is it even possible?


It's possible, considering that we're typing this on an OS of some sort.

Here's a link for you:

http://mega-tokyo.com/osfaq2/

In essence, you need to have your code be able to talk to the hardware directly. First you have to sit down and write the bootloader in Assembly (x86 is very tricky, BTW. x86 launches stuff in 16-bit protected mode then you somehow have to convert over to 32-bit if you want to write for a 32-bit OS). Then you have to design a kernel, now, whether or not you want to use a monolithic design, a microkernel design, or an exokernel. Each have their own advantages, monolithic being the easiest to design but old and moldy, microkernels being middle of the road, and exokernels which give you pure performance at the expense of not using a HAL (Hardware Abstraction Layer).

There are thousands of things to do, heck, even Linus didn't write all of Linux. He just wrote what he needed to write, and let the rest of the people handle the work for him. Don't foget, you also need to have a shell to interface with the kernel for you.


Top
  Profile  
 
 Post subject: Re: Creating you own operating system
PostPosted: Wed Dec 22, 2004 1:09 pm 
I'd rather be modding!
I'd rather be modding!
User avatar

Joined: Fri Jun 25, 2004 3:47 pm
Posts: 3731
Location: Las Vegas
DJSPIN80 wrote:

Here's a link for you:

http://mega-tokyo.com/osfaq2/



Kewl Site DJ,

Thanx - that will keep gamer busy for a while (and me too if I am not careful).

On another note:
I just found a book on my shelf - Assembler for the IBM PC and PC-XT, by Peter Abel (1984). Its amazing what you find when you are moving. I am sure I never read it - can't fathom why I have it.


Manta

Merry Holidays All


Top
  Profile  
 
 Post subject: Re: Creating you own operating system
PostPosted: Wed Dec 22, 2004 2:28 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
w00t! Thanx!

I still have my IA-32 Assembly book, but no time to read it though.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 3:18 pm 
7yrs+11,000 Posts
7yrs+11,000 Posts
User avatar

Joined: Tue Jul 27, 2004 5:44 pm
Posts: 11242
Location: The kitten above is not on fire.
So where those long hours of reading c++ books a waste to amke a os? :? Anywaze to start off i wanna make a really really simple os. ONe that is all text based and just has a text editor and maybe a telnet client. I will progress from there. Thanks for the link, and i will buy those books from you depneding on how OOD they are. Thanks,

gamer


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 3:34 pm 
Team Member Top 100
Team Member Top 100

Joined: Fri Sep 17, 2004 5:35 pm
Posts: 1176
Then you should do everything except make a graphics library and a few drivers.

You can use standard int 10h for graphics.

For a telnet client you will need to create a driver for the NIC card you use and you must create a sockets implementation .

You must manage memory and support multitasking.

Unless you plan on using a different file format, plan on making your own loader and compiler, too.

Making an operating system, even that simple, is no easy task.


I suggest modifying Linux code instead of creating a new OS from scratch.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 5:07 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
gamerfreak wrote:
So where those long hours of reading c++ books a waste to amke a os? :? Anywaze to start off i wanna make a really really simple os. ONe that is all text based and just has a text editor and maybe a telnet client. I will progress from there. Thanks for the link, and i will buy those books from you depneding on how OOD they are. Thanks,

gamer


No, it's not wasted. C++ has its place in OS Design, but so does Assembly and whatnow. You can't expect to build a house with just a hammer, you use a multitude of tools to get the job done, the same applies with making your own OS. That's just the way things are, so expect it.

BTW, a friend of mine is writing his own OS for fun. So far, Assembly's pissing him off, and even something as simple as opening a socket and sending messages to a static address is a difficult and long process. So be prepared to be stuck at home for a long time.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 6:42 pm 
Team Member Top 100
Team Member Top 100

Joined: Fri Sep 17, 2004 5:35 pm
Posts: 1176
Quote:

BTW, a friend of mine is writing his own OS for fun. So far, Assembly's pissing him off, and even something as simple as opening a socket and sending messages to a static address is a difficult and long process. So be prepared to be stuck at home for a long time.

http://cboard.cprogramming.com/showthread.php?t=59720


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 7:30 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Kybo_Ren wrote:
Quote:

BTW, a friend of mine is writing his own OS for fun. So far, Assembly's pissing him off, and even something as simple as opening a socket and sending messages to a static address is a difficult and long process. So be prepared to be stuck at home for a long time.

http://cboard.cprogramming.com/showthread.php?t=59720


Thanks...but he was going to use C for sockets, he's using Assembly to write the bootloader. I should have been more specific. :P


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 9:20 pm 
Team Member Top 100
Team Member Top 100

Joined: Fri Sep 17, 2004 5:35 pm
Posts: 1176
No, he was going to use assembly, but then people told him he could do it in C ;)


Top
  Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 9:38 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Kybo_Ren wrote:
No, he was going to use assembly, but then people told him he could do it in C ;)



:lol: yeah, it does hold some truth...more like half-truths. :D


Top
  Profile  
 
 Post subject:
PostPosted: Thu Dec 23, 2004 3:06 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
gamerfreak wrote:
So where those long hours of reading c++ books a waste to amke a os? :? Anywaze to start off i wanna make a really really simple os. ONe that is all text based and just has a text editor and maybe a telnet client. I will progress from there. Thanks for the link, and i will buy those books from you depneding on how OOD they are. Thanks,

gamer

Gamerfreak,

I wouldn't want to discourage anyone from attempting a programming project, but you're definitely jumping way out on a limb with this project. Why not write a couple of simple games first and then move on to maybe a compiler and finally an OS instead?


Top
  Profile  
 
 Post subject:
PostPosted: Thu Dec 23, 2004 3:07 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
SirBob1701 wrote:
Thats interesting I thought that the majority of the OS was programmed in assembly not C.

A lot of people think that about OS, games, etc. It isn't true - and hasn't been true for a long time now.


Top
  Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 1:54 am 
Little Foot
Little Foot

Joined: Thu Dec 23, 2004 12:54 pm
Posts: 150
I think everyone forgot to mention that you need to develop your own filesystem as well. Perhaps an easy way to make your own operating system is to just take the core of Linux and modify it to your desire. The source code is all out there, and there's probably nothing about that core that you wouldn't want, anyway.


Top
  Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 8:15 am 
In the lab!
In the lab!
User avatar

Joined: Sun Jun 06, 2004 10:47 am
Posts: 831
Location: Secret Laboratory
Don't poo poo the man... he just asked a question...

Tell you what man! Everything you wanted to know on OS's and even some stuff you didn't!

http://dmoz.org/Computers/Software/Operating_Systems/

Read, read and oh yea! Read! ;)

check out the guides. There are several good Alternate OS lists with links to os projects. Many are GPLed so you can grab them and play with them. Look for small simple OSes like V2_OS (all done is ASM), SPIN (modular os designed at U of Utah) or NewOS (being designed by a former BeOS developer)

V2 is actually pretty cool. They have most of the hard work done so you're free to jump in and play around more... I've fiddled with early version a while back and what they had was pretty impressive.

NewOS is probabbly the most mature and "professional" it's being developed by a former BeOS programmer and he's creating a system very similar in design to what BeOS was. That's why the OpenBeOS project (now called Haiku) is helping with NewOS development in order to get a solid Kernel that will allow them to create a open source compatible version of BeOS... Fun stuff!


Top
  Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 8:21 am 
7yrs+11,000 Posts
7yrs+11,000 Posts
User avatar

Joined: Tue Jul 27, 2004 5:44 pm
Posts: 11242
Location: The kitten above is not on fire.
Gadget wrote:
gamerfreak wrote:
So where those long hours of reading c++ books a waste to amke a os? :? Anywaze to start off i wanna make a really really simple os. ONe that is all text based and just has a text editor and maybe a telnet client. I will progress from there. Thanks for the link, and i will buy those books from you depneding on how OOD they are. Thanks,

gamer

Gamerfreak,

I wouldn't want to discourage anyone from attempting a programming project, but you're definitely jumping way out on a limb with this project. Why not write a couple of simple games first and then move on to maybe a compiler and finally an OS instead?



I never said i would actually do it..........


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group