Linux0.12内核代码中文注释 + 在高版本GCC 5.4.0 + Ubuntu 16.04
编译结果如下:
运行结果如下:
运行环境下载地址: http://oldlinux.org/Linux.old/bochs/linux-0.12-080324.zip
Linux0.12内核代码中文注释+在高版本GCC 5.4.0 + Ubuntu 16.04中编译成功并在Bochs正常测试运行
Home Page: https://github.com/sky-big/Linux-0.12
Linux0.12内核代码中文注释 + 在高版本GCC 5.4.0 + Ubuntu 16.04
编译结果如下:
运行结果如下:
运行环境下载地址: http://oldlinux.org/Linux.old/bochs/linux-0.12-080324.zip
ss
編譯完成 產生的Kernel_Image如何放入tool/linux-0.12-080324.zip 取代原本的核心?
我直接把Kernel_Image 重新命名為bootimage-0.12-hd取代原本的bootimage-0.12-hd無法正常運作
你好,我最近在自学内核代码,我看到你的代码中对一些内联函数进行了寄存器的保护,例如对memory.c中copy_page(from, to)的操作,但是在我的测试情况下
#include <stdio.h>
#define copy_page(from,to) \
__asm__( \
"cld ; rep ; movsl" \
: \
:"S" (from),"D" (to),"c" (1024) \
: \
)
int main(){
copy_page(100, 200);
return 0;
}
汇编出来的代码为
main:
.LFB0:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %edi
pushl %esi
.cfi_offset 7, -12
.cfi_offset 6, -16
call __x86.get_pc_thunk.ax
addl $_GLOBAL_OFFSET_TABLE_, %eax
movl $100, %eax
movl $200, %edx
movl $1024, %ecx
movl %eax, %esi
movl %edx, %edi
#APP
# 13 "asm_in_c.c" 1
cld ; rep ; movsl
# 0 "" 2
#NO_APP
movl $0, %eax
popl %esi
.cfi_restore 6
popl %edi
.cfi_restore 7
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
可以看到编译器好像自动保护了寄存器。
请问,当时是出于什么考虑加上了寄存器保护,或者还是受到gcc版本影响(我的gcc版本为7),是否有必要加入寄存器保护?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.