code cat 2012. 11. 8. 11:34

a port of BSD C library to linux kernel with the following additions/changes:

- no support fo locales

- no support for wide chars (multi-byte characters)

- own smallish implementation of pthreads based on Linux futexes

- support fo x86, ARM, and ARM thumb cpu instruction sets and kernel interfaces

 

To add new syscalls:

Bionic provides the 'gensyscalls.py' script to automatically generate syscall stubs from the list defined in the file 'SYSCALLS.TXT'

To add a new syscall:

1. SYSCALL.TXT 수정

2. syscall에 대한 새로운 라인 추가:

return_type syscall_name(parameters)    syscall_number

3. syscall function과 entry name을 구분 짓고 싶으면:

return_type funcname:syscall_name(parameters)    syscall_number

4. 추가로 syscall number가 ARM 과 x86끼리 다르면,

return_type funcname[:syscall_name](parameters)    arm_number, x86_number

5. 플랫폼에 syscall이 구현안되었다고 나타내려면 -1을 사용하라.

void __set_tls(void*)    arm_number, -1     (예제)

 

자세한 내용은 SYSCALLS.TXT를 참조하고, 'checksyscalls.py'를 사용하여, syscall number를 제대로 사용하였는지 체크할 수도 있다.(리눅스 커널 헤더들안의 숫자와 비교한다.)