uClinux porting HOWTO
uClinux is a popular port of the Linux operating system to processors without a MMU (Memory Management Unit). Kernel versions 2.0.x, 2.4.x, and 2.6.x are supported to varying degrees on numerous architectures.
The uClinux distribution contains the following main components: the uClinux kernel, various libraries and numerous linux utilities. In this article some of the tasks that need to be done to port the uClinux kernel to a new architecture are examined. The information is specific to the 2.4.x uClinux kernel and the Samsung S3C44B0X, a 32-bit processor with an ARM7TDMI core.
The latest uClinux distribution uClinux-dist-20040408, can be downloaded from here. The ELF ARM7 toolchain for uClinux can be downloaded from here.
Three are three main levels where porting is required. In the case where the processor core is not supported, a new architecture will have to be added in uclinux/linux-2.4.x/arch/. In our case, support for the ARM7TDMI architecture is already present in uclinux/linux-2.4.x/arch/armnommu/ considerably reducing the effort required to port uClinux to the s3c44b0x processor. At the second level, support for the particular processor (machine) is to be added using processor specific knowledge such as registers etc. Finally, support for the board containing the processor and peripherals need to be added. This will include adding support for devices on the board that are not yet supported by linux, or configuring existing device drivers.
The necessary files that need to be modified/created, in order to boot uClinux on the s3c44b0x processor are listed below. In order to interact with the console, a serial driver must be written. The driver for the s3c44b0x processor's builtin UART is not documented here.
Board & processor configuration:
uclinux/linux-2.4.x/arch/armnommu/config.in
uclinux/linux-2.4.x/arch/armnommu/Makefile
uclinux/linux-2.4.x/arch/armnommu/tools/mach-types
uclinux/linux-2.4.x/arch/armnommu/vmlinux-armv.lds.in
Assembly level startup code:
uclinux/linux-2.4.x/arch/armnommu/kernel/head-armv.S
uclinux/linux-2.4.x/arch/armnommu/mm/proc-arm6,7.S
uclinux/linux-2.4.x/arch/armnommu/kernel/entry-armv.S
Processor specific code:
uclinux/linux-2.4.x/arch/armnommu/mach-s3c44b0x/arch.c
uclinux/linux-2.4.x/arch/armnommu/mach-s3c44b0x/irq.c
uclinux/linux-2.4.x/arch/armnommu/mach-s3c44b0x/time.c
uclinux/linux-2.4.x/arch/armnommu/mach-s3c44b0x/dma.c
uclinux/linux-2.4.x/arch/armnommu/mach-s3c44b0x/Makefile
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/hardware.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/io.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/irq.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/irqs.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/keyboard.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/memory.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/param.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/processor.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/shmparam.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/system.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/time.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/timex.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/uncompress.c
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/uncompress.h
uclinux/linux-2.4.x/include/asm-armnommu/arch-s3c44b0x/vmalloc.h
uclinux/linux-2.4.x/include/asm-armnommu/proc-armv/system.h
Support for peripherals on the board (or builtin to the processor):
uclinux/linux-2.4.x/drivers/block/blkmem.c
Board specific configuration:
uclinux/Makefile
uclinux/vendors/ACME/SOHO-B0X/config.arch
uclinux/vendors/ACME/SOHO-B0X/config.linux-2.4.x
uclinux/vendors/ACME/SOHO-B0X/config.uClibc
uclinux/vendors/ACME/SOHO-B0X/config.vendor-2.4.x
uclinux/vendors/ACME/SOHO-B0X/inittab
uclinux/vendors/ACME/SOHO-B0X/Makefile
uclinux/vendors/ACME/SOHO-B0X/motd
uclinux/vendors/ACME/SOHO-B0X/passwd
uclinux/vendors/ACME/SOHO-B0X/rc
uclinux/vendors/ACME/SOHO-B0X/motd
uclinux/vendors/ACME/SOHO-B0X/inittab
uclinux/vendors/ACME/SOHO-B0X/passwd
uclinux/vendors/ACME/SOHO-B0X/config.arch
uclinux/vendors/ACME/SOHO-B0X/config.linux-2.4.x
uclinux/vendors/ACME/SOHO-B0X/config.uClibc
uclinux/vendors/ACME/SOHO-B0X/config.vendor-2.4.x
Comments:
Post a comment:
Thanks your article. It is wonderful and gives me a lot of detail information.Very helpful for me. I am a beginner of this field. Now I am porting the uclinux step by step according to your article.
Now, I have a question. In the last part of this article, it said" copy 3 .config files from the other directory to the folder /ACME/SOHO-BOX. But I didn't find these three files in the default uClinux-dist package. I found vendors/Samsung/4510B has such 3 files. But in the header of these 3 files, it is written "Automatically generated make config". I think it is supposed not to be changed by manually. But when I tried "make config", there is no step to let me customize the kernel and just suggested me to copy one config.linux-2.4.x from other place. Could you tell me how to resolve this issue? Thank you.
Raine