示例#1
0
文件: net.cs 项目: jncronin/tysos
        public override bool InitServer()
        {
            tysos.Syscalls.ProcessFunctions.RegisterSpecialProcess(this,
                                                                   tysos.Syscalls.ProcessFunctions.SpecialProcessType.Net);

            // Register handlers for devices
            while (tysos.Syscalls.ProcessFunctions.GetVfs() == null)
            {
                ;
            }
            vfs = tysos.Syscalls.ProcessFunctions.GetVfs();

            vfs.RegisterAddHandler("class", "netdev", tysos.Messages.Message.MESSAGE_NET_REGISTER_DEVICE, true);

            /* Start protocol handlers */
            var _arp = new arp();

            tysos.Process p_arp = tysos.Process.CreateProcess("arp",
                                                              new System.Threading.ThreadStart(_arp.MessageLoop),
                                                              new object[] { _arp });
            p_arp.Start();
            arp = _arp;

            ipv4 _ipv4 = new ipv4();

            tysos.Process p_ipv4 = tysos.Process.CreateProcess("ipv4",
                                                               new System.Threading.ThreadStart(_ipv4.MessageLoop),
                                                               new object[] { _ipv4 });
            p_ipv4.Start();

            return(true);
        }
示例#2
0
        public override bool InitServer()
        {
            // Register handlers for devices
            while (tysos.Syscalls.ProcessFunctions.GetVfs() == null)
            {
                ;
            }
            vfs = tysos.Syscalls.ProcessFunctions.GetVfs();

            vfs.RegisterAddHandler("class", "framebuffer", tysos.Messages.Message.MESSAGE_GUI_REGISTER_DISPLAY, true);
            vfs.RegisterAddHandler("class", "input", tysos.Messages.Message.MESSAGE_GUI_REGISTER_INPUT, true);

            return(true);
        }