as86汇编程序的编译与链接

       抄好了一份boot.s代码,又搞定了编译器,接下来小结一下编译与链接。

       先用as86编译器把汇编代码编译成.o文件:

grey@DESKTOP-3T80NPQ:/mnt/e/01_workspace/15_linux/01_kernal/03_my_test_code$ls

boot.s

grey@DESKTOP-3T80NPQ:/mnt/e/01_workspace/15_linux/01_kernal/03_my_test_code$as86 -0 -a -o boot.o boot.s

grey@DESKTOP-3T80NPQ:/mnt/e/01_workspace/15_linux/01_kernal/03_my_test_code$ls

boot.o  boot.s

       接下来进行链接操作:

grey@DESKTOP-3T80NPQ:/mnt/e/01_workspace/15_linux/01_kernal/03_my_test_code$ld86 -0 -s -o boot boot.o

grey@DESKTOP-3T80NPQ:/mnt/e/01_workspace/15_linux/01_kernal/03_my_test_code$ls

boot  boot.o boot.s

       OK!链接也已经成功!查看一下详细信息:

grey@DESKTOP-3T80NPQ:/mnt/e/01_workspace/15_linux/01_kernal/03_my_test_code$ls -l

total 1

-rwxrwxrwx 1 rootroot 544 Aug 20 18:55 boot

-rwxrwxrwx 1 rootroot 232 Aug 20 18:41 boot.o

-rwxrwxrwx 1 rootroot 554 Aug 20 16:05 boot.s

       这基本上就已经结束了,但是文件其实并不是给Linux编译的,带着一个MINIX的接口,因此也就会稍微大一些。如果进行相应的修改后,写入软盘应该就可以直接运行看到启动效果了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值