|
发表于 2006-1-24 11:23:34
|
显示全部楼层
只是as,不连接行吗!给你个bootload,摘录于Linux1.0核心游记之操作系统的引导块程序
文件名boot.s
____________________________________________
.text
entry _start
_start:
jmpi boot,#0x07C0
boot:
mov ax,cs
mov es,ax
label2:
call print_msg
jmp label2
print_msg:
mov ah,#0x03
xor bh,bh
int 0x10
mov cx,#29
mov bx,#0x0007
mov bp,#msg
mov ax,#0x1301
int 0x10
ret
msg:
.byte 13,10
.ascii "Aha,I am a boot process !"
.byte 13,10
.org 510
.word 0xAA55
文件名 Makefile
_________________________________________
AS86 = as86 -0 -a
LD86 = ld86 -0 -d -s
OBJ = boot
.s.o:
$(AS86) -o $*.o $<
all(OBJ)
$(OBJ):boot.o
$(LD86) -o $(OBJ) boot.o
boot.o:boot.s
disk(OBJ)
dd if=./boot of=/dev/fd0 seek=0 bs=512 count=1
clean:
rm -f *.o core
clobber:clean
rm -f $(OBJ)
|
|