孟宁的地盘
mengning / mykernel Goto Github PK
View Code? Open in Web Editor NEWmykernel 2.0: Develop your own OS kernel by reusing Linux infrastructure, based on x86-64/Linux Kernel 5.4.34.
License: GNU General Public License v2.0
mykernel 2.0: Develop your own OS kernel by reusing Linux infrastructure, based on x86-64/Linux Kernel 5.4.34.
License: GNU General Public License v2.0
按照操作步骤到make的时候会报错找不到compiler-gcc5.h。
在https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/tree/include/linux/compiler-gcc5.h下载了一个也不行。
我的系统是Ubuntu 16.04 x64
昨天改了my_process的实现, 让它做完一定次数后可以退出, 结果发现my_process退出后bzImage会崩溃, 初步判断是与"启动第一个进程"的内嵌汇编有关, 因为注释掉它后一切正常. 如何让bzImage不崩溃?
或者老师是否可以给一些相关的资料?
patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.
这是什么原因造成的
用的是3.9.4的
疑问:
"popq %rbp"
, 它是如何接着上次的中断位置继续执行的?"pushq %1\n\t"
, 因为此时rbp的值应是my_start_kernel的rbp, 这句又没给rbp赋新值, 有何意义?qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
Could not initialize SDL(No available video device) - exiting
虚拟机环境: virtualbox+Ubuntu18.04
请问这个如何解决?
I see that during a context switch, PCB / Thread stores the contents of the IP/SP registers. But what about all the other general purpose registers, e.g RAX, RBX etc...
Doesn't those need to be stored as well for the context switching to function properly?
diff -Naur linux-5.4.34 linux-5.4.34-mykernel > mykernel-2.0_for_linux-5.3.34.patch
请问 linux-5.4.34-mykernel这个文件夹怎么产生的呢?
不知道加入代码段切换后进程切换后,怎样将eip指向切换
当sys_execve()系统调用从内核态返回到用户态时,EIP寄存器直接跳转到了ELF程序的入口地址,于是新的程序开始执行,ELF可执行文件装载完成。这地方理解的还不够,耽误了半天时间
有视频课程学习吗?
make时出现已下错误信息 :
In file included from include/linux/compiler.h:54:0,
from include/uapi/linux/stddef.h:1,
from include/linux/stddef.h:4,
from /home/hero/kernel_analysis/linux-3.9.4/include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/page-flags.h:8,
from kernel/bounds.c:9:
include/linux/compiler-gcc.h:103:30: fatal error: linux/compiler-gcc6.h: No such file or directory
#include gcc_header(GNUC)
^
compilation terminated.
/home/hero/kernel_analysis/linux-3.9.4/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:833: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
tools/objtool/elf.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index be89c741ba9a..2b0f4f52f7b5 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -380,8 +380,11 @@ static int read_symbols(struct elf *elf)
symtab = find_section_by_name(elf, ".symtab");
if (!symtab) {
- WARN("missing symbol table");
- return -1;
+ /*
+ * A missing symbol table is actually possible if it's an empty
+ * .o file. This can happen for thunk_64.o.
+ */
+ return 0;
}
symtab_shndx = find_section_by_name(elf, ".symtab_shndx");
--
2.29.2
然后在Linux源码目录下执行
patch -p1 < thunkpatch.patch所在目录/thunkpatch.patch
再次编译就可以解决问题。
该方案改变了elf.c文件中的read_symbols函数,使之忽略.o文件中缺少symbol table的情况,使得编译能顺利进行下去
转载自https://www.spinics.net/lists/kernel/msg3797871.html 详情可见该帖
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.