Syscall compatibility
2 posts
• Page 1 of 1
Syscall compatibility
Why does calling system calls like
work with an SH4, but why
not?
I guess its the use of the adresses, but I want to be sure
.
- Code: Select all
typedef char*(*sc_cpv)(void);
const unsigned int sc0135[] = { 0xD201D002, 0x422B0009, 0x80010070, 0x0135 };
#define ML_vram_adress (*(sc_cpv)sc0135)
work with an SH4, but why
- Code: Select all
static int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
static int (*SysCall)( int R4, int R5, int R6, int R7, int FNo ) = (void*)&SysCallCode;
char* ML_vram_adress()
{
return (char*)((*SysCall)(0, 0, 0, 0, 309));
}
not?
I guess its the use of the adresses, but I want to be sure

- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Syscall compatibility
Color me amazed!
This worked for me:
const int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
Obviously an issue of the MPU7305's Memory Management Unit (MMU).
Running code from virtual mapped RAM seems to lead to mayhem on fx-9860(SH-4)-types.
The statements
static int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
and outside of any function:
int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
will place SysCallCode into static RAM, which is virtualized.
If you place the code onto stack, which is not virtualized, the calculator does not crash.
They seem to have activated some access protection function of the MMU/TLB on the fx-9860(SH-4)-types.
This worked for me:
const int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
Obviously an issue of the MPU7305's Memory Management Unit (MMU).
Running code from virtual mapped RAM seems to lead to mayhem on fx-9860(SH-4)-types.
The statements
static int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
and outside of any function:
int SysCallCode[] = {0xD201422B,0x60F20000,0x80010070};
will place SysCallCode into static RAM, which is virtualized.
If you place the code onto stack, which is not virtualized, the calculator does not crash.
They seem to have activated some access protection function of the MMU/TLB on the fx-9860(SH-4)-types.
I'll be back!
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests