Hi all, I have designed my own 8 bit preemptive OS for the Silicon Labs controller C8051F120. I am using the LX51 Linker and the file L51_BANK.A51, modified it according to the sample in the silicon labs website. The ?B_MODE EQU 4 And the switch macros are as follows. PSBANK DATA 0B1H SWITCH0 MACRO MOV PSBANK, #00h ENDM SWITCH1 MACRO MOV PSBANK, #11h ENDM SWITCH2 MACRO MOV PSBANK, #22h ENDM SWITCH3 MACRO MOV PSBANK, #33h ENDM one of the line says that when using RTX OS the User mode bank switching is not supported. This has led to my doubts. What are ther things i need to add in my OS to provide support for CODE BANKING. I was in the impression that the linker takes care of this ...Kinldy let me know. thanks and regards pachu
When the RTOS switches to a new task (this is called rescheduling) it must change the program counter to the new address to start executing. With code banking, the code bank for the current task must be saved and the code bank for the task that is to run must be selected. Jon
Hello Jon, Oh yes you are right.....:-) i missed this. when i do a task switch, i do save the context, and load the PC with the current tasks address.... When i do context switch practically i dont know in which bank i am working with....i need to take care of this. I mean, assme there are 3 tasks each in a seperate bank, and each of them call each other. There is both intra and inter bank calls. When i start a task from from scheduler, how will i know from which bank it is ? and when i want to switch to another task how can i identify from which bank is the next runnable task ? Is is possible to find out at run time, in which bank i am operating ? thanks and regards pachu