Advertisement
MichaelPetch

write video memory

Apr 30th, 2021
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdint.h>
  2.  
  3. #define VIDEO_MEM_TEXT 0xb8000
  4. #define ATTR_BWHITE_ON_MAGENTA 0x5f
  5.  
  6. static volatile uint16_t *video_mem = (uint16_t*)VIDEO_MEM_TEXT;
  7.  
  8. int kernel_main()
  9. {
  10. video_mem[0] = (ATTR_BWHITE_ON_MAGENTA << 8) | 'H';
  11. video_mem[1] = (ATTR_BWHITE_ON_MAGENTA << 8) | 'e';
  12. video_mem[2] = (ATTR_BWHITE_ON_MAGENTA << 8) | 'l';
  13. video_mem[3] = (ATTR_BWHITE_ON_MAGENTA << 8) | 'l';
  14. video_mem[4] = (ATTR_BWHITE_ON_MAGENTA << 8) | 'o';
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement