mutoo
5/21/2013 - 5:13 AM

the simplest operating system that only shows the words "Hello,OS!" on screen after computer startup

the simplest operating system that only shows the words "Hello,OS!" on screen after computer startup

	org 07c00h		; tell the complier put this code to 0x7c00
%endif
	mov ax, cs
	mov ds, ax
	mov es, ax
	call DispStr	; call sub-func
	jmp $			; while(1); $ means current address;
DispStr:
	mov ax, BootMessage
	mov bp, ax
	mov cx, 16
	mov ax, 01301h
	mov bx, 000ch
	mov dl, 0
	int 10h
	ret
BootMessage:	db	"Hello, OS!"
times 510-($-$$) db 0 	; $$ means the beginning of this section
						; in this case is 0x07cc
dw 0xaa55				; end flag; known as boot section