<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=Category%3ALinux_SDK</id>
	<title>Category:Linux SDK - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=Category%3ALinux_SDK"/>
	<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=Category:Linux_SDK&amp;action=history"/>
	<updated>2026-07-22T00:28:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://w.electrodragon.com/w/index.php?title=Category:Linux_SDK&amp;diff=26338&amp;oldid=prev</id>
		<title>Chao: /* Reference */</title>
		<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=Category:Linux_SDK&amp;diff=26338&amp;oldid=prev"/>
		<updated>2020-05-12T15:25:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Reference&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Structure ==&lt;br /&gt;
* 上电 ——&amp;gt; Bootloader —[传递参数]—&amp;gt; 加载内核 ——&amp;gt; 内核挂载根文件系统 ——&amp;gt;执行应用程序&lt;br /&gt;
[[File:Starting linux.png|600px]]&lt;br /&gt;
* [[:category: bootloader]]&lt;br /&gt;
* [[:category: dtb]]&lt;br /&gt;
* [[:category: Kernel]]&lt;br /&gt;
* [[:category: Rootfs]]&lt;br /&gt;
=== Example SPI Flash  Partition ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Zero V3S - https://licheezero.readthedocs.io/zh/latest/%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91/SPI_flash_build.html&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 分区序号 !! 分区大小 !! 分区作用 !! 地址空间及分区名&lt;br /&gt;
|-&lt;br /&gt;
| mtd0 || 1MB (0x100000) || spl+uboot || 0x0000000-0x0100000 : “uboot”&lt;br /&gt;
|-&lt;br /&gt;
| mtd1 || 64KB (0x10000) || dtb文件 || 0x0100000-0x0110000 : “dtb”&lt;br /&gt;
|-&lt;br /&gt;
| mtd2 || 4MB (0x400000) || linux内核 || 0x0110000-0x0510000 : “kernel”&lt;br /&gt;
|-&lt;br /&gt;
| mtd3 || 剩余 (0xAF0000) || 根文件系统 || 0x0510000-0x1000000 : “rootfs”&lt;br /&gt;
|}&lt;br /&gt;
Nano F1C100S - https://whycan.cn/t_2179.html&lt;br /&gt;
 ID  SIZE    USAGE   ADDR&lt;br /&gt;
 0   448kb   U-boot  0x0000 0000 - 0x0007 0000&lt;br /&gt;
 1   64kb    dtb     0x0007 0000 - 0x0008 0000&lt;br /&gt;
 2   4mb     kernel  0x0008 0000 - 0x0048 0000&lt;br /&gt;
 3   7.5mb   rootfs  0x0048 0000 - 0x00c0 0000&lt;br /&gt;
 4   4mb     overlay 0x00c0 0000 - 0x0100 0000   &lt;br /&gt;
&lt;br /&gt;
* Structure 2&lt;br /&gt;
* 0x0 u-boot &lt;br /&gt;
* 0x40000 dtb -&amp;gt; device tree &lt;br /&gt;
* 0x50000 kernel -&amp;gt; kernel &lt;br /&gt;
* 0x510000 rootfs -&amp;gt; root file system&lt;br /&gt;
&lt;br /&gt;
== Pack Image Firmware ==&lt;br /&gt;
===二进制bin 打包 Zero V3S ===&lt;br /&gt;
以16M 大小flash镜像打包脚本为例：&lt;br /&gt;
 dd if=/dev/zero of=flashimg.bin bs=1M count=16 &amp;amp;&amp;amp;\&lt;br /&gt;
 dd if=$YOUR_UBOOT_FILE of=flashimg.bin bs=1K conv=notrunc &amp;amp;&amp;amp;\&lt;br /&gt;
 dd if=$YOUR_DTB_FILE of=flashimg.bin bs=1K seek=1024  conv=notrunc &amp;amp;&amp;amp;\&lt;br /&gt;
 dd if=$YOUR_KERNEL_FILE of=flashimg.bin bs=1K seek=1088  conv=notrunc &amp;amp;&amp;amp;\&lt;br /&gt;
 mkdir rootfs&lt;br /&gt;
 tar -xzvf $YOUR_ROOTFS_FILE -C ./rootfs &amp;amp;&amp;amp;\&lt;br /&gt;
 cp -r $YOUR_MOD_FILE  rootfs/lib/modules/ &amp;amp;&amp;amp;\&lt;br /&gt;
 # 为根文件系统制作jffs2镜像包&lt;br /&gt;
 # --pad参数指定 jffs2大小&lt;br /&gt;
 # 由此计算得到 0x1000000(16M)-0x10000(64K)-0x100000(1M)-0x400000(4M)=0xAF0000&lt;br /&gt;
 mkfs.jffs2 -s 0x100 -e 0x10000 --pad=0xAF0000 -d rootfs/ -o jffs2.img &amp;amp;&amp;amp;\&lt;br /&gt;
 dd if=jffs2.img of=$YOUR_IMG_FILE  bs=1K seek=5184  conv=notrunc &amp;amp;&amp;amp;\&lt;br /&gt;
以上脚本通过对一个生成的16M空bin文件填充 uboot、dtb、kernel、rootfs 生成 16M 镜像，如需修改，请注意各个文件的大小，修改成对应地址（注意对齐）。&amp;lt;br&amp;gt;&lt;br /&gt;
至此，SPI系统各部分已编译完成，通过sunxi-fel进行烧写即可；&lt;br /&gt;
&lt;br /&gt;
== Debug - Segment Fault ==&lt;br /&gt;
=== Core Dump ===&lt;br /&gt;
* https://licheezero.readthedocs.io/zh/latest/%E5%BA%94%E7%94%A8/debug.html&lt;br /&gt;
&lt;br /&gt;
== Toolchain Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Pre install ===&lt;br /&gt;
* sudo apt install build-essential checkinstall zlib1g-dev libssl-dev flex bison libncurses5-dev -y&lt;br /&gt;
Buildroot&lt;br /&gt;
* apt-get install linux-headers-$(uname -r)&lt;br /&gt;
&lt;br /&gt;
=== Toolchain ===&lt;br /&gt;
* Install [[ARM GCC]]&lt;br /&gt;
Normal on PC&lt;br /&gt;
* gcc: gcc -o helloword helloword.c&lt;br /&gt;
Openwrt&lt;br /&gt;
* openwrt compiler: /openwrt/staging_dir/toolchain_mispel_...../bin/mispel-openwrt-linux-gcc -o helloword hellworld.c&lt;br /&gt;
* to fix error - environment error'STAGING_DIR'not defined, run - export STAGING_DIR=/openwrt/staging_dir/&lt;br /&gt;
* to set openwrt complier absoulte directory run - nano /etc/environment, add directory path after &amp;quot;:&amp;quot;, run - source environment to make it work, finall command will be '''mispel-openwrt-linux-gcc'''&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* USB Gadget - https://linux-sunxi.org/USB_Gadget&lt;br /&gt;
* Reference - https://www.thirtythreeforty.net/posts/2019/12/my-business-card-runs-linux/&lt;br /&gt;
* Starting linux - https://www.cnblogs.com/schips/p/11393234.html&lt;br /&gt;
LPI&lt;br /&gt;
&lt;br /&gt;
* https://licheezero.readthedocs.io/zh/latest/%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91/bsp_index.html&lt;br /&gt;
Full process Zero V3S&lt;br /&gt;
* https://whycan.cn/t_3138.html&lt;br /&gt;
&lt;br /&gt;
[[category: Linux]]&lt;/div&gt;</summary>
		<author><name>Chao</name></author>
	</entry>
</feed>