From 85fa99f7bd1db8ccd54af7753b53dbd230cfcb6d Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Sun, 8 Feb 2026 00:13:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Build.bat | 2 ++ CMLeonOS.csproj | 32 +++++++++++++++++++++++++++++++- Kernel.cs | 34 ++++++++++++++++++++++++++++++---- font.psf | Bin 0 -> 4597 bytes shell/Shell.cs | 1 - 5 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 Build.bat create mode 100644 font.psf diff --git a/Build.bat b/Build.bat new file mode 100644 index 0000000..6ec1dee --- /dev/null +++ b/Build.bat @@ -0,0 +1,2 @@ +"D:\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\amd64\MSBuild.exe" "CMLeonOS.csproj" /t:Build /p:Configuration=Fixed_Release /p:Platform=x64 +@REM "C:\Program Files (x86)\VMware\VMware Workstation\vmplayer.exe" "C:\Users\leon\AppData\Roaming\Cosmos User Kit\Build\VMware\Workstation\Cosmos.vmx" \ No newline at end of file diff --git a/CMLeonOS.csproj b/CMLeonOS.csproj index be5e211..3a69ccd 100644 --- a/CMLeonOS.csproj +++ b/CMLeonOS.csproj @@ -15,7 +15,7 @@ False Pipe: Cosmos\Serial Serial: COM1 - VMware + HyperV VMware Use VMware Player or Workstation to deploy and debug. 192.168.0.8 @@ -30,7 +30,37 @@ 800x600x32 + + 8 + + + + 8 + + + + 8 + + + + 8 + + + + 8 + + + + 8 + + + + + + + + diff --git a/Kernel.cs b/Kernel.cs index 105a2c9..43a52d8 100644 --- a/Kernel.cs +++ b/Kernel.cs @@ -1,19 +1,23 @@ +using CMLeonOS.Logger; +using CMLeonOS.Settings; using Cosmos.HAL; +using Cosmos.HAL.BlockDevice; +using Cosmos.HAL.Drivers.Video; using Cosmos.System.FileSystem; using Cosmos.System.FileSystem.FAT; using Cosmos.System.FileSystem.VFS; +using Cosmos.System.Graphics; +using Cosmos.System.Graphics.Fonts; using Cosmos.System.Network.Config; -using Cosmos.System.Network.IPv4.UDP.DHCP; -using Cosmos.HAL.BlockDevice; using Cosmos.System.Network.IPv4; +using Cosmos.System.Network.IPv4.UDP.DHCP; using System; using System.Collections.Generic; using System.IO; using System.Reflection.Metadata.Ecma335; +using System.Security.Cryptography.X509Certificates; using System.Text; using Sys = Cosmos.System; -using CMLeonOS.Logger; -using CMLeonOS.Settings; namespace CMLeonOS { @@ -31,9 +35,31 @@ namespace CMLeonOS public static Cosmos.HAL.NetworkDevice NetworkDevice = null; public static string IPAddress = "Unknown"; + + [IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.font.psf")] + public static readonly byte[] file; protected override void BeforeRun() { + // 我认了,我用默认字体 + // try + // { + // PCScreenFont screenFont = PCScreenFont.LoadFont(file); + // VGAScreen.SetFont(screenFont.CreateVGAFont(), screenFont.Height); + // VGAScreen.SetGraphicsMode(VGADriver.ScreenSize.Size720x480, ColorDepth.ColorDepth32); + // } + // catch (Exception ex) + // { + // 我不认,我试着转换成Base64 + // 我认了 + PCScreenFont defaultFont = PCScreenFont.Default; + VGAScreen.SetFont(defaultFont.CreateVGAFont(), defaultFont.Height); + // Console.WriteLine($"{defaultFont.Height}"); + // Console.WriteLine($"{defaultFont.Width}"); + // VGAScreen.SetGraphicsMode(VGADriver.ScreenSize.Size720x480, ColorDepth.ColorDepth32); + // Console.WriteLine($"Error loading font: {ex.Message}"); + // } + Console.WriteLine("Kernel load done!"); Console.WriteLine(@"-------------------------------------------------"); Console.WriteLine(@" ____ __ __ _ ___ ____ "); diff --git a/font.psf b/font.psf new file mode 100644 index 0000000000000000000000000000000000000000..0a78e480d7c623ac96da0e29db7dee4bd1cac790 GIT binary patch literal 4597 zcmY*bOK=-m6>X}fC@olMk%gBH1Q37oHxNKT05J?8Ap8dq|L_+x0~i>nj$=D*PbO)p z-;-rWv1P}xJ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