mirror of
https://github.com/tonytins/tomas.git
synced 2025-06-25 10:04:43 -04:00
Return of kernal programs
- Boot log is now cleared - File scoped namespaces work
This commit is contained in:
parent
7530f8500b
commit
a06f9ccc9f
9 changed files with 136 additions and 94 deletions
|
@ -6,47 +6,46 @@ using Cosmos.System.FileSystem;
|
|||
using Cosmos.System.FileSystem.VFS;
|
||||
using Tomas.Common;
|
||||
|
||||
namespace Tomas.Kernel
|
||||
namespace Tomas.Kernel;
|
||||
|
||||
class TomFS
|
||||
{
|
||||
class TomFS
|
||||
{
|
||||
public const string ROOT_DIR = "0:\\";
|
||||
public static string SYSTEM_DIR = $"{ROOT_DIR}\\SYSTEM\\";
|
||||
public const string ROOT_DIR = "0:\\";
|
||||
public static string SYSTEM_DIR = $"{ROOT_DIR}\\SYSTEM\\";
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
var fs = new CosmosVFS();
|
||||
VFSManager.RegisterVFS(fs);
|
||||
fs.CreateDirectory(SYSTEM_DIR);
|
||||
Console.WriteLine("Creating system files.");
|
||||
fs.CreateFile($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine("Setting system preferences.");
|
||||
File.WriteAllText($"{SYSTEM_DIR}sysinfo.txt", $"{ComConsts.NAME}, {ComConsts.VersionGit}");
|
||||
Console.WriteLine("File system loaded sucesfully.");
|
||||
var intro = File.ReadAllText($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine(intro);
|
||||
public static void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
var fs = new CosmosVFS();
|
||||
VFSManager.RegisterVFS(fs);
|
||||
fs.CreateDirectory(SYSTEM_DIR);
|
||||
Console.WriteLine("Creating system files.");
|
||||
fs.CreateFile($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine("Setting system preferences.");
|
||||
File.WriteAllText($"{SYSTEM_DIR}sysinfo.txt", $"{ComConsts.NAME}, {ComConsts.VersionGit}");
|
||||
Console.WriteLine("File system loaded sucesfully.");
|
||||
var intro = File.ReadAllText($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine(intro);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("File system failed to load! Not all functions will work.");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("File system failed to load! Not all functions will work.");
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] ListDirectories(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dirs = Directory.GetDirectories(path);
|
||||
return dirs;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Failed to find any directories.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static string[] ListDirectories(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dirs = Directory.GetDirectories(path);
|
||||
return dirs;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Failed to find any directories.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue