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!