Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit57fafa6

Browse files
update
1 parentd13d29f commit57fafa6

File tree

4 files changed

+108
-8
lines changed

4 files changed

+108
-8
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vs/
22
obj/
3+
bin/

‎OS.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static void Main()
6262
}
6363
else
6464
{
65-
program.getdir()
65+
program.getdir(Directory.GetCurrentDirectory())
6666
}
6767
program.about();
6868
break;

‎ebOS/Kernel.cs‎

Lines changed: 104 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,121 @@
11
usingSystem;
22
usingSystem.Collections.Generic;
33
usingSystem.Text;
4+
usingSystem.IO;
45
usingSys=Cosmos.System;
56

67
namespaceebOS
78
{
89
publicclassKernel:Sys.Kernel
910
{
10-
11-
protectedoverridevoidBeforeRun()
11+
privateconststringver="1.0.0";
12+
protectedoverridevoidBeforeRun()
1213
{
1314
Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back.");
1415
}
1516

1617
protectedoverridevoidRun()
1718
{
18-
Console.Write("Input: ");
19-
varinput=Console.ReadLine();
20-
Console.Write("Text typed: ");
21-
Console.WriteLine(input);
19+
voidabout()
20+
{
21+
Console.WriteLine("ebOS "+ver);
22+
}
23+
string[]getdir(stringpath)
24+
{
25+
string[]dirs=Directory.GetFileSystemEntries(path);
26+
returndirs;
27+
}
28+
voidhelp()
29+
{
30+
Console.WriteLine("ebOS "+ver);
31+
Console.WriteLine("\nsystem commands:\n"+
32+
"shutdown - shut down\n"+
33+
"reboot/restart - reboot the system\n"+
34+
"\ninfo:\n"+
35+
"about/ver - show version\n"+
36+
"help - show this help message\n"+
37+
"\nother:\n"+
38+
"zen - show the zen of python");
39+
//"hello - display greeting\n" +
40+
//"zen - display zen of python\n");
41+
}
42+
Kernelprogram=newKernel();
43+
Console.ForegroundColor=ConsoleColor.Green;
44+
Console.WriteLine(@"
45+
##
46+
## ### #####
47+
## ## ## ## ##
48+
##### ###### ## ## ##
49+
## ## ## ## ## ## #####
50+
####### ## ## ## ## ##
51+
## ## ## ## ## ## ##
52+
##### ###### ### #####
53+
54+
");
55+
Console.ForegroundColor=ConsoleColor.Blue;
56+
Console.Write(" ");
57+
about();
58+
Console.ForegroundColor=ConsoleColor.White;
59+
while(true)
60+
{
61+
Console.Write("0:> ");
62+
stringi=Console.ReadLine().ToLower();
63+
string[]ilist=i.Split(' ');
64+
switch(ilist[0])
65+
{
66+
//system commands
67+
case"shutdown":
68+
//Cosmos.Sys.Deboot.ShutDown()
69+
Console.WriteLine("Shutting down...");
70+
break;
71+
case"reboot":
72+
//Cosmos.Sys.Deboot.Reboot();
73+
Console.WriteLine("Rebooting...");
74+
break;
75+
case"restart":
76+
//Cosmos.Sys.Deboot.Reboot();
77+
Console.WriteLine("Rebooting...");
78+
break;
79+
//info
80+
case"about":
81+
about();
82+
break;
83+
case"ver":
84+
about();
85+
break;
86+
case"help":
87+
help();
88+
break;
89+
case"dir":
90+
if(!(ilist.Length>1))
91+
{
92+
getdir(ilist[1]);
93+
94+
}
95+
else
96+
{
97+
getdir(Directory.GetCurrentDirectory());
98+
99+
}
100+
about();
101+
break;
102+
//no reason
103+
case"hello":
104+
Console.WriteLine("Hello World");
105+
break;
106+
case"zen":
107+
Console.WriteLine("The Zen of Python, by Tim Peters\n\nBeautiful is better than ugly.\nExplicit is better than implicit.\nSimple is better than complex.\nComplex is better than complicated.\nFlat is better than nested.\nSparse is better than dense.\nReadability counts.\nSpecial cases aren't special enough to break the rules.\nAlthough practicality beats purity.\nErrors should never pass silently.\nUnless explicitly silenced.\nIn the face of ambiguity, refuse the temptation to guess.\nThere should be one-- and preferably only one --obvious way to do it.\nAlthough that way may not be obvious at first unless you're Dutch.\nNow is better than never.\nAlthough never is often better than *right* now.\nIf the implementation is hard to explain, it's a bad idea.\nIf the implementation is easy to explain, it may be a good idea.\nNamespaces are one honking great idea -- let's do more of those!");
108+
break;
109+
110+
//default
111+
default:
112+
Console.WriteLine(i+" is not a command!");
113+
break;
114+
115+
}
116+
}
22117
}
23-
}
118+
119+
120+
}
24121
}

‎obj/x86/Debug/ebOS.csproj.FileListAbsolute.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ C:\Users\Student\Documents\GitHub\ebOS\obj\x86\Debug\ebOS.csproj.AssemblyReferen
1010
C:\Users\Student\Documents\GitHub\ebOS\obj\x86\Debug\ebOS.csproj.CoreCompileInputs.cache
1111
C:\Users\Student\Documents\GitHub\ebOS\obj\x86\Debug\ConsoleApplication.exe
1212
C:\Users\Student\Documents\GitHub\ebOS\obj\x86\Debug\ConsoleApplication.pdb
13+
C:\Users\tzema\OneDrive\Documents\GitHub\ebOS\obj\x86\Debug\ConsoleApplication.exe
14+
C:\Users\tzema\OneDrive\Documents\GitHub\ebOS\obj\x86\Debug\ConsoleApplication.pdb

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp