⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kernel_a.asm

📁 John Fine的OS模型// 源代码// C & ASM// 英文
💻 ASM
字号:
; When started from bootf we get to this code with a temporary GDT,
; a temporary stack, temporary page tables, no TSS, no IDT and interrupts
; disabled.

; BOOTF sets up mapping so that the kernel starts at offset 0xFF800000
; In a real kernel we would have multiple modules so the linker must
; deal with the starting offset.  In a one module example we let NASM
; do the linking (NASM -f bin) so we must tell NASM the starting offset.

	ORG   0xFF800000

	BITS 32

SEGMENT .data
message db "Executing the ASM code",0

SEGMENT .text
start:
	mov	edi, 0xB8000
	mov	esi, message
	mov	ah, 7		;Text attribute
.again:	lodsb
	stosw
	test	al, al
	jnz	.again

	jmp short $		;Hang here

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -