welcome to mykernel

以下编译步骤摘自https://github.com/mengning/mykernel

Welcometo the mykernel!

It is a platform to write your own OSkernel,its based on Linux Kernel 3.9.4 source code.

Setup this platform
#sudo apt-get install qemu # installQEMU
#sudo ln -s /usr/bin/qemu-system-i386 /usr/bin/qemu
#wgethttps://www.kernel.org/pub/linux/kernel/v3.x/linux-3.9.4.tar.xz  #download Linux Kernel 3.9.4 source code

#wgethttps://raw.github.com/mengning/mykernel/master/mykernel_for_linux3.9.4sc.patch# download mykernel_for_linux3.9.4sc.patch

#xz -dlinux-3.9.4.tar.xz

#tar -xvf linux-3.9.4.tar

#cd linux-3.9.4

#patch -p1 <../mykernel_for_linux3.9.4sc.patch

#make allnoconfig

#make

#qemu -kernel arch/x86/boot/bzImage



qemu窗口中您可以看到my_start_kernel在执行,同时my_timer_handler时钟中断处理程序周期性执行。
cdmykernel
您可以看到qemu窗口输出的内容的代码mymain.cmyinterrupt.c
当前有一个CPU执行C代码的上下文环境,同时具有中断处理程序的上下文环境,我们初始化好了系统环境。
您只要在mymain.c基础上继续写进程描述PCB和进程链表管理等代码,在myinterrupt.c的基础上完成进程切换代码,一个可运行的小OSkernel就完成了。
start to write your own OS kernel,enjoy it!
mykernel patch generatedby this command:

diff -Naur linux-3.9.4linux-3.9.4.new/ > mykernel_for_linux3.9.4sc.patch

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值