From 072450222595085703d2304a727ec206f255541b Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Wed, 25 Feb 2026 16:51:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=AC=A6=E6=93=8D=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BuildTime.txt | 2 +- GitCommit.txt | 2 +- Kernel.cs | 4 ++-- System/FileSystem.cs | 33 +++++++++++++++++++++++++-------- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/BuildTime.txt b/BuildTime.txt index 6a237aa..30b21b7 100644 --- a/BuildTime.txt +++ b/BuildTime.txt @@ -1 +1 @@ -2026-02-25 15:29:49 \ No newline at end of file +2026-02-25 16:45:43 \ No newline at end of file diff --git a/GitCommit.txt b/GitCommit.txt index 56f70bc..cd4b2e6 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -9b783e0 \ No newline at end of file +87d30be \ No newline at end of file diff --git a/Kernel.cs b/Kernel.cs index 5aed79e..305bf5e 100644 --- a/Kernel.cs +++ b/Kernel.cs @@ -71,8 +71,8 @@ namespace CMLeonOS } Console.Clear(); - Console.WriteLine("Kernel load done!"); - Console.WriteLine(@"----------------------------------------------------------"); + // Console.WriteLine("Kernel load done!"); + // Console.WriteLine(@"----------------------------------------------------------"); Console.WriteLine(@" ____ __ __ _ ___ ____ "); Console.WriteLine(@" / ___| \/ | | ___ ___ _ __ / _ \/ ___| "); Console.WriteLine(@" | | | |\/| | | / _ \/ _ \| '_ \| | | \___ \ "); diff --git a/System/FileSystem.cs b/System/FileSystem.cs index dfe512e..6c796d5 100644 --- a/System/FileSystem.cs +++ b/System/FileSystem.cs @@ -16,7 +16,7 @@ namespace CMLeonOS private static bool ContainsInvalidChars(string input) { - char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*' }; + char[] invalidChars = { '<', '>', '"', '|', '?', '*' }; foreach (char c in invalidChars) { if (input.Contains(c.ToString())) @@ -59,6 +59,18 @@ namespace CMLeonOS return; } + if (path == @"0:\") + { + currentDirectory = @"0:\"; + return; + } + + if (path == @"1:\") + { + currentDirectory = @"1:\"; + return; + } + string fullPath = GetFullPath(path); try @@ -414,6 +426,11 @@ namespace CMLeonOS return path; } + if (path.StartsWith(@"1:\")) + { + return path; + } + if (path == ".") { return currentDirectory; @@ -421,16 +438,16 @@ namespace CMLeonOS if (path == "..") { - if (currentDirectory == @"0:\") + if (currentDirectory == @"0:\" || currentDirectory == @"1:\") { - return @"0:\"; + return currentDirectory; } else { int lastSlash = currentDirectory.LastIndexOf('\\'); - if (lastSlash == 2) // 0:\ + if (lastSlash == 2) // 0:\ or 1:\ { - return @"0:\"; + return currentDirectory.Substring(0, 3); } else { @@ -441,7 +458,7 @@ namespace CMLeonOS if (path.StartsWith("../") || path.StartsWith("..\\")) { - if (currentDirectory == @"0:\") + if (currentDirectory == @"0:\" || currentDirectory == @"1:\") { Console.WriteLine("Error: Cannot go above root directory"); return currentDirectory; @@ -472,9 +489,9 @@ namespace CMLeonOS for (int i = 0; i < level; i++) { int lastSlash = resultPath.LastIndexOf('\\'); - if (lastSlash == 2) // 0:\ + if (lastSlash == 2) // 0:\ or 1:\ { - resultPath = @"0:\"; + resultPath = resultPath.Substring(0, 3); } else {