wake-0 / fhvOS

This repository contains an os for the arm cortex a8 in combination with beaglebone.
GNU General Public License v2.0
7 stars 1 forks source link

[SysCalls] Refactor swi handler in interrupt.asm to handle system calls #69

Closed ghost closed 9 years ago

ghost commented 9 years ago

the most suitable way the handle system calls on a ARM system is by calling software interrupts (swi). this is done simply by one line of inline assembler: asm(" SWI #any_int_number"); in any_int_number the number of the desired system call can be handed over. this number is then located in the R0 processor register. the big advantage of the swi-calls is that it includes switches to privileged mode.

the change I will do to the swi handler is the following: save registers R0-R14 adjust stack pointer get handed over any_int_number if any_int_number is in range 0 - 64 (system call numbers) call system call handler after system call handler was executed: switch back to user mode restore register

FYI: this ticket is related to ticket #31

ghost commented 9 years ago

above commit implements all for the system calls needed changes to the swi handler.