James T. Klik: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
No edit summary
 
(19 intermediate revisions by 13 users not shown)
Line 1:
Look through the window ... See that background with alpha-blending and my anti-aliased fonts ? See the corner of the screen ? That's Klik's Start Menu! Hmm, no. I have no 'programs' folder, as iI can't load 'programs' for now, but here's a 16-items list of test cases for my WidgetToolKit. Or maybe you prefer a [[What order should iI make things in|different style]].
 
== Reaching Klik's level ==
=== Step 1: Documenting on video ===
 
# Read about [[VGA Resources]] and [[GRUB]]. You have the opportunity to let the bootloader switch to graphical mode for you before your kernel is started. A color depth of 32 will avoid you further headaches. Documents about [[:Category:HardwareVideo|Documents]] about [[Accelerated Graphic Cards]] are gifts from the gods for Klik, but they're rare.
# Develop (or reuse) a small library to draw lines, fill areas, copy bitmaps and draw text '''out''' of your kernel, debug it, '''then''' integrate it in your OS.
# Find a friend to make a neat logo, ask GRUB to load it as if it was a module, memcpy it to screen and voilà. You can release 0.1
Line 20:
It is time to draw small windows on screen. We had many discussion in the forum about how they can be moved efficiently and so on. Note that you'll '''really''' start to need a way of [[Memory Management|allocating and freeing memory]] at this point, as you do '''not''' want to assume that there's a maximum of N buttons in the system ...
 
# Collect tutorials about GUI programming, including [http://osdever.net/tutorials/GUI_tut.php?the_id=62 GuiGUI Programming] at BonaFide.
# Create a class that will be responsible for receiving event from the system, including the "repaint" event.
# If you want 'windows', let there be a window manager that send them 'repaint' events when needed, handle window displacement and is in charge of "what's behind the window".
# make sure you can add content to your window, and that you don't need to write a specific "repaint" function for each new content. Most WMWMs allow a window to be a container of widgets.
 
== Outrunning James T. Klik ==
 
=== Have programs loaded in memory. ===
And provide a fsfilesystem-approach to access them. It can be very easy if you use GRUB modules to map programs in memory: you just need to create a virtual directory service that will remember at which physical memory address the image of FILE.COM is located and return that address when we do open("file.com").
 
=== Have user-level programs executed when requested. ===
 
The easiest approach is to create a segment for the user's code and one for its data. Then return to the program. You can even not worry about multitasking and decide every kernel operation will occur when an interrupt arise (that's how DOS works), but you will at least have '''1a. implement interrupts support''' and '''1b. implement basic segmentation support'''. If you're fine with ASMasm, load ASMasm programs as a first step.
 
=== Have the kernel access hardware. ===
 
It should at least be able to receive the keyboard data (and translate them ?), setup video display and read mouse events. The most simple GUI at kernel level would be get_video_segment(), set_mouse_buffer(), set_keyb_buffer(). The kernel should know then where it should put data. You can even protect your "start menu" from the user application by excluding the last lines of the display from the "video segment" you return to the application.
 
Required steps are '''2a. video driver''' (get a frame buffer), '''2b. mouse driver''' (have a cursor moving on screen) and '''2c. keyboard reader''' (have keystrokes translated and written to some memory area).
 
=== Build the menu at run time ===
Line 48:
This requires '''3a. Process control''': select which program is currently running and '''3b. Process sleep & wakeup''': let the application decide that it have nothing to do but waiting something to happen and let the kernel return to the application only when something occurred.
 
Note that this will only offer you something like MacOSMac OS 1.0 and that you'll certainly find yourself in troubles as soon as you'll try to add something like modular design, networking or multitasking ...
 
== James' Bookshelf ==
Jumping right into graphics is frowned upon by many authors, and consequently he owns very few books on the subject. However, he does find some books like [[Books|"Operating Systems Design and Implementation" by Andy Tanenbaum]] interesting for some of the "prerequisites" of GUIs, like multitasking. Yet he did find some good documentation on the graphics systems, such as [http://www.amazon.com/Advanced-Programming-Displays-Character-Keyboards/dp/0130102407/ref=sr_1_2/103-5585202-5631020?ie=UTF8&s=books&qid=1189864681&sr=1-2 "Advanced C Programming for Displays" by Marc Rochkind] or [http://www.amazon.com/Fundamentals-Interactive-Computer-Graphics-Programming/dp/0201144689 "Fundamentals of Interactive Computer Graphics" by James Foley] useful. And he has printed copies of all of VESA's VBE standards.
 
== James T. Klik opponents' position ==
If you're wondering how you'll implement the 'start button' and its menu right from the start, you're probably getting things by the wrong end... When you want to make a word processing program, you don't ask yourself how you will have icons for "save", "print", etc. in a bar that you can move across your window. You first ask yourself how you will represent text, how you will implement basic operations like extracting text from one paragraph and put text into another one, how you will deal with embedded objects like pictures, etc. or how you will store your text efficiently on a file. Basically, you'll work yourself like that slow horse in the pack if you don't have a good kernel with [[What order should iI make things in|a different approach]] up first.
 
Also, many proponents of [[protected mode]] find VESA unattractive, since you need some sort of hook into the BIOS.
 
== People and OSes related to James T. Klik ==
* [[User:Combuster|Combuster]]
{{Stub}}
* [[User:Novayoshi|NovaYoshi]]
* [http://messiahandrw.netfast.org MessiahAndrw]
* [[User:osdeverr|osdeverr]]: "Me back in 2015... Now I blame myself for that TBH."
* [http://omarrx024.github.io omarrx024]
* [http://www.oby.ro/os/ Bogdan Ontanu, Solar_Os, GUI, Widget toolkit and running loaded PE from disk]
* '' insert your names here ''
 
[[Category:Developer Archetype]]
[[Category:Graphical_UI]]
Anonymous user