Cygwin环境下的基于Mips构架的Linux移植(3)

[2009.8.14]
1. 在arch/mips/下创建am-mips文件夹,并在里面增加板级相关文件(可先简单的复制某个可用板里面的文件过来)
2. 修改arch/mips/Kconfig,加入类似于以下语句,增加board config:
 config AM_MIPS
 bool "Actions-micro 120X"
 select ARCH_MAY_HAVE_PC_FDC
 select BOOT_ELF32
 select BOOT_RAW
 select CEVT_R4K
 select CSRC_R4K
 select DMA_NONCOHERENT
 select GENERIC_ISA_DMA
 select IRQ_CPU
 select IRQ_GIC
 select HW_HAS_PCI
 select I8253
 select I8259
 select MIPS_BOARDS_GEN
 select MIPS_BONITO64
 select MIPS_CPU_SCACHE
 select PCI_GT64XXX_PCI0
 select MIPS_MSC
 select SWAP_IO_SPACE
 select SYS_HAS_CPU_MIPS32_R1
 select SYS_HAS_CPU_MIPS32_R2
 select SYS_HAS_EARLY_PRINTK
 select SYS_SUPPORTS_32BIT_KERNEL
 select SYS_SUPPORTS_LITTLE_ENDIAN
 select SYS_SUPPORTS_MIPS_CMP if BROKEN # because SYNC_R4K is broken
 select SYS_SUPPORTS_MULTITHREADING
 select SYS_SUPPORTS_SMARTMIPS
 help
   If you want this kernel to run on actions-micro 120X workstation, say Y here.
3. 修改arch/mips/Makefile,在里面增加对应的编译设置,如下:
 #
 # AM-MIPS
 #
 # Set the load address to >= 80069000 if you want to leave space for symmon,
 # 0x80004000 for production kernels.  Note that the value must be aligned to
 # a multiple of the kernel stack size or the handling of the current variable
 # will break.
 #
 core-$(CONFIG_AM_MIPS)  += arch/mips/am-mips/
 cflags-$(CONFIG_AM_MIPS) += -Iinclude/asm-mips/mach-am
 load-$(CONFIG_AM_MIPS)  += 0x80004000
4. 在arch/mips/下创建mach-am文件夹,并在里面增加板级相关头文件(可先简单的复制某个可用板里面的头文件过来)
5. 然后就可以依次运行
 make mrproper
 make config //选择对应的option
 make        //生成最终kernel的elf文件

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwpszg.html