Writing A String to Video Memory - Amateur OS Dev
Sorry for the delay on this. Wasn't sure what to title it, but we add an implicit return to the end of user input hex in the hex monitor, and write the '$' and '?' keybind text to the editor screen, explaining how to write text to video memory for VGA color text modes. Also put in a few other small changes here and there.
Playlist link: https://www.youtube.com/playlist?list=PLT7NbkyNWaqajsw8Xh7SP9KJwjfpP8TNX
The next video we'll put in initial backspace support for the kernel "shell" commands, rewrite the clear screen function to write spaces to video memory and move the cursor with int 10h ah 02h, and do other editor improvements
Notes:
After some review, "editor.asm" should probably use 'call hex_code' instead of 'jmp hex_code', for the added C3 to return properly, right? It does seem to mostly work as shown in this video, but that doesn't seem exactly right as 'ret' should be popping an address from the stack and jumping to it. Strange.
I also didn't explain the video memory in detail, it's more like memory-mapped I/O, where the VGA hardware is mapped to the memory region 0xA000+, so it doesn't behave like normal RAM. That area is parallel to the screen, such that any changes to this memory are made and refreshed "instantly" (I'm assuming at whatever refresh rate your monitor would be at e.g. 60hz) to be visible on screen.
For a much more thorough explanation of VGA things, see this article http://www.brokenthorn.com/Resources/OSDev10.html
I will be implementing some of the things covered there in upcoming videos, such as functions for writing characters and strings to video memory, and moving the hardware cursor using 'out' instructions.
----------------------------------------------------------------------------------------------------------------------------------------
Git repos:
https://git.sr.ht/~queso_fuego/quesos
https://github.com/queso-fuego/amateuros
Source code for this video:
https://git.sr.ht/~queso_fuego/amateur_os_video_sources/tree/master/item/15_write_string_video_memory
Software used:
VMware Workstation Player - https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html
openBSD - https://www.openbsd.org/
bochs - http://bochs.sourceforge.net/
vim - https://www.vim.org/ (neovim is probably better :p)
fasm - https://flatassembler.net/
Suggest content you would like to see live, programming, gaming, or otherwise, through youtube comments or by email. Or if twitch has a dm feature that you can slide into, that works too
Stream archive channel- https://www.youtube.com/channel/UCxi12g3jdQMFiFTA5GVcGMA
Contact:
email - fuegoqueso@gmail.com
twitter - @Queso_Fuego
Thoughts/Notes/Suggestions/Other - Drop a message in the video comments or by email
Credits:
Music from https://incompetech.com:
"Your Call" by Kevin MacLeod (https://incompetech.com)
Licence: CC BY (http://creativecommons.org/licenses/by/4.0/)
The blue title tags:
#osdev #programming #assembly