Having played around with Busybox a bit, I was ready to go in and change around some settings, break some stuff, and hopefully put it back together in a more portable and optimized package, ready for anything the near future could throw at it!
My first order of business was to search the code for- Inline assembler calls that can be replaced with high level code C/C++, etc for portability and platform independence
- Inline assembler calls that can be replaced with atomic constructs in C/C++, etc for portability and platform independence
- Malloc and free memory calls that can be replaced by RESERVE_CONFIG_BUFFER/RELEASE_CONFIG_BUFFER by auditing the system calls and using the CONFIG_BUFFER mechanism – this is an issue that is still pending so any comments / help will be appreciated.
I identified the following files (with associated code) for the first two items detailed above:
root/include/libbb.h
root/shell/ash.c
root/procps/powertop.c
root/e2fsprogs/blkid/probe.h
My plan is to use some PTHREAS library codes to replace the
#define barrier() __asm__ __volatile__(“”:::”memory”)
inline assembler with C/C++ code in the root/include/libbb.h and root/shell/ash.c files. I’m also looking at changing the code for byte swap routine in the root/e2fsprogs/blkid/probe.h file with some atomic code.
Any thoughts on the matter are welcome!