1. 程式人生 > >skyeye模擬uboot啟動linux(initrd方式)

skyeye模擬uboot啟動linux(initrd方式)

bootelf命令:啟動vmlinux

bootm命令:啟動uImage

go命令:啟動zImage

前言:連結指令碼

  使用者態程式不用關心section的具體位置;在使用者態,核心會解析elf可執行檔案的各個section、然後把它對映到虛擬地址空間。

  然而,uboot和linux核心的啟動都是從零開始的;所以,需要在編譯時指定連結地址、而連結地址一般在lds檔案中確定(連結器通過讀取lds配置檔案來決定)。

vmlinux(這個vmlinux屬於未壓縮,帶除錯資訊、符號表的最初的核心)的入口地址:

kernel/arch/arm/kernel/vmlinux.lds

OUTPUT_ARCH(arm)
ENTRY(stext)
SECTIONS
{
 . = 0xC0008000;

kernel/arch/arm/kernel/head.S

ENTRY(stext)

zImage(由壓縮後的vmlinux和自解壓縮程式組成)的入口地址:

kernel/arch/arm/boot/compressed/vmlinux.lds

OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
  . = 0;

kernel/arch/arm/boot/compressed/head.S

start:

說明:將zImage新增64Bytes的相關資訊後就為uImage

=================================================================================================================================

以下附上skyeye1.2.6的下載地址(之前的skyeye1.2.8在uboot啟動核心時有些問題):

一、下載linux-2.6.14

二、編譯linux-交叉編譯器arm-linux-gcc-3.4.1

交叉編譯器下載地址:

http://ishare.iask.sina.com.cn/f/10838407.html

1.基本配置

修改頂層Makefile:

ARCH ?= arm
CROSS_COMPILE ?= /home/lianxi/skyeye/usr/local/arm/3.4.1/bin/arm-linux-

生成核心配置檔案:

make smdk2410_defconfig

2.新增網絡卡驅動

cs8900.c cs8900.h   //具體可以在網上查詢,這裡不羅列

將上述檔案拷貝至drivers/net/arm/

drivers/net/arm/Kconfig新增如下:

config ARM_CS8900
        tristate "CS8900 support"
        depends on NET_ETHERNET && ARM && ARCH_SMDK2410
        help
          Support for CS8900A chipset based Ethernet cards. If you have a network
          (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available
          from as well as .To compile this driver as a module, choose M here and read.
          The module will be called cs8900.o.

drivers/net/arm/Makefile新增如下:

obj-$(CONFIG_ARM_CS8900) += cs8900.o
修改arch/arm/mach-s3c2410/mach-smdk2410.c
//add by tankai
#include <asm-arm/arch-s3c2410/smdk2410.h>
//end tankai
static struct map_desc smdk2410_iodesc[] __initdata = {
  /* nothing here yet */
  //add by tankai
  /* Map the ethernet controller CS8900A */
  {vSMDK2410_ETH_IO,pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}
  //end tankai
};

新增include/asm-arm/arch-s3c2410/smdk2410.h

#ifndef _INCLUDE_SMDK2410_H_
#define _INCLUDE_SMDK2410_H_
#include <linux/config.h>
#define pSMDK2410_ETH_IO 0x19000000
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_ETH_IRQ IRQ_EINT9
#endif

3.其他重要修改

修改include/asm-arm/arch-s3c2410/map.h include/asm-arm/arch/map.h include/asm/arch/map.h include/asm/arch/arch-s3c2410/map.h

//#define S3C2410_CS6 (0x30000000)
#define S3C2410_CS6 (0xC0000000)
修改include/asm-arm/arch-s3c2410/memory.h include/asm-arm/arch/memory.h include/asm/arch/memory.h include/asm/arch/arch-s3c2410/memory.h
//#define PHYS_OFFSET (0x30000000UL)
#define PHYS_OFFSET (0xC0000000UL)
修改arch/arm/kernel/head.S
ENTRY(stext)
        //add by tankai
        mov    r0, #0
        mov    r1, #0xc1
        ldr    r2, =0x30000100
        //end tankai
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
4.配置核心
make menuconfig

核心啟動引數(這個是我們記憶體盤根檔案系統的載入路徑,要跟配置檔案s3c2410.conf中一樣):

Boot options->Default kernel command string

mem=32M console=ttySAC0 root=/dev/ram initrd=0xc1000000,0x00600000 ramdisk_size=8192 rw

新增網絡卡驅動:

Device Drivers->Network device support->Ethernet (10 or 100Mbit)->CS8900 support

支援RamDisk記憶體盤(因為initrd需要):

Device Drivers->Block devices->RAM disk support

(4096) Default RAM disk size (kbytes)改成(8192) Default RAM disk size (kbytes)

Device Drivers->Block devices->Initial RAM disk (initrd) support 

NFS檔案系統支援:

File systems->Network File Systems->NFS file system support

File systems->Network File Systems->Provide NFSv3 client support

ROM檔案系統支援:

File systems->ROM file system support

ext2檔案系統支援:

File systems->Second extended fs support

5.編譯

make -j2

生成vmlinux

三、製作根檔案系統-交叉編譯器arm-linux-gcc-3.4.1

1.下載busybox-1.9.2

http://download.csdn.net/download/eqwewr/3154108

2.編譯

修改頂層Makefile:

ARCH ?= arm
CROSS_COMPILE ?= /home/lianxi/skyeye/usr/local/arm/3.4.1/bin/arm-linux-

設定靜態編譯:

make menuconfig

Busybox Settings->Build Options->Build BusyBox as a static binary (no shared libs) 

編譯錯誤:
applets/applets.c:15:2: warning: #warning Static linking against glibc produces buggy executables
applets/applets.c:16:2: warning: #warning (glibc does not cope well with ld --gc-sections).
applets/applets.c:17:2: warning: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
applets/applets.c:18:2: warning: #warning Note that glibc is unsuitable for static linking anyway.
applets/applets.c:19:2: warning: #warning If you still want to do it, remove -Wl,--gc-sections
applets/applets.c:20:2: warning: #warning from scripts/trylink and remove this warning.
applets/applets.c:21:2: #error Aborting compilation.
make[1]: *** [applets/applets.o] 錯誤 1
make: *** [applets] 錯誤 2

解決:

applets/applets.c

//#error Aborting compilation.

scripts/trylink

去掉-Wl,--gc-sections

3.安裝

make install

錯誤:

modutils/lib.a(insmod.o)(.text.insmod_main+0x4f0): In function `insmod_main':
: undefined reference to `query_module'
modutils/lib.a(insmod.o)(.text.insmod_main+0x52c): In function `insmod_main':
: undefined reference to `query_module'
modutils/lib.a(insmod.o)(.text.insmod_main+0x5d8): In function `insmod_main':
: undefined reference to `query_module'
modutils/lib.a(insmod.o)(.text.insmod_main+0x628): In function `insmod_main':
: undefined reference to `query_module'
modutils/lib.a(insmod.o)(.text.insmod_main+0x6f4): In function `insmod_main':
: undefined reference to `query_module'
modutils/lib.a(insmod.o)(.text.insmod_main+0x1118): In function `$a':
: undefined reference to `create_module'
collect2: ld returned 1 exit status
make: *** [busybox_unstripped] 錯誤 1

解決:make menuconfig

去掉Linux Module Utilities->Support version 2.2.x to 2.4.x Linux Kernels

最終結果:在頂層目錄下生成_install目錄。

4.製作initrd格式的檔案系統

建立映象並掛載到initrd目錄:

mkdir initrd
dd if=/dev/zero of=initrd.img bs=1k count=4096
mke2fs -F -v initrd.img
mount -o loop initrd.img initrd

新增命令到該映象:

cd initrd
cp -r ../busybox-1.9.2/_install/* .

建立必要目錄:

mkdir proc lib etc dev root home var tmp
chmod 777 tmp

建立裝置節點:

cd dev
mknod -m 644 console c 5 1
mknod -m 644 null c 1 3
mknod -m 640 ram b 1 1
mknod -m 644 mem c 1 1
cd ..

建立指令碼檔案etc/inittab,內容如下:

::sysinit:/etc/init.d/rcS
::askfirst:-/bin/sh
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

chmod 644 etc/inittab

建立指令碼檔案etc/init.d/rcS, 內容如下:
#!/bin/sh
/bin/mount -t proc none /proc
/sbin/ifconfig lo 127.0.0.1 up
/sbin/ifconfig eth0 10.0.0.2 netmask 255.0.0.0 up
hostname skyeye
mkdir /var/tmp
mkdir /var/log
mkdir /var/run 
mkdir /var/lock
/bin/ash
chmod 755 etc/init.d/rcS

執行實際的寫入操作,生成initrd.img

cd ..
umount initrd

四、uboot部分修改u-boot-2011.12

1.交叉編譯器——arm-linux-gcc-4.4.3

uboot/arch/arm/config.mk

CROSS_COMPILE ?= /home/lianxi/skyeye/opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-

2.dcache問題

uboot/arch/arm/lib/cache-cp15.c
void dcache_enable(void)
{
  //cache_enable(CR_C);
}
void dcache_disable(void)
{
  //cache_disable(CR_C);
}

uboot/arch/arm/cpu/arm920t/start.S

#define CONFIG_SKIP_LOWLEVEL_INIT //add by tankai

五、實際執行

1.硬體配置檔案s3c2410.conf

#skyeye config file sample
cpu: arm920t
mach: s3c2410x
###########################################################################
mem_bank: map=M, type=RW, addr=0x00000000, size=0x01000000, file=./u-boot.bin, boot=yes
mem_bank: map=M, type=RW, addr=0x30000000, size=0x04000000
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x01000000, file=./vmlinux
mem_bank: map=M, type=RW, addr=0xc1000000, size=0x00600000, file=initrd.img
mem_bank: map=M, type=RW, addr=0xc1600000, size=0x00a00000
##########################################################################
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
#mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
#net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
#lcd:type=s3c2410x,mod=gtk
dbct:state=on

2.執行

skyeye -c s3c2410.conf

結果:
**************************** WARNING **********************************
If you want to run ELF image, you should use -e option to indicate
your elf-format image filename. Or you only want to run binary image,
you need to set the filename of the image and its entry in skyeye.conf.
***********************************************************************


Your elf file is little endian.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2 
mach info: name s3c2410x, mach_init addr 0x427070
dbct info: turn on dbct!
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM   ./u-boot.bin
Loaded RAM   ./vmlinux
Loaded RAM   initrd.img
TK-------uboot/arch/arm/lib/board.c>>>board_init_f
ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff
ERROR: s3c2410x_io_write_word(0x4c000008) = 0x00048032




U-Boot 2011.12 (Nov 08 2013 - 09:03:37)


DRAM:  64 MiB
TK--------uboot/arch/arm/lib/board.c>>>board_init_r
TK--------uboot/arch/arm/lib/board.c>>>board_init_r>>call>>enable_caches()
WARNING: Caches not enabled
TK-------uboot/arch/arm/lib/cache-cp15.c>>>>cache_enable
TK--------uboot/arch/arm/lib/cache-cp15.c>>>dcache_enable
TK--------uboot/arch/arm/lib/cache-cp15.c>>>>>dcache_enable>>>11111
Flash: 1 MiB
NAND:  ERROR: s3c2410x_io_write_word(0x4e000000) = 0x00008377
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
ERROR: s3c2410x_io_write_word(0x4e000004) = 0x000000ff
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
raise: Signal # 8 caught
raise: Signal # 8 caught
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
ERROR: s3c2410x_io_write_word(0x4e000004) = 0x00000090
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
ERROR: s3c2410x_io_write_word(0x4e000008) = 0x00000000
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
raise: Signal # 8 caught
raise: Signal # 8 caught
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
ERROR: s3c2410x_io_write_word(0x4e000004) = 0x00000090
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
ERROR: s3c2410x_io_write_word(0x4e000008) = 0x00000000
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xfffff7ff
raise: Signal # 8 caught
raise: Signal # 8 caught
No NAND device found!!!
ERROR: s3c2410x_io_write_word(0x4e000000) = 0xffffffff
0 MiB
*** Warning - bad CRC, using default environment


In:    serial
Out:   serial
Err:   serial
Net:   CS8900-0
Warning: failed to set MAC address


SMDK2410 #

在uboot啟動後,輸入:bootelf 0xc0000000啟動核心:

SMDK2410 # bootelf 0xc0000000
TK---------uboot/common/cmd_elf.c>>>>>do_bootelf
TK---------uboot/common/cmd_elf.c>>>>>do_bootelf>>>>addr is 0xc0000000
## Starting application at 0xc0008000 ...
TK----->>>kernel/init/main.c>>>>>>start_kernel
Linux version 2.6.14 ([email protected]) (gcc version 3.4.1) #32 Fri Nov 8 11:00:06 CST 2013
CPU: ARM920Tid(wb) [41009200] revision 0 (ARMvundefined/unknown)
Machine: SMDK2410
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410 (id 0x32410000)
S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
S3C2410 Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists
Kernel command line: mem=32M console=ttySAC0 root=/dev/ram initrd=0xc1000000,0x00600000 ramdisk_size=8192 rw
irq: clearing pending status 00004000
irq: clearing pending status 00008000
irq: clearing pending status 00800000
irq: clearing pending status 10000000
irq: clearing subpending status 00000093
PID hash table entries: 256 (order: 8, 4096 bytes)
timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 32MB = 32MB total
Memory: 24332KB available (1505K code, 277K data, 92K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
TK-----kernel/init/initramfs.c>>>>__initramfs_start is 0xc001c560
TK-----kernel/init/initramfs.c>>>>__initramfs_end is 0xc001c5e6
TK-------kernel/init/initramfs.c>>>>>unpack_to_rootfs
TK-------kernel/init/initramfs.c>>>>>unpack_to_rootfs>>>>>11111,len is 134
TK-------kernel/init/initramfs.c>>>>>unpack_to_rootfs>>>>>2222
TK-----kernel/init/initramfs.c>>>>>err is 0x0
checking if image is initramfs...TK----kernel/init/initramfs.c>>>>>initrd_start is 0xc1000000
initrd_end is 0xc1600000
TK-------kernel/init/initramfs.c>>>>>unpack_to_rootfs
TK-------kernel/init/initramfs.c>>>>>unpack_to_rootfs>>>>>11111,len is 6291456
TK-------kernel/init/initramfs.c>>>>>unpack_to_rootfs>>>>>2222
it isn't (bad gzip magic numbers); looks like an initrd
softlockup thread 0 started up.
Freeing initrd memory: 6144K
NET: Registered protocol family 16
S3C2410: Initialising architecture
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: incorrect signature 0x0000
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 4096KiB [1 disk] into ram disk... done.
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 92K
init started: BusyBox v1.9.2 (2013-11-05 10:11:12 CST)
starting pid 15, tty '': '/etc/init.d/rcS'
ifconfig: SIOCSIFADDR: No such device
/bin/ash: can't access tty; job control turned off
# 

相關推薦

skyeye模擬uboot啟動linuxinitrd方式

bootelf命令:啟動vmlinux bootm命令:啟動uImage go命令:啟動zImage 前言:連結指令碼   使用者態程式不用關心section的具體位置;在使用者態,核心會解析elf可執行檔案的各個section、然後把它對映到虛擬地址空間。   然而,u

TI OMAPL138E Linux移植 (Davinci) 資源獲取+從串列埠啟動UBoot+從網路啟動Linux與檔案系統

Date: 2018-02-08【1、從實際硬體上獲取主晶片型號為TI的OMAPL138E 】,所屬系列為OMAPL1,編譯預設配置為davinci或者da850。《以下內容失效》《《《2、登陸TI官方WiKi網站wiki.ti.com,在網頁下方找到General Info

linux安裝svn服務器yum方式

說明 clear -c 空間 orm 是否 user tables linu p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #fff

linuxcentos6.5下部署springboot jar包用 *.sh 檔案啟動專案並將專案做成開機自啟動服務

版權宣告:轉載請註明出處。 原文作者:[email protected] 原文連結:https://blog.csdn.net/weixin_42389328/article/details/83104214 第一種方法:非自啟動方式 1.如果你使用的是maven來管理專案,執行以

JavaWeb專案啟動時,自動執行程式碼的三種方式包含不佔用tomcat啟動時長的方式

三種方式實現在tomcat啟動時執行某段程式碼 由於這三種方式的執行時長計算在tomcat的啟動時長裡,如果tomcat設定了啟動超時時間,那麼這三種方式執行的操作很可能會讓tomcat啟動超時。 為了解決自動執行的部分不影響tomcat的正常啟動我們可以在三種方式中新建一個執行

linux centos6.8 安裝svn伺服器yum方式

1.檢視yum是否安裝          在終端中輸入yum即可如果已經安裝,會顯示yum的引數          如果沒有安裝,會提示yum未安裝或無效命令…… 2.安裝svn yu

linux下安裝jdkrmp方式

一、初次在linux中安裝jdk(若以前裝過,需要先解除安裝舊的jdk) 以下命令在/usr/java目錄下執行 mkdir /usr/java cd /usr/java 1.安裝wget命令 yum -y install wget 2.下載jdk1.8安

linux啟動啟動過程基於MBR

前言: 因為uefi的出現,bios分為legacy bios和uefi bios,下文中,我們不做這個劃分,統一叫做bios。 這篇文章先說基於MBR的啟動過程,然後再說基於比較新的GPT的啟動過程,linux啟動啟動過程(基於GPT)。 第一步:電腦上電,執行bios程式(這段程式是

樹莓派設定開機自啟動服務方式 以vncserver為例

1、為了下一步準備 這裡需要一個設定:(開啟樹莓派設定) sudo raspi-config 選擇5.Interfacing Options  找到VNC(遠端桌面)  選擇 Yes(是)enable 然後sudo reboot 重啟後重新連線ssh 此為命令

Uboot啟動流程——u-boot.lds

.lds為連結指令碼 我們平時寫的程式碼也會有連結(ld)過程;x86下面輸入ld -verbose可以檢視連結指令碼 uboot生成映象也是需要lds的,下面為lds部分內容: OUTPUT

VisualVM監控遠端Linux主機上的JAVA應用程式JMX方式

我本地是Windows系統,Windows+r,輸入cmd,進入黑視窗輸入Jvisualvm,回車 同時彈出視覺化監控介面 VisualVM可以監控本地JVM執行情況,也可以監控遠端機器上的JVM執行情況。 本地監控無需配置,只要開啟某個JAVA程式就會自動的加入到本地

linux上安裝並啟動redis原始碼安裝

最近從阿里租了臺雲伺服器玩玩,隨手記錄下在linux伺服器上原始碼安裝redis的過程安裝前準備:由於redis底層用c語言編寫的,安裝redis需要先將官網下載的原始碼進行編譯,編譯依賴gcc環境,如果沒有gcc環境,需要安裝gcc:yum install gcc-c++安

ARM Linux啟動流程分析——start_kernel前啟動階段彙編部分

本文整理了ARM Linxu啟動流程的第二階段——start_kernel前啟動階段(彙編部分),核心版本為3.12.35。我以手上的樹莓派b(ARM11)為平臺示例來分析Linux核心在自解壓後到跳轉執行start_kernel之前所做的主要初始化工作:包括引數有效性驗證

linux :關閉tomcat埠命令方式

 複雜方式pstree -aup|grep tomcat # 列舉執行中的tomcat kill -9 PID # 殺死指定埠的tomcat簡單方式linux 使用命令關閉tomcat 的8080埠命

ubuntu開機啟動Mongo指令碼以及使用root許可權執行的指令碼快捷方式

環境: ubuntu 16.04 Gogland root許可權啟動指令碼 mongo開機啟動指令碼 正文: 關於開機執行指令碼 1. 在容器中新增開機啟動指令碼,編寫指令碼mongo.sh

uboot啟動linux核心小結(boot,bootd,boom,bootcmd,bootargs)

uboot在進行系統啟動和核心載入的時候被分為倆個階段, 第一階段主要是寫彙編程式碼,我沒有仔細研究,只是看了看移植好的針對mini2440的tekkman的uboot程式碼。 第二個階段為由C寫成

LINUX安裝JDK1.8wget方式

找到JDK下載URL 注:新版本可以在這裡嘗試尋找。 使用wget下載 執行wget命令(然後等待下載完成。如果網速不行,就換個方式吧): wget --no-check-certifica

linux安裝jdk環境多種方式

rdquo epo export red 上傳 usr 權限 wget 表示 linux系統通用安裝通過tar.gz壓縮包安裝此方法適用於絕大部分的linux系統 1、先下載tar.gz的壓縮包,這裏使用官網下載。 進入: http://www.oracle.com/tec

Python 3.5 連接Mysql數據庫pymysql 方式

ima 用戶名 oca rim 遊標對象 ide char 名稱 etc 由於 MySQLdb 模塊還不支持 Python3.x,官方的Mysql連接包只支持到3.4,所以 Python3.5 如果想連接MySQL需要安裝 pymysql 模塊。 pymysql 模塊可以通

Sequelize 定義 n:m 關系import 方式

function cas data ping urn double lin fun class 附上3張表的結構 albums 專題表 CREATE TABLE `albums` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nam