Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Pictionary, Drawful and more #15

Open
xbhatnag opened this issue Apr 19, 2019 · 3 comments
Open

Pictionary, Drawful and more #15

xbhatnag opened this issue Apr 19, 2019 · 3 comments

Comments

@xbhatnag
Copy link
Owner

Start drawing things out to HDMI. Use Framebuffers.

@xbhatnag
Copy link
Owner Author

xbhatnag commented Sep 21, 2019

This took a while to do, but I have a basic version working.

You need to make a message (exactly one with multiple tags) to the GPU mailbox. This will configure the framebuffer correctly and return a physical address pointing to the framebuffer.

Then the kernel needs to understand virtual memory, so it can dynamically take the physical address and create a page table entry for it so the buffer shows up in virtual memory.

It's here that I was stuck for the longest time. Apparently the address returned by the GPU has to be masked for it to be a valid physical address. I didn't know this.

Once that is done, we can draw things out to a screen by flipping bits in the frame buffer.

@xbhatnag
Copy link
Owner Author

With that done, I converted the default Linux console font (default8x16.psfu) to a font that could be stored in memory (see ConsoleFont.h).

This was done by making minor edits to a tool called NAFE (see http://nafe.sourceforge.net/)

It has 256 characters and the basic ASCII characters work. Haven't tried the extended characters.

With the font in place, I added methods to manipulate the frame buffer so that it would behave like a traditional console.

Overflow in horizontal and vertical axis is handled correctly.
Overwriting is handled correctly.

Currently there is no cursor, so you don't know where you are. I plan to add one in the future. I might need threading working properly for that.

@xbhatnag
Copy link
Owner Author

xbhatnag commented Jan 2, 2020

IMG_20190921_093018_500

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant