diff --git a/blog/content/edition-3/posts/03-screen-output/index.md b/blog/content/edition-3/posts/03-screen-output/index.md index db38a1b2..6f961418 100644 --- a/blog/content/edition-3/posts/03-screen-output/index.md +++ b/blog/content/edition-3/posts/03-screen-output/index.md @@ -34,7 +34,7 @@ The complete source code for this post can be found in the [`post-3.3`][post bra -## Recap +## Bitmap Images In the [previous post], we learned how to make our minimal kernel bootable. Using the [`BootInfo`] provided by the bootloader, we were able to access a special memory region called the _[framebuffer]_, which controls the screen output. @@ -59,10 +59,29 @@ fn kernel_main(boot_info: &'static mut BootInfo) -> ! { ``` The reason that the above code affects the screen output is because the graphics card interprets the framebuffer memory as a [bitmap] image. -A bitmap describes an image through a predefined number of bits per pixel. -TODO +A bitmap describes an image through a predefined number of bytes per pixel. +The pixels are laid out line by line, typically starting at the top. [bitmap]: https://en.wikipedia.org/wiki/Bitmap +[RGB]: https://en.wikipedia.org/wiki/Rgb + +For example, the pixels of an image with width 10 and height 3 would be typically stored in this order: + +
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |