Ignore:
Timestamp:
Nov 19, 2020, 11:45:52 PM (3 years ago)
Author:
alain
Message:

1) Introduce up to 4 command lines arguments in the KSH "load" command.
These arguments are transfered to the user process through the
argc/argv mechanism, using the user space "args" vseg.

2) Introduce the named and anonymous "pipes", for inter-process communication
through the pipe() and mkfifo() syscalls.

3) Introduce the "chat" application to validate the two above mechanisms.

4) Improve printk() and assert() fonctions in printk.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_display.c

    r664 r670  
    5858    else if( type == DISPLAY_FAT               ) return "FAT";
    5959    else if( type == DISPLAY_SOCKET            ) return "SOCKET";
     60    else if( type == DISPLAY_FD                ) return "FD";
     61    else if( type == DISPLAY_WINDOWS           ) return "WINDOWS";
    6062    else                                         return "undefined";
    6163}
     
    500502
    501503#if DEBUG_SYSCALLS_ERROR
    502 printk("\n[ERROR] in %s SOCKET : pid %x not found\n", __FUNCTION__ , pid );
     504printk("\n[ERROR] in %s for SOCKET : pid %x not found\n", __FUNCTION__ , pid );
    503505#endif
    504506                this->errno = EINVAL;
     
    513515
    514516#if DEBUG_SYSCALLS_ERROR
    515 printk("\n[ERROR] in %s SOCKET : fdid %d not found\n", __FUNCTION__ , fdid );
     517printk("\n[ERROR] in %s for SOCKET : fdid %d not found\n", __FUNCTION__ , fdid );
    516518#endif
    517519                this->errno = EINVAL;
     
    528530            // display socket descriptor on TXT0
    529531            socket_display( XPTR( file_cxy , socket ), NULL );
     532
     533            break;
     534        }
     535        ////////////////
     536        case DISPLAY_FD:
     537        {
     538            pid_t   pid   = (pid_t)arg0;
     539
     540            // get extended pointer on owner process descriptor
     541            xptr_t owner_xp = cluster_get_owner_process_from_pid( pid );
     542
     543            if( owner_xp == XPTR_NULL )
     544            {
     545
     546#if DEBUG_SYSCALLS_ERROR
     547printk("\n[ERROR] in %s for FD : pid %x not found\n", __FUNCTION__ , pid );
     548#endif
     549                this->errno = EINVAL;
     550                return -1;
     551            }
     552
     553            // display fd_array on TXT0
     554            process_fd_display( owner_xp );
     555
     556            break;
     557        }
     558        /////////////////////
     559        case DISPLAY_WINDOWS:
     560        {
     561            pid_t   pid   = (pid_t)arg0;
     562
     563            if( pid != 0 )  // only one target process
     564            {
     565                // get extended pointer on owner process descriptor
     566                xptr_t owner_xp = cluster_get_owner_process_from_pid( pid );
     567
     568                if( owner_xp == XPTR_NULL )
     569                {
     570
     571#if DEBUG_SYSCALLS_ERROR
     572printk("\n[ERROR] in %s for FD : pid %x not found\n", __FUNCTION__ , pid );
     573#endif
     574                    this->errno = EINVAL;
     575                    return -1;
     576                }
     577            }
     578
     579            // display windows state for one, or for all processes
     580            dev_fbf_display_windows( pid );
    530581
    531582            break;
Note: See TracChangeset for help on using the changeset viewer.