我正在尝试编写自己的操作系统内核,但在引导加载程序和(即将成为)我的内核(用 C 编写的)之间正确连接时遇到了一些问题。
我有以下代码...
src/bootloader.asm
; Allows our code to be run in real mode.
BITS 16
extern kmain
section .text
global _start
_start:
jmp Start
; Moves the cursor to row dl, col dh.
MoveCursor:
mov ah, 2
mov bh, 0
int 10h
ret
; Prints the character in al to the screen.
PrintChar:
mov ah, 10
mov bh, 0
mov cx, 1
int 10h
ret
; Set cursor position to 0, 0.
ResetCursor:
mov dh, 0
mov dl, …Run Code Online (Sandbox Code Playgroud)