简体   繁体   English

从我的引导程序引导linux内核

[英]linux kernel booting from my bootloader

i wish to load linux using my own bootloader .. preliminary research and google told me that i ll have to use start_kerne() function .. i want to ask how can i call start_kernel() from assembly .. i have already formatted my usb into ext3 and pasted the compiled kernel there .. now how can i start the linux kernel ? 我希望使用我自己的引导程序来加载Linux ..初步研究,谷歌告诉我,我将不得不使用start_kerne()函数..我想问一下如何从汇编中调用start_kernel()..我已经格式化了USB进入ext3并在那里粘贴编译的内核..现在我该如何启动linux内核? any help is welcome // Thankyou in advance 欢迎任何帮助//提前谢谢

Mohsin . 莫欣。

Are you sure you need to write your own bootloader ? 您确定需要编写自己的引导程序吗?
You don't call start_kernel. 您不会调用start_kernel。 You don't call any function by the way. 顺便说一下,您不会调用任何函数。 What you need is to read the kernel image into memory, put some information like the commandline into memory, setup some register and then jump to the entrypoint of the kernel. 您需要将内核映像读入内存,将命令行等信息放入内存,设置一些寄存器,然后跳转到内核的入口点。
Each architecture (x86, ARM etc ...) can have different booting requirement. 每个体系结构(x86,ARM等)可以具有不同的启动要求。

If you want to have a deeper understanding, may be you can have a look at u-boot source, for example lib_386/zImage.c 如果您想更深入地了解,也许可以看看u-boot的源代码,例如lib_386 / zImage.c

Grub 2随附的装载机可能是一个很好的入门参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM