Forum: PS2 Linux - Show your penguin pride. Discuss PS2 Linux (Official kit and Blackrhino) here!


The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the new info from
PSX-Scene in your email each day?




Want to learn more about the team keeping you up to date with the latest scene news?

Read about them now!

Check out our Developer bios, too!

 


User Tag List

Like Tree1Likes

Thread: Porting of Linux 2.6 to PS2
  

Page 19 of 42 FirstFirst ... 9 17 18 19 20 21 29 ... LastLast
Results 181 to 190 of 413
  1. #181 waste 
    archicharmer is offline Member
    Join Date
    Sep 2010
    Posts
    215
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    3
    Likes Received
    2
    I found almost all SYSCALL_DEFINEs (only 10 from totally 287 not found) and did add get_stat_size№ function to each of them.

    and... same error

    Please, look, for example, at file arch/mips/kernel/syscall.c syscall.zip and find my fault

    What i done: i looking for SYSCALL_DEFINE of each syscall from scall32-n32.c and when function of SYSCALL_DEFINE is over, i place get_stat_size function there.
    Reply With Quote  

  2. #182  
    Mega Man's Avatar
    Mega Man is online now Member
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    519
    Downloads
    0
    Uploads
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    5
    Likes Received
    35
    @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".
    Reply With Quote  

  3. #183 good luck 
    archicharmer is offline Member
    Join Date
    Sep 2010
    Posts
    215
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    3
    Likes Received
    2
    Mega Man, here 60 files with SYSCALL_DEFINEs and get_stat_size functions

    whereis_n32.tar.bz2

    I didn't found defines of next syscalls:

    clone, fork, execve, flock, rt_sigsuspend, sigaltstack, ni_syscall, sysmips, remap_file_pages, rt_sigreturn

    The best that could made.

    oitofelix, if i'll give mips64r5900el-toolchain to you, can you do mips64r5900elO32 to it?

    -----------------------------------------------------------------------
    Mega Man, you are GENIUS! As oitofelix would said "All hail to GNU's creator"

    I run fedora by your vmlinux_v9 and... ! Saw Welcome to Fedora! But flash's flashing died after starting udev... But it very glad me!

    And i saw a lot of messages:
    /etc/rc.d/rc.sysinit: child setpgid (57 to 57): no such process

    I would ask you to create mass:/ps2linux/ps2linux_loop loader from fat32 mass storage with your busybox. Call it "initrd.usbloader.gz" and upload
    Last edited by archicharmer; 06-24-2012 at 06:03 AM.
    Reply With Quote  

  4. #184  
    Mega Man's Avatar
    Mega Man is online now Member
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    519
    Downloads
    0
    Uploads
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    5
    Likes Received
    35
    @archicharmer: Why do you repeat something 273 times when you see that it is not working at the first time? I said that you should remove function "get_stat_size198", but you didn't removed it. I already explained everything in detail. The challenge seems too big for you.
    I don't have the time to finish the busybox initrd. Everybody who needs somethings else needs to adapt it.
    Reply With Quote  

  5. #185  
    archicharmer is offline Member
    Join Date
    Sep 2010
    Posts
    215
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    3
    Likes Received
    2
    Quote Originally Posted by Mega Man
    The challenge seems too big for you
    agreed. Not so too... but big)

    Quote Originally Posted by Mega Man
    Why do you repeat something 273 times
    I wrote that post with already done these files. And decided (if i can't handle this) to upload needed files - if you would have time to working with n32 support - you find needed syscalls in them. But if you have no time even for adapting busybox initrd... Mega Man, you Busy Man) I can do it by myself... i wanted that everybody can download it. Useful thing.

    --------------------------------------------------------------------------------------------

    Done. Job for two evenings)

    I understood my mistake. At first message about function get_stat_size you wrote: return sizeof(struct stat). So i wrongly understood that: return sizeof(struct each_name_of_syscall). And after i understood that syscalls differ in o32/n32 because it's parameters do. So: return sizeof(parameter).

    todiff.tar.bz2

    need - list of syscalls that need to be fix (111 syscalls!). First column - name of file with SYSCALL_DEFINE, second column - number of different types of syscall that differ in o32/n32, third column - name of syscall;

    nodiff - list of types that have the same size in o32/n32;

    diff - list of types that have a different size in o32/n32. First column - type, second - size in 32, third - in 64;

    unknown location - list of syscalls, DEFINEs of which i do not found;

    Types are unknown or ??? - if type=name of one of syscalls - got that awful error. So i don't know about it's different and size.
    Attached Files
    Last edited by archicharmer; 06-27-2012 at 11:46 AM.
    Reply With Quote  

  6. #186  
    oitofelix is offline Member
    Join Date
    Jun 2010
    Posts
    20
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Originally posted by archicharmer:

    "oitofelix, if i'll give mips64r5900el-toolchain to you, can you do
    mips64r5900elO32 to it?"

    I'm not sure. But I need to finish the device drivers before anything
    else.

    Originally posted by archicharmer:

    "As oitofelix would said "All hail to GNU's creator""

    Sorry, I ever would say something like that.

    Now, about the Multitap Pad driver:

    A few days ago I moved the Multitap Pad SBIOS driver into kernel as
    Mega Man suggested. But, since then I have fought to make it work but
    it didn't.

    All goes fine when one initialize the RPC servers, like

    ps2sif_bindrpc (&cdataPortOpen, MTAPSERVER_PORT_OPEN, SIF_RPCM_NOWAIT,
    ps2mtap_rpcend_notify, (void *) &compl);

    but when I do my first call to open a port like this

    ps2sif_callrpc(&cdataPortOpen, RPC_NUMBER, SIF_RPCM_NOWAIT, (void *)
    ps2mtapRpcBuffer, SEND_SIZE, (void *) ps2mtapRpcBuffer, RECEIVE_SIZE,
    (ps2sif_endfunc_t) ps2mtap_rpcend_notify, (void *) &compl);

    the function return success (zero) but there isn't a reply in
    ps2mtapRpcBuffer[REPLY] and the port actually doesn't open. I have
    carefully read all function's definitions involved in that call and
    I'm pretty sure that it was proceeding like before with the SBIOS
    native interface. I have read the smap kernel driver also and I can't
    figure out what I'm doing wrong. Maybe there is a kernel side
    procedure to initialize a memory region (ps2mtapRpcBuffer) to
    communicate with the IRX module, or something like that, but I can't
    find it on smap driver.

    I know that it is very difficult to you help me since you don't have
    the source code at hands, but maybe I was missing something so trivial
    that you can help me. If you need some additional information I will
    be happy providing it. Any clues?

    Thanks in advance
    Reply With Quote  

  7. #187  
    Mega Man's Avatar
    Mega Man is online now Member
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    519
    Downloads
    0
    Uploads
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    5
    Likes Received
    35
    @oitofelix: ps2mtapRpcBuffer needs to be at least 16 Byte aligned. You need to use the functions including "complete" in the function name like in the example driver. You may need to use dma_cache_inv() if you transfer additional stuff which is not ps2mtapRpcBuffer.

    @archicharmer: I already verified that "unsigned long" has the same size for n32 and o32 ABI. For o64 this is different. I think this has only effect when it is used as pointer (with "*") or inside a structure. Can you please check again the simple types which are available in each C compiler (unsigned, int, long, char, float, double, short, unsigned long long, ...)? I want to know whether there is a difference between n32 and o32. Please use a simple program like this:
    Code:
    #include <stdio.h>
    
    int main(void)
    {
        printf("Size %u\n", sizeof(unsigned long));
        return 0;
    }
    I think there is no problem in the syscall getcwd:
    SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
    getcwd(char __user * buf, unsigned long size);
    I think "char" has the same size in n32/o32 and o64.
    "unsigned long" is different between o64 and o32, but it is stored in a CPU register. All syscall parameters are stored in a register if the type is simple and no pointer (no "*").
    I think this is different for parameters with a size larger than 4 Byte. Explanation:
    Code:
    void function(unsigned long long n);
    
    n32 ABI:
    03200008        jr      t9
    24041000        li      a0,4096
    
    o32 ABI:
    24041000        li      a0,4096
    03200008        jr      t9
    00002821        move    a1,zero
    The code above shows the disassembly of call:
    function(4096);
    n32 puts the 64 bit into one 64 bit register: a0
    o32 puts the 64 bit into two 32 bit register: a0 and a1

    All syscalls which include "unsigned long long" or "long long" as parameter type are incompatible. The current implementation in arch/mips/kernel/scall32-n32.S copies only the lower 32 bit to the stack. This works until the value is larger than the maximum value possible with 32 bit.
    Last edited by Mega Man; 07-02-2012 at 04:25 PM.
    Reply With Quote  

  8. #188  
    archicharmer is offline Member
    Join Date
    Sep 2010
    Posts
    215
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    3
    Likes Received
    2
    I did check all types by compiling 32-bit and 64-bit kernel and mips64el-unknown-linux-gnu-objdump -d vmlinux | grep -A 3 -e what_i_want.

    Quote Originally Posted by Mega Man
    I already verified that "unsigned long" has the same size for n32 and o32 ABI. For o64 this is different
    You want to say, that my "great" work is waste of time again?!?! I did checking size for o32 and o64???

    And now, i must to check all 287 syscalls AGAIN just with printf("Size %u\n", sizeof(what_want)). And you are sure, that it IS needed function for N32
    Reply With Quote  

  9. #189  
    Mega Man's Avatar
    Mega Man is online now Member
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    519
    Downloads
    0
    Uploads
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    5
    Likes Received
    35
    No, it was not waste of time. There is just more needed. You need only to check the 111 syscalls. Only check basic types without "*". This means no struct.
    Reply With Quote  

  10. #190  
    archicharmer is offline Member
    Join Date
    Sep 2010
    Posts
    215
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    3
    Likes Received
    2
    Checked simple types in debian-mipsel (-mabi=32) and in fedora-mips64el (-mabi=n32)
    Same size:
    Code:
    int 4
    char 1
    void 1
    const 4
    long 4
    long long 8
    const char 1
    unsigned 4
    unsigned int 4
    unsigned char 1
    unsigned long 4
    unsigned long long 8
    double 8
    short 2
    float 4
    And only type long double have 8 in 32 and 16 in n32


    Now, about types without "*" from list of need from todiff.tar.bz2

    Here, inside the kernel, i can't add printf.

    If i will creating files with printf and functions with types from kernel - it is IMPOSSIBLE to include what it need to compile. So, problem with using -mabi=n32. I can't using -mabi=n32 while kernel compiling too.

    And why only 111 syscalls - the syscalls from list of need? This list of syscalls of differ between o32 and o64. For example, long and unsigned long in o32/o64 have different size 4/8, but in o32/n32 same - 4.
    Reply With Quote  

Page 19 of 42 FirstFirst ... 9 17 18 19 20 21 29 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •