我正在按照本教程制作一个简单的 32 位操作系统。我已经到了第 4 节,我正在写入帧缓冲区。基本上我正在尝试创建自己的 println 函数。这是我的函数的代码:
/** fb_write_cell:
* Writes a character with the given foreground and background to position i
* in the framebuffer.
*
* @param i The location in the framebuffer
* @param c The character
* @param fg The foreground color
* @param bg The background color
*/
static void fb_write_cell(unsigned int i, char c, unsigned char fg, unsigned bg) {
fb[i] = c;
fb[i + 1] = ((fg & 0x0F) << 4) …Run Code Online (Sandbox Code Playgroud)