OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 5:02 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Why do they say it takes years to make a GUI?
PostPosted: Tue Jan 10, 2017 9:24 am 
Offline
Member
Member

Joined: Thu Oct 13, 2016 2:07 pm
Posts: 27
Hello.

Why do people say that it will take years to create your own GUI? It sounds quite stupid to be honest. It will only take a few months if you know what to do with programming and if you type fast.

Voice control will take years. You can make a simple GUI in a few weeks by changing background and foreground colors (colours), adding a few buttons and things.


Top
 Profile  
 
 Post subject: Re: Why do they say it takes years to make a GUI?
PostPosted: Tue Jan 10, 2017 9:26 am 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
I made a window manager in a week and a widget library in three days. It doesn't take long if you design it well and know what you're doing.

_________________
You know your OS is advanced when you stop using the Intel programming guide as a reference.


Top
 Profile  
 
 Post subject: Re: Why do they say it takes years to make a GUI?
PostPosted: Tue Jan 10, 2017 5:57 pm 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1584
andrewthompson555 wrote:
Why do people say that it will take years to create your own GUI?

Because you'll need a lot of things before you can even think about writing a GUI.

First: you need a working bootloader, a kernel, device drivers for keyboard and mouse. That implies enabling IRQs, issuing EOIs, IDT etc. Most people can't finish with this in months, not in weeks. Once you got all of that, you're still lightyears away. How would you implement that GUI? Trivial solutions tend to be the wrong:

Simplest: GUI in kernel with minimal look out. Attempting, but very in-efficient. Your applications would "freeze" as you move windows by, just like in XP. No icons, or just statically linked pixel maps. As all of your drawing done in supervisor mode one simple bug in line drawing routine would crash your whole system. You'll gonna need working system calls so that applications can say "open a window for me please".

Bit more advanced: Loading resources (like icons and fonts) from file. You'll need a working filesystem for that. A big dependency. Separated memory for each window instead of drawing directly to the frame buffer. That implies a way of coping big amounts of memory quickly (effective blitting). You'll have to take overlapping windows account, calculate intersections, etc. so you need a window manager or compositor.

Move along, be safe: moving all the libraries to userspace. You'll have to have multitasking (either cooperative or preemptive) for that. Another big dependency. You should separate window decorator. Most likely at this point you'll realize that you gonna need to redesign / refactor almost all of your related GUI code, and start it over.

And the proper way: you'll need double or triple buffering to avoid epilepsy seizures of the users, a shared function library, image handling libraries (like decompressing png into a pixel map), a client-server architecture (like in X11 or in Wayland), themes, etc. etc. etc. Writing applications like panel, dock, dekstop, application launcher etc. things that are not part of your GUI library per se, but users expects a graphical interface to have them.

That's hell a lot of work even for a copy-n-paste samurai!


Top
 Profile  
 
 Post subject: Re: Why do they say it takes years to make a GUI?
PostPosted: Wed Jan 11, 2017 2:19 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

bzt wrote:
andrewthompson555 wrote:
Why do people say that it will take years to create your own GUI?

Because you'll need a lot of things before you can even think about writing a GUI.

First: you need a working bootloader, a kernel, device drivers for keyboard and mouse. That implies enabling IRQs, issuing EOIs, IDT etc. Most people can't finish with this in months, not in weeks. Once you got all of that, you're still lightyears away. How would you implement that GUI? Trivial solutions tend to be the wrong:

Simplest: GUI in kernel with minimal look out. Attempting, but very in-efficient. Your applications would "freeze" as you move windows by, just like in XP. No icons, or just statically linked pixel maps. As all of your drawing done in supervisor mode one simple bug in line drawing routine would crash your whole system. You'll gonna need working system calls so that applications can say "open a window for me please".

Bit more advanced: Loading resources (like icons and fonts) from file. You'll need a working filesystem for that. A big dependency. Separated memory for each window instead of drawing directly to the frame buffer. That implies a way of coping big amounts of memory quickly (effective blitting). You'll have to take overlapping windows account, calculate intersections, etc. so you need a window manager or compositor.

Move along, be safe: moving all the libraries to userspace. You'll have to have multitasking (either cooperative or preemptive) for that. Another big dependency. You should separate window decorator. Most likely at this point you'll realize that you gonna need to redesign / refactor almost all of your related GUI code, and start it over.

And the proper way: you'll need double or triple buffering to avoid epilepsy seizures of the users, a shared function library, image handling libraries (like decompressing png into a pixel map), a client-server architecture (like in X11 or in Wayland), themes, etc. etc. etc. Writing applications like panel, dock, dekstop, application launcher etc. things that are not part of your GUI library per se, but users expects a graphical interface to have them.

That's hell a lot of work even for a copy-n-paste samurai!


Even with all of that; there's things like:
  • An event system for various things (not just user input, but window resize/movement, etc)
  • Font engine (changing font style and/or size in middle of sentence, proportional fonts, etc)
  • Layout engine for "text" (likely with some form of markup), possibly including support for intelligent word wrapping, "right-to left" languages, etc.
  • Lots of icons (one for each app/utility/thing that comes with the OS, one for each file type, etc)
  • Sound effects
  • A help system (including pictures/diagrams/graphics and "click-able hyper-links", and including the fine-grained help for specific things - e.g. where you click on a "?" icon then any button and it'll show you the help for that button)
  • A system for tracking user preferences (at a minimum, global preferences that effect all apps)
  • A whole pile of widgets (list view, tree view, drop down list, checkbox, ....)
  • "Clipboard" system for cut&paste (with standardised representations for things like graphics data, etc - not just text)
  • Various utilities needed to make using the GUI productive (start menu/task bar, file browser, clock app)
  • Various utilities needed to configure the OS (disk manager, network configuration tool, user preferences, etc)

andrewthompson555 wrote:
Why do people say that it will take years to create your own GUI? It sounds quite stupid to be honest. It will only take a few months if you know what to do with programming and if you type fast.


There's also a massive difference between "piece of poo slapped together in a rush" and "well designed high-quality software that won't need radical/compatibility breaking changes for decades". It doesn't matter how experienced you are with programming and OS development and GUIs; you can not write* a full GUI in 2 months that isn't a worthless piece of trash. Note: I mean "write" literally here - you might be able to port large pieces (e.g. font engine, etc) to save some time.


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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], MichaelPetch and 105 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group