Page 1 of 1

Basic GUI

Posted: Sat Jan 12, 2013 8:15 am
by JamesParsons
I want to implement my OS with basic GUI. Since im not that good I need some help. If someone Could give me some basic code to start off with it would be great. All I want is too open a rectangle window w/ a smaller rectangle at the top with a title in it. also I would like a close box that can get rid of it. I know this is vague and not really helpful so here is an image example

Re: Basic GUI

Posted: Sat Jan 12, 2013 9:24 am
by iansjack
The Wiki has extensive information and links to information about video output and mouse input (to answer your other query). That's the best place to start. Google will also lead you to plenty of other information.

Re: Basic GUI

Posted: Sat Jan 12, 2013 11:40 am
by sortie
Making a GUI from scratch is hard. Hell, even creating a command line operating system from scratch takes a lot of effort. Stop! Don't think about these high level goals "And then you press here, then X happens!" and look at how the hardware really works. It's a lot of hard and fun programming to even get a basic OS with graphics up and running. Try look at the wiki for this community, all the hints you need are there.

Perhaps you'd be better off writing a Window Manager for X rather than an entire OS.

Re: Basic GUI

Posted: Thu Jan 17, 2013 8:56 pm
by SpyderTL
A full walkthrough to get a GUI up and running from scratch is a bit much for a forum post, but maybe I can set you up with some tasks to get you started.

1. Find a boot loader, or create your own.
2. Practice writing characters/text to video memory.
3. Use VESA to change your display mode.
4. Draw a horizontal line.
5. Draw a vertical line.
6. Draw a rectangle.
7. Fill a rectangle.
8. Read mouse input.
9. Draw a cross-hair mouse pointer.

Each one of these tasks will take you a day or two, and should be fairly straightforward to find more information on this site. If you get stuck, feel free to ask specific questions on this forum, and be sure to post some code. All of us started off exactly where you are, and there are plenty of people here that will be happy to help you out.

Good luck!