• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

liva/minimal-linux

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

liva/minimal-linux

开源软件地址(OpenSource Url):

https://github.com/liva/minimal-linux

开源编程语言(OpenSource Language):

C 93.8%

开源软件介绍(OpenSource Introduction):

minimal linux

What's this?

This is the stripped version of linux kernel for learning.

Features are

  • fast compilation (only takes 20 seconds on Xeon E3-1275 v5 @ 3.60GHz)
  • less source files (almost 900 .c files)

Limitations are

  • only works on x86_64 QEMU
  • only supports 8250 serial driver

compilation

Use 'minimalconfig' for configuration. DO NOT GENERATE '.config' FROM 'make' COMMANDS!

$ cp minimalconfig .config
$ make -j8 bzImage

make rootfs

$ cd (project_root)
$ wget http://busybox.net/downloads/busybox-1.27.2.tar.bz2
$ tar xf busybox-1.27.2.tar.bz2
$ cd busybox
$ make menuconfig
Busybox Settings ---> Build Options --->Build BusyBox as a static binary (no shared libs)
$ make -j8
$ make install
$ mv _install ../rootfs
$ cd ../rootfs
$ find . | cpio -o --format=newc > ../rootfs.img
$ cd ..

run

qemu-system-x86_64 -kernel arch/x86/boot/bzImage -initrd (project_root)/rootfs.img -append "console=tty0 console=ttyS0,115200 root=/dev/ram rdinit=/bin/sh" -curses

You must switch to the serial console monitor with Ctrl+Alt+3.

to use procfs and sysfs

Run these commands in the busybox shell.

# mkdir /proc /sys
# mount -t proc none /proc
# mount -t sysfs none /sys
# mdev -s



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
dosemu2/dosemu2: Run DOS programs under linux:发布时间:2022-08-15
下一篇:
alpinelinux/aports: [MIRROR] Alpine packages build scripts发布时间:2022-08-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap