Esempio n. 1
0
        /// <summary>
        /// Initializes VFS
        /// </summary>
        public static void Init()
        {
            // Container of all mountpoints
            RootMountPoint = new ContainerFS();

            // DevFS
            MountPointDevFS = new ContainerFS();
            RootPoint devMount = new RootPoint("devices", MountPointDevFS.Node);

            RootMountPoint.AddEntry(devMount);

            // NetFS
            MountPointNetFS = new ContainerFS();
            RootPoint netMount = new RootPoint("net", MountPointNetFS.Node);

            RootMountPoint.AddEntry(netMount);

            // Initialize other filesystems
            initFileSystems();

            Console.WriteLine("[VFS] Initialized");
        }
Esempio n. 2
0
        /// <summary>
        /// Set sound Device
        /// </summary>
        /// <param name="device"></param>
        public static void SetDevice(SoundDevice device)
        {
            // TODO: support multiple audio devices
            m_device = device;

            Node node = new Node();

            node.Open  = openImpl;
            node.Write = writeImpl;
            node.Close = closeImpl;

            RootPoint point = new RootPoint("default", node);

            m_container.AddEntry(point);
        }
Esempio n. 3
0
        /// <summary>
        /// Load devices
        /// </summary>
        public static unsafe void LoadDevices()
        {
            for (int i = 0; i < Pci.DeviceNum; i++)
            {
                PciDevice dev  = Pci.Devices[i];
                string    name = GenerateNodeName(dev.Bus, dev.Slot, dev.Function);

                Node node = new Node();
                node.Size   = (uint)sizeof(PciFSInfo);
                node.Read   = readImpl;
                node.Flags  = NodeFlags.FILE | NodeFlags.DEVICE;
                node.Cookie = new PciDeviceCookie(dev);

                RootPoint point = new RootPoint(name, node);
                m_container.AddEntry(point);
            }
        }