Skip to content

Commit

Permalink
little more
Browse files Browse the repository at this point in the history
  • Loading branch information
PratyushKing committed Jul 5, 2023
1 parent d3b9c35 commit a6b7ba1
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
43 changes: 42 additions & 1 deletion FalconOS/FalconOS/Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ public void exec(string cmd)
Console.WriteLine("Disk Space: " + data.fs.GetTotalFreeSpace("0:\\") + "/" + data.fs.GetTotalSize("0:\\"));
Console.WriteLine("Virtual Machine? [VirtualBox/VMWare/QEMU]: " + Sys.VMTools.IsVirtualBox + "/" + Sys.VMTools.IsVMWare + "/" + Sys.VMTools.IsQEMU);
Console.WriteLine("Disks Count: " + data.fs.Disks.Count.ToString());
} else if (cmd.StartsWith("sysctl proclist"))
{
Console.WriteLine("Processes(" + data.ProcMgr.processes.Count + "):");
foreach (var process in data.ProcMgr.processes)
{
Console.WriteLine(process);
}
} else if (cmd.StartsWith("sysctl"))
{
Console.WriteLine("Invalid Args");
Expand Down Expand Up @@ -125,7 +132,7 @@ public void exec(string cmd)
data.currentDir.TrimEnd(data.lastDir.ToCharArray());
data.lastDir = data.currentDir;
return;
}
}
if (cmd.StartsWith("cd ..."))
{
data.currentDir = "0:\\";
Expand All @@ -139,6 +146,37 @@ public void exec(string cmd)
{
Console.WriteLine("Invalid Directory!");
}
} else if (cmd.StartsWith("uname"))
{
Console.WriteLine("uname v1.0 utility");
if (cmd.StartsWith("uname "))
{
if (cmd.StartsWith("uname -a"))
{
log.programPrint("uname", data.osname + " " + data.vername + " " + data.ver);
} else if (cmd.StartsWith("uname -s"))
{
log.programPrint("uname", "Falcon Stable");
} else if (cmd.StartsWith("uname -n"))
{
log.programPrint("uname", "falcon");
} else if (cmd.StartsWith("uname -r"))
{
log.programPrint("uname", "1.0.1-normal");
} else if (cmd.StartsWith("uname -v"))
{
log.programPrint("uname", "Not available.");
} else if (cmd.StartsWith("uname -m") || cmd.StartsWith("uname -p") || cmd.StartsWith("uname -i"))
{
log.programPrint("uname", "Can't fetch architecture");
} else if (cmd.StartsWith("uname -o"))
{
log.programPrint("uname", "Falcon");
} else
{
log.programPrint("uname", "Unrecognized Command!");
}
}
}
else if (cmd.StartsWith("ls"))
{
Expand Down Expand Up @@ -249,6 +287,9 @@ public void exec(string cmd)
Console.WriteLine("FalCompile is a FalVM compiler to compile .fal files to .fex [Falcon Executable]");
Console.WriteLine("Uses:\n falcp <file>.fa (to get a <file>.fex file that is compiled)\n falcp --help/-h (to get this prompt)");
}
} else if (cmd.StartsWith("pwd"))
{
Console.WriteLine(data.currentDir);
}
else
{
Expand Down
4 changes: 4 additions & 0 deletions FalconOS/FalconOS/data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ internal class data
public static string currentDir = @"0:\";
public static string lastDir = @"0:";

public static string osname = "FalconOS";
public static string vername = "Ape";
public static string ver = "v1.0.1";

public static processMgr ProcMgr;
}
}

0 comments on commit a6b7ba1

Please sign in to comment.