How do I make my own graphical operating system from scratch?

46d18dc92ae7cd35698347bd4b97f0fb
0
andyharglesis 101 Jan 15, 2012 at 06:02

I want to start small, like command-line DOS, or maybe make a DOS-like operating system my overall goal.

Where do I begin?

I am kind of “off” with Assembly, but no tutorials help me out.

I heard mostly operating system’s are developed in high-level languages, but some parts must be in low-level Assembly.

Care to help me out here? I might just be the next Steve Jobs. ;)

I mean I know all the parts that make up the OS and I know programming, but I have no idea how to “put it all together” and get it to boot from another drive on my PC.

Anything will help! Thanks in advance! :)

6 Replies

Please log in or register to post a reply.

Ceee4d1295c32a0c1c08a9eae8c9459d
0
v71 105 Jan 15, 2012 at 12:47

What do you mean for your own graphical operating system ? something like windows ?
I suppose you want to do it for your own personal satisfaction, ok, i’d follow this route
first : low level access to graphic device , write and read in a ‘graphic buffer’ in different resolutions.
second : create fast graphic routines : pixel plotting, line, rectangles , ellipses ( for drawing circle under different x/y screen ratio )
third: font rendering ( in my experience this is a real pain in the a** ) , because you have to compute text metrics, word wrapping,
text scrolling, and scissoring.
forth: window handling , basically rectangles where you can draw in , borders, layouts ( i had already done and its another pain in the a** )
fifth: input handling, mouse, keyboard ( low level interrupt )
sixth: low level disk access ( semaphores , multiple files opened )

you may want to start in a different order, but this is the minimal build for a OS , 1.5 years ago i started writing an opengl gui and i had
to work out many of those different problems, so talking about the graphic side,it was a very intensive task.
Good luck, if you need some graphic algorithms, like word wrapping and such , let me know.

6aa952514ff4e5439df1e9e6d337b864
0
roel 101 Jan 15, 2012 at 14:59

That’s an insane amount of work. Forget it.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 Jan 15, 2012 at 17:50

Read through the Linux of Free BSD source code a few times until you fell like you understand it, then churn out some code and see where you end up.

You should talk to the creator of Losethos too. I have a feeling you two will get along just fine.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Jan 16, 2012 at 11:17

Having done this exact thing, with a twist (we had to do hardware independence as well), I echo roel’s comment.

Forget it.

The display code alone was several years work, macros to translate from this pixel format to that, macros to alpha blend every pixel format under the sun with every other pixel format, etc. etc. etc.

That’s without even thinking about the low level stuff, device drivers for how many bits of random hardware ?

If you are really serious about doing this, then start with creating a framework that allows you to render to multiple pixel formats, then start writing all the horizontal line draws you need. You will need a matrix of these

Fill mode Blend mode Depth buffer Pixel depth
Colour None On 8 palette
Texture Alpha Off 8 grey
16 1555
16 565
16 4444
24 packed
24 unpacked
32

So that’s 256 hline routines for a start

Just forget it.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 Jan 16, 2012 at 12:44

> macros to translate from this pixel format to that, macros to alpha blend every pixel format under the sun with every other pixel format, etc.

Wouldn’t it be a better idea to just port SDL to your OS?

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Jan 16, 2012 at 15:06

@Enthusiastic for Sense

I want to start small, like command-line DOS, or maybe make a DOS-like operating system my overall goal. Where do I begin?

http://wiki.osdev.org/Main_Page

Also, I would recommend reading a good OS book, if only to prevent you from making the same mistakes others have made. (Of course, being a multi-award winner in algorithms, I’m surprised you even ask for help.)

http://www.amazon.co…m/dp/0136006639
@Enthusiastic for Sense

Care to help me out here? I might just be the next Steve Jobs. ;)

Sure. You certainly have the primadonna attitude already firmly in place… ;)

PS: I’m wondering if LoseTheOS will stumble into this thread…