boot.s

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 $@ $^

boot: boot.o
        ld86 -0 -s -o $@ $^

boot.img: boot
        dd bs=32 if=$^ of=$@ 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

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值