示例#1
0
            public static ServerObject LoadServer(string name)
            {
                Process p = GetProcessByName(name);

                if (p == null)
                {
                    if (Program.Vfs == null)
                    {
                        return(null);
                    }
                    lib.MonoIOError err;
                    Formatter.WriteLine("LoadServer: opening /modules/" + name, Program.arch.DebugOutput);
                    lib.File f = lib.MonoIO.Open("/modules/" + name,
                                                 System.IO.FileMode.Open, System.IO.FileAccess.Read,
                                                 System.IO.FileShare.Read, System.IO.FileOptions.None,
                                                 out err);
                    if (f == null || f.Error != lib.MonoIOError.ERROR_SUCCESS)
                    {
                        throw new Exception("failed to open /modules/" + name + ": " +
                                            f.Error.ToString());
                    }

                    Formatter.WriteLine("LoadServer: creating process", Program.arch.DebugOutput);
                    p = Process.CreateProcess(f, name, new object[] { });
                    p.Start();
                }
                Formatter.WriteLine("LoadServer: waiting on message loop to start", Program.arch.DebugOutput);
                while (p.MessageServer == null)
                {
                    ;
                }
                return(p.MessageServer);
            }
示例#2
0
文件: Process.cs 项目: jncronin/tysos
        public static Process CreateProcess(lib.File file, string name, object [] parameters)
        {
            /* Create a process from an ELF module in a file object */

            ulong epoint = elf.ElfFileReader.LoadObject(Program.arch.VirtualRegions,
                                                        Program.arch.VirtMem, Program.stab, file, name, out var tls_size);

            return(Create(name, epoint, 0x8000, Program.arch.VirtualRegions, Program.stab,
                          parameters, tls_size));
        }
示例#3
0
            public static Interfaces.IFileSystem LoadServerInstance(string protocol, lib.File f)
            {
                Formatter.WriteLine("LoadServerInstance: loading server " + protocol, Program.arch.DebugOutput);

                var factory = LoadServer(protocol) as Interfaces.IFactory;

                Formatter.WriteLine("LoadServer: Invoking CreateFSHandler", Program.arch.DebugOutput);
                var ret = factory.CreateFSHandler(f).Sync();

                if (ret == null)
                {
                    throw new Exception("CreateFSHandler failed");
                }

                return(ret);
            }
示例#4
0
文件: rootfs.cs 项目: jncronin/tysos
 public RPCResult <int> Write(tysos.lib.File f, long pos, byte[] dest, int dest_offset, int count)
 {
     f.Error = lib.MonoIOError.ERROR_WRITE_FAULT;
     return(0);
 }
示例#5
0
文件: rootfs.cs 项目: jncronin/tysos
 public RPCResult <bool> Close(lib.File handle)
 {
     return(true);
 }
示例#6
0
文件: rootfs.cs 项目: jncronin/tysos
 public RPCResult <tysos.lib.File.Property> GetPropertyByName(lib.File f, string name)
 {
     return(((lib.VirtualPropertyFile)f).GetPropertyByName(name));
 }
示例#7
0
文件: rootfs.cs 项目: jncronin/tysos
 public RPCResult <int> IntProperties(tysos.lib.File f)
 {
     return(((lib.VirtualPropertyFile)f).intProperties);
 }