English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to create my own Operating System

I want to know like tutorials, Freeware (No shareware, trials, badware), and other freebies to get me started to create my own Operating System.

PS and please just answers and no "You can't beat bill gates" or "theres allready linux" and just give answers.

2006-07-20 14:24:20 · 14 answers · asked by BtAlex 1 in Computers & Internet Programming & Design

14 answers

There are no tutorials. This kind of stuff is classified, although you can ready through the code for Linux and see how they did it.

First, you've get the information on BIOS and the CPU you are using. If you don't stay "generic" (i.e. follow the 86 motiff of the PC) then your program will ONLY work on the same or similar or upgrade processrors.

In other words, if you program for a 64 bit, dual core Intel it may not work on a P3.

You have to understand start up procedures.

You probably will have to build some of the code in Assembler or Machine Level, but it might be possilbe to do it in C++ Not really sure.

The operating system gets linked to the "boot up" mark on the hard drive. You need to write a small program in machine language that lets the user choose between your system and say Windows or Linux.

They choose yours, the boot up sector then directs the system to your OS.

Your OS has to work with BIOS and the CPU to run a check of equipment, memory, etc.

Then youre OS has to create a "virtual machine"

The OS kernel can be very small. DOS is 64KB in the raw, but it added other things such as memory manager so it oculd count further.

This is why you have to decide if you're going with the 16/18 bit PC motif, the 32 bit Windows XP and2000 Motiff or the 64 bit Vista Motiff.

If you go with 32 bits you are going to have to design systems to see further than 4.2 GB of memory or hard drive space. That's the highest 32 bits can count.

Now you are into the problems of Windoes 98 and ME, teaching it how to work with a 100 GB hard drive in a single slice!

Worse, 98 is still perched on 64 KB DOS which can't see above 640,000 bytes!

So they have to create programs to help DOS see 100 GB of hard drive and talk to Windows about this, which is why windows locks up and crashes so much!

So, for simplcity sake lets say you build this using the 32 bit bus of the standard Pentium chip, which has been around since 1996 and will still work with the dual core and probably most or some AMD and Cyrix chipsets

Now, you have to decide if you are going to use a loop to poll the system (through BIOS) for things.

DOS and Windows use an IRQ system that polls the ports and slots of the system looking for a change. A volatage value, held in BIOS, more than likely.

You poll: Keyboard, mouse, monitor, port (nic card), port (AGP video card), port (USB1), port (USB2), AT100 A, AT100 B, ATAPI (CD Rom), and you look for a change.

This is done with a WHILE WEND type of loop or on ON SUB type of loop.

You have to design this loop yourself and this is the traffic cop that controls input and output. It is the router for data. It is the Token Ring for your computer.

You're sending out a token and it's looking for a bit waiting at one of the stations.

BIOS is the switcher that connects everything to the CPU, the OS works with the CPU and BIOS to send and receive data.

PCs have 16 firmware interrupts which can be used for more areas by assigning ports via the OS and CPU. This way one physical interrupt can be used to service both USB ports, the Firewire Port and the PRinter port, as an example.

The Windows motiff was a series of virtual interupts through DOS, 33H, for example, was the mouse

If your system called for INT33H dedidicated registeres sat and waited for data or got data from the BIOS interrupt that handled the mouse. This data you get back is the Y and X postion and button states.

If you moved your mouse a BIOS interrupt sends a new set of data, the DOS virtual interrupt ONLY sees this data if it's in your ON SUB loop.

When an area in your loop comes up to check the mouse, INT33H is polled asking for the current position and state and if it has changed from the last polling then this updated information is sent back to the DOS loop, which sends thid data to a Windows API library call, which sends this data to the OS, which makes this data available to the software. THE OS, then sends data back to DOS to active the pointer blitter for the mouse, which is an interrupt for the monitor screen to erase and area and re-write it in a new position.

The mouse then moves on the screen.

It takes a fraction of a second and maybe 100 or 200 lines of code just to make this one move possible.

In the old days the SOFTWARE programmer had to work directly with the mouse, starting with Windows 95 WINDOWS automatically keeps track of the mouse at all times and puts the cursor over everything in the windows, even a piece of software YOU wrote. And if you used legal element, such as a Text Box obejct, when the mouse moves over that object the pointer changes to an up and down line. The programmers USED to have to do this themselve. Now the OS does it.

So, you are going to have to get documentation on the CPU and BIOS, decided WHICH reigsters you are going to use for the OS

You have to know what to do after BIOS has finished startup and the hard drive is now looking for a bootable sector.

That boot sector is what starts your OS

Your OS has to make the virtual world. The desktop. The ICONS, the pictures.

Or at least say:

ok>

At the top of the screen like DOS and CPM did!

Then you hae to decide how to make programs work. Programmers are not going to change how they work.

They expect to communicate with the OS via objects, so you will need to make your OS comform to standard requests made by C and C++ programs.

When a program is run, the OS makes teh virtual world. The Window, the scroll bars, the title space (the programmers fill these in and work with them) and the OS must then understand the OBJECTS or text commands that are used by the programmer.

The OS must set the world up as per the programmers specifications.

Then the program must communicate with the OS, which relays this to BIOS and CPU, which relays it to devices.

This is traditionally done through a "header file" that is attached to the software during the complation process. Of course you will need to write that ourself as well as the C compiler routine for your OS. This means you need documentation on C and C++ for the compiler and linkers.

You will have to build some YOUR OS libraries that are included with the C programs.

C are generic programs and the LINUX and WINDOWS and MAC and AMIGA and ATARI ST libraries are added at compile time and then conform the software to those specifications.

Windows gets EXE or COM programs

Atari ST gets TOS and GEM

These library link up the generic software to the header files so that when a user clicks on your icon your OS starts taking the code apart and building the virutal world as dictated by the software programmer.

Word for YOUROS should run in a similar manner to WORD for Windows or Word for Mac.

There are alternatives. YOu don't have to use a loop to poll the system if you can think of a better alternative, such as maybe using a C language STRUCT.

Yu also have to think outside the patents and copyrights laws!

YOu can't make your windows look like a Mac, Microsoft, Commodore or Atari window!

Probably the best intial bet is a single tasking OS, one that handles one program at a time, like Atari and Mac did in the begining.

Your then have to put all this code into both RAM and DISK memory and keep track if it via what both Mac and PC and Atari called "handles" (fixed areas of the OS that keep track of the world).

The OS has to have a file management system so the user doesn't accidentlally write over the OS or SWAP files on hard disk!

The file management system has to be able to deal with fragmented files as the user adds data to the file a year later.

Have fun!

2006-07-20 15:06:17 · answer #1 · answered by Anonymous · 0 0

Creating your own operating system would be like inventing a loaf of bread. It has already been done. In the world of operating systems there have been only three winners: Windows,
Mac, and Linux and its incarnations. If you want your own OP, then that's cool, but it would be a highly introverted aversion. By the way, Gates, Linux, and Jobs did not use tutorials. If you still want to chase windmills, I would suggest you look at every OP ever invented. For instance, OS2, Be, Slackware, Windows 3.1, and DOS.

2006-07-20 14:37:22 · answer #2 · answered by Carrowaugh 1 · 0 0

Well...two obvious freely examples are BSD and Linux...but it takes a LOT of knowledge to create your own OS. There should be books available that describe that basics of processes, sub-processes, Table Lookahead Buffers...but there isn't anything like a tutorial that I know of. The problem you're going to run into is actually using the OS with also implementing C library and compiler...how are you going to create applications for the OS...or will you just somehow be compatible with GLibC?

Lots to do here...that's why there aren't a whole lot of OS' out there...most are just variants of one of the big 4: Win32, System V, Linux and BSD. (course there is VxWorks...OS/2 Warp and others...but they aren't as prominent in the public eye).

2006-07-20 14:31:14 · answer #3 · answered by Brian S 2 · 0 0

There's a reason why there are only a few operating system available. You have to know how to code the whole system from scratch. Better start signing up for classes and saving up A LOT of money.

2006-07-20 14:31:07 · answer #4 · answered by Anonymous · 0 0

I recommend you become proficient in C and Assembly (I don't mean take a couple credit hours in each or read a few books, I mean work in those languages day and night). Then download and examine every line of the Linux kernel, to see how it works. Then, if you feel like you absolutely can't stand to use a pre-existing kernel, start hacking away at your hardware with your own code.

2006-07-20 15:32:48 · answer #5 · answered by John J 6 · 0 0

Why don't you start with something a little easier like LFS and then work up to writing your own operating system after that?

LFS (Linux from Scratch) is a system to build your own operating system from source code. It will probably teach you a lot of things and help you save time when you write your own OS.

Check it out:

2006-07-20 15:16:01 · answer #6 · answered by linuxfortravelers 3 · 0 0

well man..you have a long way to go, you can't learn to code an operating system in a tutorial, you need to take some coding classes like Visual Basic & C++.. but either way it will take years a lot of them.

~matt

2006-07-20 14:28:59 · answer #7 · answered by ? 3 · 0 0

perform a google search for

create operating system

it provides a great deal of information

you can check out this site.

http://www.acm.uiuc.edu/sigops/

there are few old books on machine language that may help perform a search for it.

2006-07-20 14:44:54 · answer #8 · answered by playing 3 · 0 0

you got to be kidding, if you were as good a programmer as to build your own operating system you wouldn't be asking questions in yahoo. Dude, you got a lot to learn!

2006-07-20 14:45:45 · answer #9 · answered by D. Nelson Altamirano 2 · 0 0

You can't. Not by yourself, and not without years of experience and education in programming. If you're not considering programming as a career choice, you can't do it.

2016-03-27 01:30:03 · answer #10 · answered by Anonymous · 0 0

fedest.com, questions and answers