Subversion Repositories HelenOS

Rev

Rev 3606 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3606 Rev 4377
Line 47... Line 47...
47
 
47
 
48
// Temporary: service and method names
48
// Temporary: service and method names
49
#include "proto.h"
49
#include "proto.h"
50
#include <ipc/services.h>
50
#include <ipc/services.h>
51
#include "../../srv/vfs/vfs.h"
51
#include "../../srv/vfs/vfs.h"
52
#include "../../srv/console/console.h"
52
#include <ipc/console.h>
53
 
53
 
54
#include "syscalls.h"
54
#include "syscalls.h"
55
#include "ipcp.h"
55
#include "ipcp.h"
56
#include "errors.h"
56
#include "errors.h"
57
#include "trace.h"
57
#include "trace.h"
Line 517... Line 517...
517
{
517
{
518
    loader_t *ldr;
518
    loader_t *ldr;
519
    int rc;
519
    int rc;
520
 
520
 
521
    /* Spawn a program loader */   
521
    /* Spawn a program loader */   
522
    ldr = loader_spawn(path);
522
    ldr = loader_connect();
523
    if (ldr == NULL)
523
    if (ldr == NULL)
524
        return 0;
524
        return 0;
525
 
525
 
526
    /* Get task ID. */
526
    /* Get task ID. */
527
    rc = loader_get_task_id(ldr, task_id);
527
    rc = loader_get_task_id(ldr, task_id);
Line 621... Line 621...
621
    val_type_t resp_def[OPER_MAX_ARGS] = {
621
    val_type_t resp_def[OPER_MAX_ARGS] = {
622
        V_INTEGER,
622
        V_INTEGER,
623
        V_INTEGER,
623
        V_INTEGER,
624
        V_INTEGER,
624
        V_INTEGER,
625
        V_INTEGER,
625
        V_INTEGER,
626
        V_INTEGER      
626
        V_INTEGER
627
    };
627
    };
628
 
628
 
629
    next_thread_id = 1;
629
    next_thread_id = 1;
630
    paused = 0;
630
    paused = 0;
631
 
631
 
Line 640... Line 640...
640
    proto_add_oper(p, VFS_TRUNCATE, o);
640
    proto_add_oper(p, VFS_TRUNCATE, o);
641
    o = oper_new("mount", 2, arg_def, V_ERRNO, 0, resp_def);
641
    o = oper_new("mount", 2, arg_def, V_ERRNO, 0, resp_def);
642
    proto_add_oper(p, VFS_MOUNT, o);
642
    proto_add_oper(p, VFS_MOUNT, o);
643
/*  o = oper_new("unmount", 0, arg_def);
643
/*  o = oper_new("unmount", 0, arg_def);
644
    proto_add_oper(p, VFS_UNMOUNT, o);*/
644
    proto_add_oper(p, VFS_UNMOUNT, o);*/
-
 
645
    o = oper_new("open", 2, arg_def, V_INT_ERRNO, 0, resp_def);
-
 
646
    proto_add_oper(p, VFS_OPEN, o);
-
 
647
    o = oper_new("close", 1, arg_def, V_ERRNO, 0, resp_def);
-
 
648
    proto_add_oper(p, VFS_CLOSE, o);
-
 
649
    o = oper_new("seek", 3, arg_def, V_ERRNO, 0, resp_def);
-
 
650
    proto_add_oper(p, VFS_SEEK, o);
-
 
651
    o = oper_new("mkdir", 1, arg_def, V_ERRNO, 0, resp_def);
-
 
652
    proto_add_oper(p, VFS_MKDIR, o);
-
 
653
    o = oper_new("unlink", 0, arg_def, V_ERRNO, 0, resp_def);
-
 
654
    proto_add_oper(p, VFS_UNLINK, o);
-
 
655
    o = oper_new("rename", 0, arg_def, V_ERRNO, 0, resp_def);
-
 
656
    proto_add_oper(p, VFS_RENAME, o);
645
 
657
 
646
    proto_register(SERVICE_VFS, p);
658
    proto_register(SERVICE_VFS, p);
647
 
659
 
648
    p = proto_new("console");
660
    p = proto_new("console");
-
 
661
    resp_def[0] = V_INTEGER; resp_def[1] = V_INTEGER;
649
    resp_def[0] = V_CHAR;
662
    resp_def[2] = V_INTEGER; resp_def[3] = V_CHAR;
650
    o = oper_new("getchar", 0, arg_def, V_INTEGER, 2, resp_def);
663
    o = oper_new("getkey", 0, arg_def, V_ERRNO, 4, resp_def);
651
    proto_add_oper(p, CONSOLE_GETCHAR, o);
664
    proto_add_oper(p, CONSOLE_GETKEY, o);
652
 
665
 
653
    arg_def[0] = V_CHAR;
666
    arg_def[0] = V_CHAR;
654
    o = oper_new("putchar", 1, arg_def, V_VOID, 0, resp_def);
667
    o = oper_new("putchar", 1, arg_def, V_VOID, 0, resp_def);
655
    proto_add_oper(p, CONSOLE_PUTCHAR, o);
668
    proto_add_oper(p, CONSOLE_PUTCHAR, o);
-
 
669
    o = oper_new("write", 0, arg_def, V_VOID, 0, resp_def);
-
 
670
    proto_add_oper(p, CONSOLE_WRITE, o);
656
    o = oper_new("clear", 0, arg_def, V_VOID, 0, resp_def);
671
    o = oper_new("clear", 0, arg_def, V_VOID, 0, resp_def);
657
    proto_add_oper(p, CONSOLE_CLEAR, o);
672
    proto_add_oper(p, CONSOLE_CLEAR, o);
658
 
673
 
659
    arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER;
674
    arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER;
660
    o = oper_new("goto", 2, arg_def, V_VOID, 0, resp_def);
675
    o = oper_new("goto", 2, arg_def, V_VOID, 0, resp_def);
Line 664... Line 679...
664
    o = oper_new("getsize", 0, arg_def, V_INTEGER, 2, resp_def);
679
    o = oper_new("getsize", 0, arg_def, V_INTEGER, 2, resp_def);
665
    proto_add_oper(p, CONSOLE_GETSIZE, o);
680
    proto_add_oper(p, CONSOLE_GETSIZE, o);
666
    o = oper_new("flush", 0, arg_def, V_VOID, 0, resp_def);
681
    o = oper_new("flush", 0, arg_def, V_VOID, 0, resp_def);
667
    proto_add_oper(p, CONSOLE_FLUSH, o);
682
    proto_add_oper(p, CONSOLE_FLUSH, o);
668
 
683
 
669
    arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER;
684
    arg_def[0] = V_INTEGER;
670
    o = oper_new("set_style", 2, arg_def, V_INTEGER, 0, resp_def);
685
    o = oper_new("set_style", 1, arg_def, V_VOID, 0, resp_def);
671
    proto_add_oper(p, CONSOLE_SET_STYLE, o);
686
    proto_add_oper(p, CONSOLE_SET_STYLE, o);
-
 
687
    arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER; arg_def[2] = V_INTEGER;
-
 
688
    o = oper_new("set_color", 3, arg_def, V_VOID, 0, resp_def);
-
 
689
    proto_add_oper(p, CONSOLE_SET_COLOR, o);
-
 
690
    arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER;
-
 
691
    o = oper_new("set_rgb_color", 2, arg_def, V_VOID, 0, resp_def);
-
 
692
    proto_add_oper(p, CONSOLE_SET_RGB_COLOR, o);
672
    o = oper_new("cursor_visibility", 1, arg_def, V_VOID, 0, resp_def);
693
    o = oper_new("cursor_visibility", 1, arg_def, V_VOID, 0, resp_def);
673
    proto_add_oper(p, CONSOLE_CURSOR_VISIBILITY, o);
694
    proto_add_oper(p, CONSOLE_CURSOR_VISIBILITY, o);
674
 
695
 
675
    proto_console = p;
696
    proto_console = p;
676
    proto_register(SERVICE_CONSOLE, p);
697
    proto_register(SERVICE_CONSOLE, p);