@oitofelix: I want that it stays compatible. The last time I tested the kernel with the RTE loader from Sony, it was working. This is possible when keeping the limited memory range and putting the additonal code into the kernel. There is much more memory available. This way it will also work with Sony's Linux Toolkit. It is also possible to load new IRX modules via the Linux kernel (Linux firmware interface). There can be also an auto-detection of the module version like /kernelloader/TGE/sbios/mc.c (see smod_get_mod_by_name()). An example for the different interface is the smaprpc driver: /linux/linux-2.6.35.4-mipsel-ps2/drivers/ps2/smaprpc.c. It uses the ps2sif_bindrpc and ps2sif_callrpc for communication. This should be enough for most drivers. It would be good if the Linux interface would stay compatible and you just extend it, for example: The joystick driver should still work, the /proc/ps2pad and the name of the device nodes and the IOCTLs on it.
For testing purpose it is possible to extend the memory region, but please don't use it for the final version:
This is defined in the following files:
Code:
linux-2.6.35.4-mipsel-ps2/arch/mips/Makefile:669:load-$(CONFIG_SONY_PS2) += 0x80010000
linux-2.6.35.4-mipsel-ps2/arch/mips/ps2/setup.c:156: add_memory_region(0x00010000, 0x01ff0000, BOOT_MEM_RAM);
kernelloader/loader/loader.c:1946: if (check_sections("SBIOS", sbios, sbios_size, 0x1000, 0x10000, NULL) != 0) {
kernelloader/loader/loader.c:1979: if (sbios_size < (0x10000 - ((int) strlen(ps2_console_type)) - 1)) {
kernelloader/loader/loader.c:2021: if (check_sections("kernel", buffer, kernel_size, 0x10000, lowestAddress, &highest) != 0) {
kernelloader/TGE/sbios/linkfile:6: mem(RWX) : ORIGIN = 0x80001000, LENGTH = 0xF000
The F000 and the 10000 needs to be increased.
The string for storing the PS2 model number is stored behind SBIOS, but before 0x10000. There should be an additional space of 32 Byte between the end address and the 0x10000. I will make the size in the file kernelloader/TGE/sbios/linkfile smaller for this reason.
@archicharmer: The first argument of the SYSCALL_DEFINE macros is the name of the syscall. This is not a structure. For mips_mmap the tested type is "off_t" and not "mips_mmap". off_t is the type of the parameter "offset". I don't know if this type has a different size in the 32/64 Bit kernel versions. "unsigned long" is the type of the other parameters. I already veryfied that "unsigned long" is not different, so you need only to check "off_t". I would rename the function "get_stat_size9" to "get_off_t_size". "stat" was only name of the structure in some syscalls.
The preprocessor changes the following line:
SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags, unsigned long,
fd, off_t, offset)
to:
sys_mips_mmap(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long fd, off_t offset)
"sys_mips_mmap" is the function name. "addr", "len", "prot", "flags", "fd" and "offset" are the function parameters.
You can remove "get_stat_size198" because sys_cachectl doesn't contain parameters which change the size between the ABI versions:
SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op)
sys_cachectl(char * addr, int nbytes, int op)
You can also remove "get_stat_size246", because sys_set_thread_area doesn't contain a parameter which changes size between ABI versions:
SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
sys_set_thread_area(unsigned long addr)
I did already the following test:
int get_unsigned_long_size(void)
{
return sizeof(unsigned long);
}
So you don't need to repeat this for every occurance of "unsigned long".