kernel.asm

来自「一个从底层支持中文显示的操作系统的源代码,以及目标IMG文件,可在VMWare下」· 汇编 代码 · 共 100 行

ASM
100
字号
;===========================================================
;
;	WarmOS
;	by HotHeart(xujiwei)
;	Email: vipxjw@163.com
;
;	Kernel
;	Kernel
;
;	History:
;	2005.08.27	finished init
;	2005.08.26	file created
;
;===========================================================
;===========================================================
;	some const
;===========================================================
KERNEL_POS		equ	0x5000

;===========================================================
;	kernel start
;===========================================================
bits	16
org		0x0
start:
		cli
	.set_regs:
		mov		ax,cs
		mov		ds,ax
		mov		es,ax
		mov		fs,ax
		mov		gs,ax
		mov		ax,0x9000
		mov		ss,ax
		mov		sp,0x7FFF

	.set_display_mode:
		mov		ax,0x12
		int		0x10

	.set_syscall:
		push	es
		mov		ax,0x0
		mov		es,ax
		mov		[es:0x40*4],word sys_call
		mov		[es:0x40*4+2],cs
		pop		es

	.show_welcome:
		mov		ax,0
		mov		bx,szWelcome
		int		0x40
		mov		ax,0
		mov		bx,szPrompt
		int		0x40

	.shell:
		call	Shell

	.end:
		call	cmdShutdown
		jmp		$

szWelcome:
	db	'欢迎使用WarmOS',13,10,0

;===========================================================
;	floppy operate
;===========================================================
%include	"floppy.inc"

;===========================================================
;	string operate
;===========================================================
%include	"string.inc"

;===========================================================
;	shell
;===========================================================
%include	"shell.inc"

;===========================================================
;	syscall
;===========================================================
%include	"syscall.inc"

;===========================================================
;	English font
;===========================================================
align	4
font_en:
	incbin	"ASC8x16.FON"
	times	1024/4 dd	0

;===========================================================
;	Chinese font
;===========================================================
align	4
font_cn:
	incbin	"SCN16x16.FON"

⌨️ 快捷键说明

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