自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 俺啥也不懂-不知道什么时候才会编写操作系统-一个hello world写一年-俺以为懂了

俺以为稍微懂一点了,可以开始保护模式了,但是感觉吃力,所以俺换了一个代码源,继续看hello world,希望能够有所裨益代码地址:https://github.com/cfenollosa/os-tutorial.git使用这个代码之前,可以先看一下:https://www.jianshu.com/p/a479e2b568c9mov ah, 0x0e ; tty modemov al, 'H'int 0x10mov al, 'e'int 0x10mov al, 'l'int 0x

2020-08-13 23:15:41 216

原创 俺啥也不懂-不知道什么时候才会编写操作系统-一个hello world写一年-汇编如何引用其它文件

反正就是hello world,先看代码hello.asm%include 'tools.asm'section .datamsg db 'hello world',0Ahsection .textglobal _start_start: mov eax,msg ;将msg放入eax寄存器,用来计算长度 call print ;调用print方法 call quittools.asmstrlen: push ebx mov ebx,eax ;将msg存入ebx,开始

2020-08-01 23:13:46 118

原创 俺啥也不懂-不知道什么时候才会编写操作系统-一个hello world写一年-10h中断黑底绿字

先看代码 org 07c00h ; 告诉编译器程序加载到7c00处 mov ax, cs mov ds, ax mov es, ax call DispStr ; 调用显示字符串例程 jmp $ ; 无限循环DispStr: mov ax, BootMessage mov bp, ax ; ES:BP = 串地址 mov cx, len_string ; CX = 串长度 mov ax, 01301h ; AH = 13, AL = 01h mov bx,

2020-07-27 21:33:20 118

原创 俺啥也不懂-不知道什么时候才会编写操作系统-一个hello world写一年-最终还是逃不过gdb调试

上一篇文章纠结了好久,其实俺其实可以继续学习后面的东西,很多人hello world写完了直接就开始进入保护模式了,但是俺想了想还是停下来了,把没搞明白的地方继续搞明白,这其实是汇编基础了,基础差还是愁人今天就讲cmp byte[eax],0和jz指令,本来不想搞gdb的,最终还是妥协了,看不懂就得调试。cmp命令得出的结果其实是byte[eax]-0的结果,jz的意思是jmp if zero,即结果为0时跳转,至于cmp影响标志位,还是不讲,注意的是cmp不改变eax的值,而bypte[eax]的

2020-07-22 22:18:06 170

原创 俺啥也不懂-不知道什么时候才会编写操作系统-一个hello world写一年-汇编如何计算字符串的长度

诸位,俺还没研究透10h中断,今天不写这个了,写一下如何计算字符串的长度吧,按照惯例,先把hello world摆上来 org 07c00h ; 告诉编译器程序加载到7c00处 mov ax, cs mov ds, ax mov es, ax call DispStr ; 调用显示字符串例程 jmp $ ; 无限循环DispStr: mov ax, BootMessage mov bp, ax ; ES:BP = 串地址 mov cx, len_string ;

2020-07-20 22:32:46 224 2

原创 俺啥也不懂-不知道什么时候才会编写操作系统-一个hello world写一年-操作系统层面的hello

有时候想啊,自己要是写一个操作系统也不赖,看着网上那些讲解都太糙了,不适合我这种啥都不懂的人,如果给我来写,一个hello world能写一年先贴一个hello world的代码 org 07c00h ; 告诉编译器程序加载到7c00处 mov ax, cs mov ds, ax mov es, ax call DispStr ; 调用显示字符串例程 jmp $ ; 无限循环DispStr: mov ax, msg mov bp, ax ; ES:BP = 串

2020-07-16 22:43:24 133

原创 俺啥也不懂-不知道什么时候才会编写操作系统-一个hello world写一年-为什么能输出hello world

感觉我智商有问题啊,网上关于中断的解释太多了,我居然看不懂,反正没有我想要的例子就是看不懂。还是先贴hello world; Hello World Program - asmtutor.com; Compile with: nasm -f elf helloworld.asm; Link with (64 bit systems require elf_i386 option): ld -m elf_i386 helloworld.o -o helloworld; Run with: ./

2020-07-15 22:38:55 168

原创 俺啥也不懂-不知道什么时候才会编写操作系统-再写Hello World-讲讲gcc和ld

还是把hello world的代码贴出来,占个位; Hello World Program - asmtutor.com; Compile with: nasm -f elf helloworld.asm; Link with (64 bit systems require elf_i386 option): ld -m elf_i386 helloworld.o -o helloworld; Run with: ./helloworldSECTION .datamsg db

2020-07-14 22:40:26 140

原创 俺啥也不懂-不知道什么时候才会编写操作系统-再写Hello World-第二版makefile

哈哈,估计没有人执行过代码,有些地方是编译不过去的,不过不解释了继续看第二版的makefile:outputFilePath=/usr/local/myAll/output/huibian/OBJ = $(outputFilePath)lesson1.oTARGET=$(outputFilePath)mainRM = rm -f$(TARGET):$(OBJ) gcc -g -o $@ $<$(OBJ):$(outputFilePath)%.o:%.asm nasm -f el

2020-07-13 23:02:09 119

原创 俺啥也不懂-不知道什么时候才会编写操作系统-再写Hello World-第一版makefile

可能还要看一下gcc把先贴上上一篇的Hello World可以在centos下将一下代码保存为hello.asmsection .datamsg: db "hello, world", 10len equ $-msg section .textglobal mainmain: mov edx, len mov ecx, msg mov ebx, 1 mov eax, 4 ;直接使用sys_write系统调用 int 0x80

2020-07-11 22:05:22 99 1

原创 俺啥也不懂-不知道什么时候才会编写操作系统-先写Hello World

先搭环境相关书籍:自备,《30天自制操作系统》,于渊的《自己动手写操作系统》,王爽的《汇编语言》,各位大神的书,请各位自行阅读,俺只是代码的搬运工代码放在git上:https://github.com/qdhjkztm/study.git,可以作为参考开发工具:vs code开发使用操作系统:win10虚拟机:自备编译环境:centos7所需技能:shell,汇编,nasm,makefile,git,c吧所以,开发流程是win10下使用vs code开发(ctrl-c+ctr

2020-07-10 23:21:13 510

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除