I am interested in messing around with the SWI handlers on ARM Linux. According to the ARM instruction set, when a system call is made, a SWI (Software Interrupt) should be executed to switch the processor from user mode into supervisor mode. I am interested in seeing the actual SWI instruction when this happens, and playing with it in various ways,
e.g., changing the location in the interrupt-vector table where the ARM switches to for a specific system call. I do see that the SWIs (about 321 system calls and some private SWIs) are listed in /usr/include/asm-arm/unistd.h on the gumstix Linux distribution.
I disassembled a simple hello world working program (using "objdump") containing a printf() statement and I don't see an explicit SWI instruction for the printf. I also looked at the assembler version of the same program (basically, the output of "gcc -S
hello.c") and a system call such as printf is invoked in assembly through a "BL printf".
For those interested, I am using a gumstix basix 400xm-bt.
Finally, my reason for trying to do this is that I'm exploring how to use the gumstix to teach an embedded-systems course where I would like students to learn about the ARM architecture's low-level internals (
e.g., how switching from user to privileged modes is actually accomplished) using the gumstix as the platform for teaching the course. Ultimately, the students will end up writing C code for a lot of their lab programs, but I would like them to know how things work "under the hood" first.