Question:
Operating System please help People?
2009-05-09 06:32:46 UTC
Ok so i know this is a big task! That cannot be completed within a year or even 10years. Also i know that theres source codes out there that can be used. But i am determined to do this. I want to create my own operating system. I've done a fair bit of research on it. I will start to learn assembly and c++ very soon.
But i just wanted to know once i have a knowledge of these languages where would i go from there to create my own operating system?
I understand i have to create a kernel and understand all the hardware.
I just need a tutorial or a kick in the right direction.
please someone help me out.
I just need to know what to create first.
Ten answers:
ferg400
2009-05-09 07:30:47 UTC
Sorry to be a party pooper, but you are aiming way too high there guy.



You haven't even begun to learn to program. It's a good goal, but you need to study for a while first, start at the bottom.



I suggest your next step on the way to writing your own OS should be to enrol in some serious classes.
Bob M
2009-05-09 07:09:55 UTC
There are two ways, both none destructive to your current OS.



The first you can do in any language.



You can start simply by writting an application within your current OS. All you do is interface between the user and the outside world (in this case the computer OS) as you would with any application.



You can even create your own filesystem within this, create and claim a file of some size with a structure of your own making, then create a structure that represents sectors for your own file system, for example -



struct

{

//various descriptors for this sector or user file

unsigned long sectorID;

//these next few would be better as bits,

//written as bool so VB users understand better

bool deleted;

bool dataSize;

unsigned long nextSectorID

struct

{

char* sectorData;

}

}



The second none destructive way is to work within a virtual machine (inside VirtualBox or VMWare). From a blank machine would be difficult until you get quite a bit further in your studies. But you can start at a halfway house.



You can load a bare minimum Debian, you can actually do this through a Internet install, calling in the absolute minimum the OS requires. It is quick and easy. It then gives you a nice cosy place to test your own OS ideas. You are kept within the safety net of the VM, so you can have a break and relax on your PC knowing you can not do any damage.
karljj1
2009-05-09 07:39:07 UTC
You say that you don't know C++ or assembly yet, to aim at creating a new OS before you have even learnt to program is a HUGE jump. Your trying to run before you can walk. Start small and work your way up. Being able to program is only half the problem, understanding how to design something like an OS takes a lot of experience.
?
2016-05-28 14:40:22 UTC
I'd first of all suggest that unless you want to run more than one OS on a computer, don't take advice from anyone who is doing that. Those people are nerds and geeks and they live for doing this stuff just because it's there to do, rather than any real world need. I count myself as one of those geeks but I haven't run multiple OS's for some years now. I'm all about how much screen real estate I can get for just one OS that's set up well to work for me. I don't really see distinction between OS X and Windows 7. They are both top notch OS's. Windows gives you access to more games and a wider net of specialist software but OS X is starting to catch the developers for some gaming now and most obvious tasks are taken care of in software choice. So it really comes down to look and feel. OS X looks about the same as Windows 7 in use but when it comes to the software, OS X pulls ahead. Developing for Apple seems to force programmers into a stricter rule set for how the software looks. Gone are horribly ugly icons you'll see everywhere in Windows and gone too are the old fashioned looking applications that aren't hip to the new style guidelines Windows casually sets out. Apple also take a very active role in making sure a great set of common software applications are all available practically with the OS or at very little cost extra to handle word processing, photo management, video editing, music collecting and so on. Windows has all that software too it just doesn't package it as nicely for new users to get at easily. For instance with Windows you have to go and manually download the live pack to get access to some software which should really already be in the OS to begin with. And if it sounds like I'm picking at Microsoft, I am a bit but overall that's still my choice in OS's. Windows 7 64bit gets my vote. So in brief, OS X = pretty and good, Windows = pretty good
2009-05-09 06:39:03 UTC
I suggest looking at simple, open source operating system and learn from them. If you don't have much programming experience or don't know C++ and ASM at all yet, you'll have to study those intensively for some time before you can even consider creating an operating system. After you know the languages well, making a basic OS is not really that hard.
ali_nakisaee
2009-05-09 08:56:02 UTC
You are about to perform a hard task.BUT it can be done.

Making operating system is hard until the boot part. After that you may create a platform to write your programs with.

As once I wanted to make an OS like you, I did some practice.

Do some research in WikiPedia.



First, you need to debug your program but how? You can not restart your computer to test it. It takes a long time. Also there is a risk for your computer and maybe the hardware. Because you are in real-mode of CPU (real-mode and protected-mode are modes of running code on CPU - for example, Windows runs program in protected mode and DOS in real mode) the hardware is in danger. Because in real mode there is no control on your program - there is no operating system on your operating system-. So you may CRASH your hardware.



So you need a Virtual Machine application, like Microsoft Virtual PC.

MS VPC is a free software. You can download it at:

"http://www.microsoft.com/downloads/details.aspx?FamilyID=28c97d22-6eb8-4a09-a7f7-f6c7a1f000b5&displaylang=en"

Then you can create a virtual PC



Second. Your operating system must be on a specific storage. Floppy disk, Hard disk or CD/DVD. Anyway as you don't use YOUR computer to test the OS and you use a virtual machine, it is so easier. You assign a storage image. Also you can use a real disk (only for floppy disk and CD). But I think that you can you a floppy disk image that is EXCATLY 1.44 MB (1,474,560 byte) or 720 KB (half of it).

You can easily write a C++ program to make an image file. It is faster than writing on a floppy disk.

Anyway, using floppy disk IMAGE is easier. Just use the VirtualMachine to make an image.

Note that usually HardDisk images should have header. (At the ending or the starting point of the file.)



Third. You need to do some research about this part but I tell some important matters of it. You need an assembler (like turbo assembler) that can write codes for old systems (I mean it is for DOS programming). Then you can use a linker (like turbo linker) to

make COM files. You should know them. They are files like EXEs except that they are pure and each byte of them can be an instruction for CPU. I found a pack for turbo assembler with some examples at

"http://pratik.tambe.googlepages.com/TASM.zip"

The TASM.exe file is the assembler and the TLINK.exe file is the linker. Also you can use TD.EXE for debugging.



NOTE: These files are 16-Bit and cannot be run on 64-Bit versions of Windows. You may install a 32 Bit version or use a DOS floppy disk or create a secondary VirtualMachine with your VirtualMachine program and install a 32Bit OS or DOS on the VM. (one VM for your OS and one VM for the assembler. You can create the image disk on one VM and then copy the image to the other VM - see instructions with your VirtualMachine program)



After linking you should insert the file in your disk image file. With a simple C++ program you can address it. Read the COM file(s), put them in an image file and fill the remaining space with empty characters. You will have a file with 1,474,560 bytes.



Third. Assembly. You should know the needed things for writing assembly programs. Using interrupts (see wikipedia) and else.

You should know how to access the disk without using drivers.



Fourth. Boot. Each disk has some sectors and the first sector is called a Boot sector. It doesn't matter so much that what is the size of the sector. Usually, hard disks have 8192 byte sectors and floppy disks have 512 byte sectors. In any situation the FIRST BYTES of the sector should be CPU instructions. In NTFS or FAT file system, the first bytes include a JUMP instruction. Some bytes after it are information about the disk that are not executable. The jump instruction jumps the CPU instruction pointer (IP) after this information and it continues to boot.

The 511th byte should be 0x55 (85 in decimal) and the 512th byte should be 0xAA (170). These two markers indicated that the disk is bootable and BIOS loads it. So the first program with all the information should be less than 511 bytes. There should be a COM file in the first part of the disk that the first bytes are instructions.

Now your simple C++ program changes as follows:

Copy the BOOT.COM file

Insert enough NULL characters to be 510 byte.

Put 0x55 , 0xAA

Put other parts of disk

Put enough NULL characters to be 1,474,560 bytes. (Or any other size)

Put the header if the disk is not a floppy disk (It is for your VirtualMachine, it should not be really on a real hard disk - Some VM Programs need the header at the starting point.)





FIFTH. Hardware. The most important aspect of an OS is contacting with hardware. OS uses in and out assembly instructions to communicate with hardware. The drivers an HAL.DLL in windows are intended for this. Also a good OS should switch to protected mode (PM) to run multiple programs (multi tasking). Also PM applies many security things to the client apps.

See wikipedia for
J.M.F.
2009-05-09 06:38:04 UTC
Read "Modern Operating Systems" by Tanenbaum. While reading through that you'll want to pick up relevant books to go into depth in the areas you need. You'll probably end up picking up a book or two on algorithms and Computer Architecture. Your biggest challenge will be understanding how to make best use of the hardware - it's extremely complicated. Tanenbaum lists all his references meticulously so it's a very good book to start you in the right direction.



You could probably write a basic operating system in say 6 months if you knew what you were doing and what exactly you wanted to achieve, but it would be extremely basic :-)



Why the thumbs down?? This place drives me crazy why do I bother!!
vulcan
2009-05-09 06:39:47 UTC
Below is a good resource site with many examples. Also cruise the university research sites. The forums related to your interest. Mostly you have a research task on your hands. Keep in mind that Pascal has been used for construction of many operating systems. Enjoy the project it is worth doing
2009-05-09 06:37:01 UTC
You asked this question yesterday. Just learn C and assembly, then consider writing an OS.
2009-05-09 06:37:18 UTC
You can create an os in less than a year. It wount be as pretty as macintosh or linux but it'll work.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...