123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- Some notes to help future porters. Replace 'ARCH' with whatever arch
- you are hacking on.
- ====================
- === Config Files ===
- ====================
- - create extra/Configs/Config.ARCH
- See the other arch files for some good examples. powerpc/sparc/alpha
- should be pretty simple templates.
- - add ARCH to the 'Target Architecture' list in extra/Configs/Config.in
- - Initially you will want to disable shared libraries, since making
- the shared library loader work requires you first have basic architecture
- support working. Thus you should add ARCH_HAS_NO_SHARED and
- ARCH_HAS_NO_LDSO to Config.ARCH's TARGET_ARCH
- ====================
- === libc sysdeps ===
- ====================
- (note: if glibc has already been ported to your arch, you can usually just
- copy a lot of files from them rather than coding from scratch)
- - create libc/sysdeps/linux/ARCH
- - copy Makefile and Makefile.arch from libc/sysdeps/linux/i386/
- - set CSRC and SSRC to nothing in Makefile.arch for now
- - create crt1.S which defines the _start function ... you will probably want
- to clear the frame pointer to make gdb happy, and then you will want to call
- the funcion __uClibc_main() which takes these parameters:
- __uClibc_main(main(), argc, argv, _init(), _fini())
- Initially if you wish to make things easier on yourself, you can disable the
- UCLIBC_CTOR_DTOR option and just set the init/fini arguments to NULL.
- glibc generally stores this function in libc/sysdeps/ARCH/elf/start.S
- - create these additional files in ARCH/bits/
- (template versions can be found in common/bits/ for you to tweak)
- endian.h fcntl.h setjmp.h stackinfo.h uClibc_arch_features.h wordsize.h
- kernel_types.h should be created based upon linux asm-ARCH/posix_types.h
- copy linux asm-ARCH/stat.h to bits/kernel_stat.h
- create syscalls.h based upon linux's unistd.h / glibc's sysdeps.h ... really
- you just want to define the _syscall[0-6] macros. It is important that
- these syscalls should be PIC safe (or you should provide a PIC and non-PIC
- version) if you wish to properly support shared libraries.
- - at this point, you should have enough to generate a working HELLO WORLD
- static binary (see test/silly
|