30天自制操作系统笔记(一二)

第一天与第二天

看完第一天与第二天的内容,感觉这两天的内容不难

下面是系统的运行截图:


下面是系统的源文件:ucan23ipl.nas

; ucan23-os
; TAB-4
	ORG	0x7c00	;指明程序的装载地址
; 以下这段是标准FAT12格式软盘专用的代码
	JMP	entry
	DB	0x90
	DB	"UCAN23LD"	;启动区的名称可以是任意的字符串(8字节)
	DW	512					;每个扇区的大小
	DB	1						;簇的大小
	DW	1
	DB	2
	DW	224	
	DW	2880
	DB	0xf0
	DW	9
	DW	18
	DW	2
	DD	0
	DD	2880
	DB	0,0,0x29
	DD	0xffffffff
	DB	"UCAN23-OS  "
	DB	"FAT12   "
	RESB	18
	;程序主体
entry:
	MOV	AX, 0	;初始化寄存器
	MOV	SS, AX
	MOV	SP, 0x7c00
	MOV	DS, AX
	MOV 	ES, AX
	
	MOV	SI, msg
putloop:
	MOV	AL, [SI]
	ADD	SI, 1
	CMP	AL, 0
	JE	fin
	MOV	AH, 0x0e
	MOV	BX, 15
	INT	0x10
	JMP	putloop
fin:
	HLT
	JMP	fin
;信息显示部分
msg:
	DB	0x0a, 0x0a	;2个换行
	DB	"Hello, world(ucan23)"
	DB	0x0a
	DB	"This is my first OS"
	DB	0x0a
	DB	"Copyright GPL"
	DB	0x0a
	DB	"Author: ucan23(Howard)"
	DB	0x0a
	DB	"Blog:http://blog.sina.com/rjxx007"
	DB	0x0a
	DB	"Blog:http://blog.csdn.net/ucan23"
	DB	0x0a
	DB	0
	
	RESB	0x7dfe-$
	DB	0x55, 0xaa

下面是所用到的Makefile文件:

ucan23ipl.bin: ucan23ipl.nas Makefile
	../tolset/z_tools/nask.exe ucan23ipl.nas ucan23ipl.bin ucan23ipl.lst
	
ucan23.img: ucan23ipl.bin Makefile
	../tolset/z_tools/edimg.exe imgin:../tolset/z_tools/fdimg0at.tek \
	wbinimg src:ucan23ipl.bin len:512 from:0 to:0 imgout:ucan23.img

asm:
	../tolset/z_tools/make.exe -r ucan23ipl.bin
	
img:
	../tolset/z_tools/make.exe -r ucan23.img
	
run:
	../tolset/z_tools/make.exe img
	copy ucan23.img ..\tolset\z_tools\qemu\fdimage0.bin
	../tolset/z_tools/make.exe -C ../tolset/z_tools/qemu
	
install:
	../tolset/z_tools/make.exe img
	../tolset/z_tools/imgtol.com w a: ucan23.img
	
clean:
	-del ucan23ipl.bin
	-del ucan23ipl.lst
	
src_only:
	../tolset/z_tools/make.exe clean
	-del ucan23.img

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值