欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

boot.s

程序员文章站 2022-03-15 15:36:26
...

as86:

! boot.s -- basic structure of bootsect.s

.globl begtext, begdata, begbss, endtext, enddata, endbss
.text
begtext:
.data
begdata:
.bss
begbss:
.text
BOOTSEG = 0x07c0

entry start
start:
	jmpi	go, BOOTSEG
go:	mov	ax, cs
	mov	ds, ax
	mov	es, ax
	mov	[msg1+17], ah
	mov	cx, #20
	mov	dx, #0x1004
	mov	bx, #0x000c
	mov	bp, #msg1
	mov	ax, #0x1301
	int	0x10
loop1:	jmp	loop1
msg1:	.ascii	"Loading system ..."
	.byte	13, 10

.org 510
	.word	0xAA55

.text
endtext:
.data
enddata:
.bss
endbss:

 Makefile:

all: boot.img


boot.o: boot.s
        as86 -0 -a -o aaa@qq.com $^

boot: boot.o
        ld86 -0 -s -o aaa@qq.com $^

boot.img: boot
        dd bs=32 if=$^ aaa@qq.com skip=1

 bochs config:

megs: 32

romimage: file=../BIOS-bochs-latest
vgaromimage: file=../VGABIOS-lgpl-latest

ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="boot.img", cylinders=1, heads=1, spt=1

boot: c

log: bochsout.txt

mouse: enabled=0

 
boot.s
 

相关标签: Go

推荐阅读