How to start it! (OS, 64 bit)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Msta
Posts: 6
Joined: Sat May 05, 2007 11:37 pm

How to start it! (OS, 64 bit)

Post by Msta »

hi, i am new to this forum i hope your guys can help me much as possible! :D

i am determined to make my own operating system!
(not windows, not mac, not linux, etc.) i want to make my own operating system i hope u guys cna help me :)

ok,

what do i need to get started?

the programs (i no i need a extra computer for test and modeling the OS)
i want to make an amd 64 (64bit)OS

i want it to be my own!

i am determined to make one please help me :D
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: How to start it! (OS, 64 bit)

Post by Candy »

Msta wrote:what do i need to get started?
To get started, you need a computer and an idea. To finish it, you need a lot of time and motivation.

In my case, I find that motivation can be created by having a goal that's reachable. Then, reach the goal and aim for the next. For starters, make a program that starts without operating system that says "hello world". That'll take you at least a week.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: How to start it! (OS, 64 bit)

Post by Brynet-Inc »

Candy wrote:For starters, make a program that starts without operating system that says "hello world". That'll take you at least a week.
Haha, Good one Candy.. :lol:

But seriously, People should "not" use OSDev as an excuse to learn a new language.. Try coding a few programs before thinking about designing and writing your own operating system..

(Disclaimer, By "few" I mean "lots 'n lots".. Invest a few years into learning..)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: How to start it! (OS, 64 bit)

Post by mathematician »

Candy wrote:For starters, make a program that starts without operating system that says "hello world". That'll take you at least a week.
If you know anything at all about the PC's architecture, poking the string "Hello World" into the video buffer is trivial. Try writing a boot sector, which loads a "kernel", which pokes the string "Hello world" into the video buffer.
oscoder
Member
Member
Posts: 59
Joined: Mon Mar 27, 2006 12:00 am
Location: UK

Post by oscoder »

If you know anything at all about the PC's architecture, poking the string "Hello World" into the video buffer is trivial. Try writing a boot sector, which loads a "kernel", which pokes the string "Hello world" into the video buffer.
Of course, the theory may be trivial, but the amount of hurdles the prospective osdever must overcome is surprisingly large - especially if they have not done much (any) system programming before.
User avatar
Msta
Posts: 6
Joined: Sat May 05, 2007 11:37 pm

motivation and image

Post by Msta »

my motivation is to beat bill gates is his world one OS i know it seens impossible but at am motivated enough

i have an image 3D desktop(like linux), built in webserver(like linux),4 screens at the bottom(like linus), i want to creat my own OS not a linux or a windows or a mac.

i wish to be the best and my firends will be trained to do other things :wink:

it needs to be the most andvance OS on the planet.
and i am trust your guys to lead me through my dream! :wink:

so what programs do i need to make this OS?
for a 64 bit?
C++ programing language i think?


thank you in advance!
User avatar
Msta
Posts: 6
Joined: Sat May 05, 2007 11:37 pm

o ya

Post by Msta »

o ya what do u mean hello world program?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Msta wrote:i have an image 3D desktop(like linux), built in webserver(like linux),4 screens at the bottom(like linus), i want to creat my own OS not a linux or a windows or a mac.
:lol: This is just sad.. someone break the news to him or her already.. It's just embarrassing..
Msta wrote:o ya what do u mean hello world program?
I think this is the perfect time for me to display a neat emoticon I found. {SNIP} (ROFL)

EDIT: Removed 2015: Imageshack replaced all links with spam.
Last edited by Brynet-Inc on Fri Aug 28, 2015 8:49 pm, edited 1 time in total.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

Could all permement residents of cloud nine please remember to take one of our free trips back to Realityville before attempting to post on the forums thankyou.
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: motivation and image

Post by mathematician »

Msta wrote:my motivation is to beat bill gates is his world one OS i know it seens impossible but at am motivated enough
How many million lines are there in Windows source code? You are going to wear out quite a few keyboards by the time you are done. And when you are done, in maybe forty years from now, Windows will be a long forgotten operating system belonging to yesteryear.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: o ya

Post by Brendan »

Hi,
Msta wrote:o ya what do u mean hello world program?
A "hello world" program is a program that displays the words "Hello world" on the screen. It's one of the first things most people write when they learn a new programming language.

For example, for C, it'd be something like:

Code: Select all

#include "stdio.h"

void main(void) {
    printf("Hello World\n");
}
The problem here is that the program is loaded into memory and run by an OS, and the compiler is typically designed (or configured) to create executables for the OS it's running on. For OS code there is no OS to do this, and the code needs to be designed to be started by the BIOS. This means you need to reconfigure your compiler to make it generate suitable code, but the BIOS expects to start 16-bit code and most modern compilers won't generate 16-bt code.

The next problem is that the "printf()" function just tells the compiler to send the string to "something else" (a terminal, a window, a video driver, etc). For an OS developer, "something else" doesn't exists until you write it.

Lastly, the C compiler uses standard libraries that talk to the OS (for things like memory management, timing, file I/O, etc). For an OS developer, these standard libraries aren't usually useful, and you either need to avoid using them or write your own.

If you add all this up, a "Hello World" program that takes 4 lines of simple code can easily become 100 lines of code, plus hassles with tools, linkers, etc.

The easiest way to write some "Hello World" boot code is to forget about the compiler completely, and hand code it in assembly language. For an example, I'd try something like this (for NASM):

Code: Select all

    org 0x7C00
    bits 16

    jmp 0x0000:START

    align 2

START:
    xor ax,ax
    mov bx,0xB800
    mov ds,ax
    mov es,bx
    cli
    mov ss,ax
    mov sp,START
    sti

    mov ax,0x0003
    int 0x10

    mov si,helloString
    xor di,di
    mov ah,0x0F
    lodsb
.l1:
    stosw
    lodsb
    test al,al
    jne .l1

    jmp $

helloString:   db 'Hello World',0

    times ($$-$+0x1fe) db 0x00
    dw 0xAA55
Of course after you've assembled it you'd need to find a way to install it somewhere. Floppy disks are a common choice (no-one likes messing up their hard drive). For this (on a Unix OS) I'd try something like "cat hello.bin > /dev/fd0". For Windows you'd need to download a utility like Rawrite.

Now that you've seen the code, how much of it do you understand? I wrote this in 5 minutes (and didn't bother testing it), but how many hours of research would you have needed to write something similar and make sure it actually worked?
Msta wrote:my motivation is to beat bill gates is his world one OS i know it seens impossible but at am motivated enough.
This wouldn't be very hard if Bill Gates wrote Windows....

Unfortunately Bill Gates and thousands of programmers wrote Windows, and I'd guess Bill actually didn't write any of it himself. It took Microsoft around 5 years to write Vista, but half the code came from earlier versions of Windows and the device drivers were probably written by hardware manufacturers. This means 1000 programmers for 40 hours a week wrote about half of Vista in 5 years. Assuming each programmer worked for 50 weeks per year, this works out to 1000 * 40 * 50 * 5 hours to write half of Vista, or 20000000 hours to write all of it.

If you worked for 60 hours per week 52 weeks per year, then it'd take you about 6410 years. For a new OS there's no compatability hassles with old software (like getting applications designed for Windows XP to run under Vista), and you could probably cut a few corners and get it done in 5000 years. If your friends help you then it might take less time, but then you might waste a lot of time explaining what needs to happen and it might take longer...

Of course Microsoft has a variety of programmers with different knowledge - some know a lot about memory management, some know about file systems, schedulers, GUIs, etc. This means you'd need to become a specialist in every different area to get the same work done in the same number of hours. Also the time Microsoft took doesn't include learning any of it (almost all of the programmers had training and experience before they started working on Vista).

Also, Microsoft have facilities for testing the OS on a wide variety of hardware to make sure it all actually does work (and there's no annoying compatability problems). You'd need to do that yourself too...

Lastly, Microsoft has enough finances to do this sort of thing. If you're spending 60 hours a week every week, then you won't have time to work, won't be able to pay for internet access, electricity, food, rent, etc. At the moment you might be lucky enough to be living at home with your parents, but sometime in the next few thousand years they'll probably expect you to leave home and get a job. You won't be able to work on the OS for 60 hours every week for very long.

Linux is different, but not much. It's taken about 20 years to go from a half-baked Unix clone into what you see today, and most of it has been written by thousands of different volunteers and large companies (like IBM, Redhat, Intel, etc). A lot of the code is portable code that is recycled for several different Unix clones (Solaris, FreeBSD, OpenBSD, etc), and some of it probably even dates back to before Linux (the kernel) even existed.

Now I know I'm not being fair - there are people here who are hoping to eventually produce a commercial quality OS (including myself). The general idea is to produce enough of the kernel and framework to allow other programmers to easily write code for your OS (device drivers, applications, etc), and to make sure that the work you do is extremely impressive (and well documented) so that other programmers would actually want to write code for your OS. So far I've spent over ten years, and I'm expecting to spend another 10 years before anyone thinks it's impressive... ;)
Msta wrote:so what programs do i need to make this OS?
for a 64 bit?
C++ programing language i think?
The most common combination is C with a little assembly language for the kernel and boot code. It's not the only combination of languages that could be used though - mostly it depends on what you're familiar with (although a little assembly language is required)...


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Post by mathematician »

If it is up against well established competitors the first thing a commercial quality operating system (or anything else) has got to find is a niche market. There has to be a convincing answer to the question "Why should I buy your OS in preference to Windows or Linux?" and the answer would probably have to be, "Because it was designed specifically to meet the specailised needs of somebody such as yourself, and in a way that a general purpose OS simply can't do."
User avatar
Msta
Posts: 6
Joined: Sat May 05, 2007 11:37 pm

thankyou so much!!

Post by Msta »

damn thankyou
i will get back to u guys on htis post if i did it :D
thankyou so much
User avatar
Msta
Posts: 6
Joined: Sat May 05, 2007 11:37 pm

Post by Msta »

where do i post my code is the a C++ program to do this or do i do it on notepad?

(if there are some C++ programs code u give ma a list[i no is it s langauge but is it a modeling program to make the language?])

i am confused...... :?:

Thank you in advance
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

You can write the code in whatever editor you want as long as it saves to just plain ASCII. After writing the code, it is then fed to the compiler, or the program that turns C++ code into a machine readable language.

As for an IDE, Dev-C++ is nice for Windows, or I also hear Notepad++ is good. (Never used it myself. Take with caution. Linux and all.)

Nota bene, that one should know how to program in his\her language of choice well if wanting to write an operating system. As said above, it's no trivial task. Write a few programs first. A game, editor, whatever. Maybe even help out with a preexisting project. (Linux, maybe?)

Hope it helps...
C8H10N4O2 | #446691 | Trust the nodes.
Post Reply