Ghost Kernel

Canvas implementation, desktop application 2016/07/11, 23:08:20

The latest commit includes a canvas implementation and the first steps for an actual desktop.

A canvas component is needed to allow applications to freely draw on a buffer in memory, which is usually only done by window server. The use case for this canvas is for example drawing a task-bar from within the desktop application or providing a space to draw images from client-side. It will also be the basis for other user-drawn components.

Unlike other UI components, the content of a canvas is entirely rendered by the component creator instead of the server. The implementation for this is done with a combination of shared memory and messaging. The client requests creation of a canvas component just as with any other component, and the window server notifies the client with events when the buffer has been allocated.

The most challenging issue with a shared memory buffer is avoiding the client application to cause faulty memory accesses when the buffer needs to be resized (i.e. after relayouting). This is now solved by simply retaining the previous buffer until the client application sends an acknowledge message to the window server. This consumes more memory until the buffer is acknowledged but improves stability. A nice little discussion on this topic was led in the OSDev forums.

Comments

Write a comment...
  • Irvan 2016/11/03, 01:07:43

    This is one of best hobbyst OS design that I've ever meet

  • Al Tan 2016/08/08, 04:43:05

    Thumbs up. Thanks for this ongoing project. Looks awesome!

    • Max 2016/08/15, 10:51:21

      Thanks for the support! Appreciate it a lot!

Cancel