I'm writing the GUI these days, but I still have a big program!!
I don't know whether I should put it in Kernel or not. My first idea is put it in User mode, when I click the mouse on a button, the kernel receive the mouse message, and calculate out the window from the mouse position, and send the message to a process, which is the owner of the window. Then, the process receive the message in MessageProcedure(), and it will call DefaultMessageProcedure(), DefaultMessageProcedure is a function in user.dll that the program loaded it. In this function, it will do sth like Blit or Pixel(in gdi.dll) . You see, the attribute data and the bitmap data are all in User Space.
But there are many programs in my idea. I cannot share the bitmap data. They are in user space, kernel can only access them when the process is running.
If I write GUI in OS kernel, then I don't know where I can alloc the memory, in user space, or kernel space, or share space????
Quetions about Writing GUI(Buttons, TextBoxes...)
Re: Quetions about Writing GUI(Buttons, TextBoxes...)
Ugh. You seem really confused. I propose you make an API for the graphics and input hardware. This would be the API every program requires, then you'd simply make your GUI multiplex the same API to programs running on that GUI.
This way, you can probably make the whole thing to user-space.
This way, you can probably make the whole thing to user-space.
Windows Vista rapes you, cuts you and pisses inside. Thought these are just nifty side-effects.