Advertisement
Guest User

Untitled

a guest
Oct 5th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1.  
  2. uint16_t encode_color(uint16_t color, char ch) {
  3.     return (uint16_t)(color << 8) | (uint16_t)ch;
  4. }
  5.  
  6. void kernel_main() {
  7.     volatile uint16_t * out = (uint16_t* )0xb8000;
  8.     char *hi = "hello world";
  9.  
  10.     for (uint16_t i = 0; hi[i] != '\0'; i++) {
  11.         out[i] = encode_color(3, hi[i]);
  12.     }
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement