Compare commits

...

5 Commits

Author SHA1 Message Date
Leonmmcoset
ce90efeb3e 文档更新 2026-02-08 19:05:16 +08:00
Leonmmcoset
f0777b4e8b 以后就不需要再去PE格式化硬盘了,爽!! 2026-02-08 18:56:32 +08:00
Leonmmcoset
f63be62f27 磁盘1 2026-02-08 18:13:51 +08:00
Leonmmcoset
0e9e9f67a1 sudo rm -rf /* 2026-02-08 16:33:14 +08:00
Leonmmcoset
78502324e7 修复ls问题(但没有成功) 2026-02-08 13:12:55 +08:00
16 changed files with 153 additions and 38 deletions

119
Kernel.cs
View File

@@ -15,6 +15,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Sys = Cosmos.System;
@@ -38,6 +39,13 @@ namespace CMLeonOS
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.font.psf")]
public static readonly byte[] file;
public static void ShowError(string message)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"{message}");
Console.ResetColor();
}
protected override void BeforeRun()
{
@@ -242,20 +250,109 @@ namespace CMLeonOS
}
catch (Exception ex)
{
Console.Clear();
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.White;
Console.Clear();
Console.WriteLine(":(");
Console.WriteLine("A problem has been detected and CMLeonOS has been shutdown to prevent damage to your computer.");
Console.WriteLine($"Error information: {ex.Message}");
Console.WriteLine("If this is the first time you've seen this stop error screen, restart your computer and email to leonmmcoset@outlook.com WITH THE ERROR INFORMATION for technical support.");
Console.WriteLine("Press any keys to restart.");
Console.ReadKey();
Sys.Power.Reboot();
if (ex.Message.Contains("Read only"))
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.Clear();
var formatWindow = new CMLeonOS.UI.Window(
new CMLeonOS.UI.Rect(10, 5, 60, 12),
"Format Disk",
() => { },
true
);
formatWindow.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 8);
global::System.Console.Write("Disk not formatted");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Yellow, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 9);
global::System.Console.Write("Warning: This will erase all data!");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 11);
global::System.Console.Write("Press any key to format...");
global::System.Console.ReadKey();
try {
Disk targetDisk = fs.Disks[0];
CreateMBRandPartitionTable(targetDisk);
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
global::System.Console.Clear();
formatWindow.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 8);
global::System.Console.Write("Disk formatted successfully!");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 9);
global::System.Console.Write("Restarting in 3 seconds...");
System.Threading.Thread.Sleep(3000);
Sys.Power.Reboot();
}
catch (Exception exe)
{
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
global::System.Console.Clear();
formatWindow.Render();
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 8);
global::System.Console.Write("Format failed!");
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
global::System.Console.SetCursorPosition(12, 9);
global::System.Console.Write($"Error: {exe.Message}");
global::System.Console.ReadKey();
}
}
else{
Console.Clear();
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.White;
Console.Clear();
Console.WriteLine(":(");
Console.WriteLine("A problem has been detected and CMLeonOS has been shutdown to prevent damage to your computer.");
Console.WriteLine($"Error information: {ex.Message}");
Console.WriteLine("If this is the first time you've seen this stop error screen, restart your computer and email to leonmmcoset@outlook.com WITH THE ERROR INFORMATION for technical support.");
Console.WriteLine("Press any keys to restart.");
Console.ReadKey();
Sys.Power.Reboot();
}
// try {
// Disk targetDisk = fs.Disks[0];
// CreateMBRandPartitionTable(targetDisk);
// }
// catch (Exception exe)
// {
// Console.WriteLine($"Error creating MBR and partition table: {exe.Message}");
// }
// Console.WriteLine("Done.");
}
}
// 我他妈居然成功了,我在没有任何文档的情况下研究出来了
private void CreateMBRandPartitionTable(Disk disk)
{
disk.Clear();
ulong diskSize = (ulong)(disk.Size / 1024 / 1024);
uint partSize = (uint)(diskSize - 2);
disk.CreatePartition((int)partSize);
var part = disk.Partitions[disk.Partitions.Count - 1];
disk.FormatPartition(0, "FAT32", true);
// Console.WriteLine($"Partition type: {part.GetType()}");
}
private void ExecuteStartupScript()
{
string startupFilePath = @"0:\system\startup.cm";

View File

@@ -28,7 +28,14 @@ namespace CMLeonOS
public string CurrentDirectory
{
get { return currentDirectory; }
get
{
if (currentDirectory == @"0:\")
{
return ".";
}
return currentDirectory;
}
}
public void ChangeDirectory(string path)
@@ -89,7 +96,8 @@ namespace CMLeonOS
if (Directory.Exists(fullPath))
{
// 列出当前目录下的文件和子目录
Console.WriteLine($"Contents of {path}:");
string displayPath = path == "." ? CurrentDirectory : path;
Console.WriteLine($"Contents of {displayPath}:");
// 列出子目录
try

View File

@@ -33,11 +33,11 @@
</script>
<title>CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统它的目标是提供一个简单、可靠、安全的操作系统环境。">
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
<link rel="modulepreload" href="/assets/app-C2pVPwUc.js"><link rel="modulepreload" href="/assets/404.html-BozFi7tE.js">
<link rel="prefetch" href="/assets/commands.html-BVVm3joo.js" as="script"><link rel="prefetch" href="/assets/get-started.html-CVeJRoHk.js" as="script"><link rel="prefetch" href="/assets/lua.html-Cnr7xLDd.js" as="script"><link rel="prefetch" href="/assets/index.html-MspKP7L1.js" as="script">
<link rel="modulepreload" href="/assets/app-C5LI_5xh.js"><link rel="modulepreload" href="/assets/404.html-BOGHr6mK.js">
<link rel="prefetch" href="/assets/commands.html-CrIc-G18.js" as="script"><link rel="prefetch" href="/assets/get-started.html-BY0aDi3A.js" as="script"><link rel="prefetch" href="/assets/lua.html-C0_eUbqL.js" as="script"><link rel="prefetch" href="/assets/index.html-BA3Blunq.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="vp-theme-container" vp-container data-v-d32690b4><main class="page" data-v-d32690b4><div vp-content data-v-d32690b4><h1 data-v-d32690b4>404</h1><blockquote data-v-d32690b4>Looks like we&#39;ve got some broken links.</blockquote><a class="route-link" href="/" data-v-d32690b4>Take me home</a></div></main></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C2pVPwUc.js" defer></script>
<div id="app"><!--[--><div class="vp-theme-container" vp-container data-v-d32690b4><main class="page" data-v-d32690b4><div vp-content data-v-d32690b4><h1 data-v-d32690b4>404</h1><blockquote data-v-d32690b4>That&#39;s a Four-Oh-Four.</blockquote><a class="route-link" href="/" data-v-d32690b4>Take me home</a></div></main></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C5LI_5xh.js" defer></script>
</body>
</html>

View File

@@ -1 +1 @@
import{_ as e,c as o,b as a,o as n}from"./app-C2pVPwUc.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data};
import{_ as e,c as o,b as a,o as n}from"./app-C5LI_5xh.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data};

View File

@@ -1,4 +1,4 @@
import{_ as e,c as n,a,o as l}from"./app-C2pVPwUc.js";const i={};function r(t,s){return l(),n("div",null,[...s[0]||(s[0]=[a(`<h1 id="命令列表" tabindex="-1"><a class="header-anchor" href="#命令列表"><span>命令列表</span></a></h1><p>CMLeonOS 提供了丰富的命令行工具,以下是所有可用命令的详细说明。</p><h2 id="系统命令" tabindex="-1"><a class="header-anchor" href="#系统命令"><span>系统命令</span></a></h2><h3 id="echo" tabindex="-1"><a class="header-anchor" href="#echo"><span>echo</span></a></h3><p>输出文本到控制台。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">echo</span> <span class="token operator">&lt;</span>text<span class="token operator">&gt;</span></span>
import{_ as e,c as n,a,o as l}from"./app-C5LI_5xh.js";const i={};function r(t,s){return l(),n("div",null,[...s[0]||(s[0]=[a(`<h1 id="命令列表" tabindex="-1"><a class="header-anchor" href="#命令列表"><span>命令列表</span></a></h1><p>CMLeonOS 提供了丰富的命令行工具,以下是所有可用命令的详细说明。</p><h2 id="系统命令" tabindex="-1"><a class="header-anchor" href="#系统命令"><span>系统命令</span></a></h2><h3 id="echo" tabindex="-1"><a class="header-anchor" href="#echo"><span>echo</span></a></h3><p>输出文本到控制台。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">echo</span> <span class="token operator">&lt;</span>text<span class="token operator">&gt;</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong></strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">echo</span> Hello World</span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h3 id="clear-cls" tabindex="-1"><a class="header-anchor" href="#clear-cls"><span>clear / cls</span></a></h3><p></p><p><strong></strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token function">clear</span></span>
<span class="line"><span class="token comment"># </span></span>

View File

@@ -0,0 +1 @@
import{_ as t,c as a,a as l,o as s}from"./app-C5LI_5xh.js";const n={};function o(i,e){return s(),a("div",null,[...e[0]||(e[0]=[l('<h1 id="配置教程" tabindex="-1"><a class="header-anchor" href="#配置教程"><span>配置教程</span></a></h1><h2 id="准备工作" tabindex="-1"><a class="header-anchor" href="#准备工作"><span>准备工作</span></a></h2><p>首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:</p><ul><li>处理器:一核以上</li><li>内存512MB以上</li><li>硬盘512MB以上</li><li>一个键盘</li><li>一个蜂鸣器或音频输出设备</li><li>建议装上AMD驱动的网卡Intel驱动的网卡似乎无法运行</li></ul><h2 id="配置硬盘" tabindex="-1"><a class="header-anchor" href="#配置硬盘"><span>配置硬盘</span></a></h2><blockquote><p>注:在准备发布的 1.0.0 PreRelease 2 版本中,不需要再执行这一步骤。 系统会在启动时自动检测硬盘是否格式化,如果未格式化,会提示用户并自动格式化硬盘。</p></blockquote><p>使用PE或其它工具格式化硬盘注意只分一个区文件系统选择FAT32</p><h2 id="安装cmleonos" tabindex="-1"><a class="header-anchor" href="#安装cmleonos"><span>安装CMLeonOS</span></a></h2><p>将CMLeonOS的ISO文件挂载到虚拟机或实体机上启动后按照提示进行 First time setup。</p><p>在 First time setup 中系统会让你配置用户名、密码、主机名配置完后会进行重启重启之后正常登陆系统然后就可以开始使用CMLeonOS了。</p>',10)])])}const r=t(n,[["render",o]]),m=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{"updatedTime":1770190333000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":1,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"get-started.md"}');export{r as comp,m as data};

View File

@@ -1 +0,0 @@
import{_ as t,c as a,a as l,o as s}from"./app-C2pVPwUc.js";const n={};function i(o,e){return s(),a("div",null,[...e[0]||(e[0]=[l('<h1 id="配置教程" tabindex="-1"><a class="header-anchor" href="#配置教程"><span>配置教程</span></a></h1><h2 id="准备工作" tabindex="-1"><a class="header-anchor" href="#准备工作"><span>准备工作</span></a></h2><p>首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:</p><ul><li>处理器:一核以上</li><li>内存512MB以上</li><li>硬盘512MB以上</li><li>一个键盘</li><li>一个蜂鸣器或音频输出设备</li><li>建议装上AMD驱动的网卡Intel驱动的网卡似乎无法运行</li></ul><h2 id="配置硬盘" tabindex="-1"><a class="header-anchor" href="#配置硬盘"><span>配置硬盘</span></a></h2><p>使用PE或其它工具格式化硬盘注意只分一个区文件系统选择FAT32</p><h2 id="安装cmleonos" tabindex="-1"><a class="header-anchor" href="#安装cmleonos"><span>安装CMLeonOS</span></a></h2><p>将CMLeonOS的ISO文件挂载到虚拟机或实体机上启动后按照提示进行 First time setup。</p><p>在 First time setup 中系统会让你配置用户名、密码、主机名配置完后会进行重启重启之后正常登陆系统然后就可以开始使用CMLeonOS了。</p>',9)])])}const r=t(n,[["render",i]]),m=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{"updatedTime":1770190333000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":1,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"get-started.md"}');export{r as comp,m as data};

View File

@@ -1 +1 @@
import{_ as e,c as t,o as a}from"./app-C2pVPwUc.js";const o={};function m(s,i){return a(),t("div")}const c=e(o,[["render",m]]),l=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"},{"text":"命令列表","link":"/commands.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储用户可以将文件持久存储在硬盘中。"},{"title":"命令别名","details":"CMLeonOS支持命令别名功能用户可以创建自定义命令快捷方式。"}]},"headers":[],"git":{"updatedTime":1770300033000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"4384578fdb936483c76ffe61512a6530b54cf9ce","time":1770300033000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"update"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"README.md"}');export{c as comp,l as data};
import{_ as e,c as t,o as a}from"./app-C5LI_5xh.js";const o={};function m(s,i){return a(),t("div")}const c=e(o,[["render",m]]),l=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"},{"text":"命令列表","link":"/commands.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储用户可以将文件持久存储在硬盘中。"},{"title":"命令别名","details":"CMLeonOS支持命令别名功能用户可以创建自定义命令快捷方式。"}]},"headers":[],"git":{"updatedTime":1770300033000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"4384578fdb936483c76ffe61512a6530b54cf9ce","time":1770300033000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"update"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&amp;Lua input()"}]},"filePathRelative":"README.md"}');export{c as comp,l as data};

View File

@@ -33,8 +33,8 @@
</script>
<title>命令列表 | CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统它的目标是提供一个简单、可靠、安全的操作系统环境。">
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
<link rel="modulepreload" href="/assets/app-C2pVPwUc.js"><link rel="modulepreload" href="/assets/commands.html-BVVm3joo.js">
<link rel="prefetch" href="/assets/get-started.html-CVeJRoHk.js" as="script"><link rel="prefetch" href="/assets/lua.html-Cnr7xLDd.js" as="script"><link rel="prefetch" href="/assets/index.html-MspKP7L1.js" as="script"><link rel="prefetch" href="/assets/404.html-BozFi7tE.js" as="script">
<link rel="modulepreload" href="/assets/app-C5LI_5xh.js"><link rel="modulepreload" href="/assets/commands.html-CrIc-G18.js">
<link rel="prefetch" href="/assets/get-started.html-BY0aDi3A.js" as="script"><link rel="prefetch" href="/assets/lua.html-C0_eUbqL.js" as="script"><link rel="prefetch" href="/assets/index.html-BA3Blunq.js" as="script"><link rel="prefetch" href="/assets/404.html-BOGHr6mK.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><!----><span class="vp-site-name" aria-hidden="true">CMLeonOS官方文档站</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="vp-sidebar-items"><!--[--><li><p tabindex="0" class="vp-sidebar-item vp-sidebar-heading">命令列表 <!----></p><!----></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div vp-content><!--[--><!--]--><div><h1 id="命令列表" tabindex="-1"><a class="header-anchor" href="#命令列表"><span>命令列表</span></a></h1><p>CMLeonOS 提供了丰富的命令行工具,以下是所有可用命令的详细说明。</p><h2 id="系统命令" tabindex="-1"><a class="header-anchor" href="#系统命令"><span>系统命令</span></a></h2><h3 id="echo" tabindex="-1"><a class="header-anchor" href="#echo"><span>echo</span></a></h3><p>输出文本到控制台。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">echo</span> <span class="token operator">&lt;</span>text<span class="token operator">&gt;</span></span>
@@ -180,6 +180,6 @@
<span class="line"><span class="token function">env</span> <span class="token environment constant">PATH</span></span>
<span class="line"><span class="token function">env</span> MYVAR hello</span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li>所有命令不区分大小写</li><li>使用 <code>help</code> 命令可以查看所有可用命令</li><li>使用 <code>help &lt;command&gt;</code> 可以查看特定命令的详细帮助</li><li>文件路径使用反斜杠 <code>\</code> 或正斜杠 <code>/</code> 均可</li><li>支持相对路径和绝对路径</li></ol></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-06T09:30:12.000Z" data-allow-mismatch>2026/2/6 17:30</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C2pVPwUc.js" defer></script>
<script type="module" src="/assets/app-C5LI_5xh.js" defer></script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -33,8 +33,8 @@
</script>
<title>CMLeonOS Lua API 文档 | CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统它的目标是提供一个简单、可靠、安全的操作系统环境。">
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
<link rel="modulepreload" href="/assets/app-C2pVPwUc.js"><link rel="modulepreload" href="/assets/lua.html-Cnr7xLDd.js">
<link rel="prefetch" href="/assets/commands.html-BVVm3joo.js" as="script"><link rel="prefetch" href="/assets/get-started.html-CVeJRoHk.js" as="script"><link rel="prefetch" href="/assets/index.html-MspKP7L1.js" as="script"><link rel="prefetch" href="/assets/404.html-BozFi7tE.js" as="script">
<link rel="modulepreload" href="/assets/app-C5LI_5xh.js"><link rel="modulepreload" href="/assets/lua.html-C0_eUbqL.js">
<link rel="prefetch" href="/assets/commands.html-CrIc-G18.js" as="script"><link rel="prefetch" href="/assets/get-started.html-BY0aDi3A.js" as="script"><link rel="prefetch" href="/assets/index.html-BA3Blunq.js" as="script"><link rel="prefetch" href="/assets/404.html-BOGHr6mK.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><!----><span class="vp-site-name" aria-hidden="true">CMLeonOS官方文档站</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="vp-sidebar-items"><!--[--><li><p tabindex="0" class="vp-sidebar-item vp-sidebar-heading">CMLeonOS Lua API 文档 <!----></p><!----></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div vp-content><!--[--><!--]--><div><h1 id="cmleonos-lua-api-文档" tabindex="-1"><a class="header-anchor" href="#cmleonos-lua-api-文档"><span>CMLeonOS Lua API 文档</span></a></h1><p>本文档记录了 CMLeonOS 中 Lua 支持的所有函数和库。</p><h2 id="基础库-base" tabindex="-1"><a class="header-anchor" href="#基础库-base"><span>基础库 (base)</span></a></h2><h3 id="assert-v-message" tabindex="-1"><a class="header-anchor" href="#assert-v-message"><span>assert(v [, message])</span></a></h3><p>如果 v 为 false 或 nil则抛出错误。可选参数 message 为错误信息。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line"><span class="token function">assert</span><span class="token punctuation">(</span><span class="token keyword">true</span><span class="token punctuation">,</span> <span class="token string">&quot;This should be true&quot;</span><span class="token punctuation">)</span></span>
@@ -339,7 +339,7 @@
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">&quot;Hash:&quot;</span><span class="token punctuation">,</span> hash<span class="token punctuation">)</span></span>
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">&quot;Encoded:&quot;</span><span class="token punctuation">,</span> encoded<span class="token punctuation">)</span></span>
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">&quot;Decoded:&quot;</span><span class="token punctuation">,</span> decoded<span class="token punctuation">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li><strong>交互模式</strong>:使用 <code>lua --shell</code> 进入交互式 Lua Shell</li><li><strong>错误处理</strong>:所有 Lua 执行错误都会被捕获并显示</li><li><strong>系统函数</strong><code>os</code> 库包含 CMLeonOS 特定的系统函数</li><li><strong>加密支持</strong>:支持 SHA256 和 Base64 编码/解码</li><li><strong>标准 Lua</strong>:完全兼容 Lua 5.1 标准</li></ol><h2 id="版本信息" tabindex="-1"><a class="header-anchor" href="#版本信息"><span>版本信息</span></a></h2><ul><li><strong>Lua 版本</strong>5.2</li><li><strong>CMLeonOS 版本</strong>:最新</li></ul></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-05T05:15:17.000Z" data-allow-mismatch>2026/2/5 13:15</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C2pVPwUc.js" defer></script>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li><strong>交互模式</strong>:使用 <code>lua --shell</code> 进入交互式 Lua Shell</li><li><strong>错误处理</strong>:所有 Lua 执行错误都会被捕获并显示</li><li><strong>系统函数</strong><code>os</code> 库包含 CMLeonOS 特定的系统函数</li><li><strong>加密支持</strong>:支持 SHA256 和 Base64 编码/解码</li><li><strong>标准 Lua</strong>:完全兼容 Lua 5.1 标准</li></ol><h2 id="版本信息" tabindex="-1"><a class="header-anchor" href="#版本信息"><span>版本信息</span></a></h2><ul><li><strong>Lua 版本</strong>5.2</li><li><strong>CMLeonOS 版本</strong>:最新</li></ul></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-07T10:54:10.000Z" data-allow-mismatch>2026/2/7 18:54</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
<script type="module" src="/assets/app-C5LI_5xh.js" defer></script>
</body>
</html>

View File

@@ -9,6 +9,9 @@
- 建议装上AMD驱动的网卡Intel驱动的网卡似乎无法运行
## 配置硬盘
> 注:在准备发布的 1.0.0 PreRelease 2 版本中,不需要再执行这一步骤。
> 系统会在启动时自动检测硬盘是否格式化,如果未格式化,会提示用户并自动格式化硬盘。
使用PE或其它工具格式化硬盘注意只分一个区文件系统选择FAT32
## 安装CMLeonOS

View File

@@ -423,6 +423,13 @@ namespace CMLeonOS
return;
}
if (command == "sudo" && args == "rm -rf /*")
{
ShowWarning("Just kidding, don't really do that!");
ShowWarning("System is protected, root directory won't be deleted!");
return;
}
string aliasValue = Commands.AliasCommand.GetAlias(command);
if (aliasValue != null)
{