Минималистичная версия. 1 юзер, базовая fs, man по командам хардкодом
This commit is contained in:
142
atlas_os/MMC.lua
142
atlas_os/MMC.lua
@@ -233,7 +233,147 @@ local function defaultFS()
|
||||
mkFile(3, "Welcome to AtlasOS v2.0!\n")
|
||||
|
||||
mkIno(4, "d", "755", 0, 0, 0)
|
||||
mkDir(4, { { name = ".", ino = 4 }, { name = "..", ino = 1 } })
|
||||
mkDir(4, { { name = ".", ino = 4 }, { name = "..", ino = 1 }, { name = "man", ino = 6 } })
|
||||
|
||||
mkIno(6, "d", "755", 0, 0, 0)
|
||||
mkDir(6, {
|
||||
{ name = ".", ino = 6 }, { name = "..", ino = 4 },
|
||||
{ name = "help", ino = 7 }, { name = "echo", ino = 8 },
|
||||
{ name = "clear", ino = 9 }, { name = "color", ino = 10 },
|
||||
{ name = "status", ino = 11 }, { name = "ls", ino = 12 },
|
||||
{ name = "cat", ino = 13 }, { name = "cd", ino = 14 },
|
||||
{ name = "stat", ino = 15 }, { name = "man", ino = 16 },
|
||||
})
|
||||
|
||||
mkIno(7, "f", "644", 0, 0, 0)
|
||||
mkFile(7, [[NAME
|
||||
help - display help information
|
||||
|
||||
SYNOPSIS
|
||||
help
|
||||
|
||||
DESCRIPTION
|
||||
Show a list of all available commands with their usage
|
||||
and description.
|
||||
]])
|
||||
|
||||
mkIno(8, "f", "644", 0, 0, 0)
|
||||
mkFile(8, [[NAME
|
||||
echo - display a line of text
|
||||
|
||||
SYNOPSIS
|
||||
echo <text>
|
||||
|
||||
DESCRIPTION
|
||||
Write the given text to the terminal output.
|
||||
]])
|
||||
|
||||
mkIno(9, "f", "644", 0, 0, 0)
|
||||
mkFile(9, [[NAME
|
||||
clear - clear the terminal screen
|
||||
|
||||
SYNOPSIS
|
||||
clear
|
||||
|
||||
DESCRIPTION
|
||||
Clear all text from the terminal display.
|
||||
]])
|
||||
|
||||
mkIno(10, "f", "644", 0, 0, 0)
|
||||
mkFile(10, [[NAME
|
||||
color - set terminal text color
|
||||
|
||||
SYNOPSIS
|
||||
color <R> <G> <B>
|
||||
|
||||
DESCRIPTION
|
||||
Change the text color for subsequent output.
|
||||
Each value must be 0-255 (red, green, blue).
|
||||
]])
|
||||
|
||||
mkIno(11, "f", "644", 0, 0, 0)
|
||||
mkFile(11, [[NAME
|
||||
status - show system status
|
||||
|
||||
SYNOPSIS
|
||||
status
|
||||
|
||||
DESCRIPTION
|
||||
Display system information including current user,
|
||||
working directory, and memory usage.
|
||||
]])
|
||||
|
||||
mkIno(12, "f", "644", 0, 0, 0)
|
||||
mkFile(12, [[NAME
|
||||
ls - list directory contents
|
||||
|
||||
SYNOPSIS
|
||||
ls [-la] [path]
|
||||
|
||||
DESCRIPTION
|
||||
List contents of a directory. If no path is given,
|
||||
list the current directory.
|
||||
|
||||
OPTIONS
|
||||
-a Include hidden entries (. and ..)
|
||||
-l Long format (detailed listing)
|
||||
]])
|
||||
|
||||
mkIno(13, "f", "644", 0, 0, 0)
|
||||
mkFile(13, [[NAME
|
||||
cat - concatenate and display files
|
||||
|
||||
SYNOPSIS
|
||||
cat <path>
|
||||
|
||||
DESCRIPTION
|
||||
Read a file and display its contents on the terminal.
|
||||
]])
|
||||
|
||||
mkIno(14, "f", "644", 0, 0, 0)
|
||||
mkFile(14, [[NAME
|
||||
cd - change the working directory
|
||||
|
||||
SYNOPSIS
|
||||
cd [path]
|
||||
|
||||
DESCRIPTION
|
||||
Change the current working directory. If no path
|
||||
is given, go to root (/). Supports both absolute
|
||||
and relative paths.
|
||||
]])
|
||||
|
||||
mkIno(15, "f", "644", 0, 0, 0)
|
||||
mkFile(15, [[NAME
|
||||
stat - show file metadata
|
||||
|
||||
SYNOPSIS
|
||||
stat <path>
|
||||
|
||||
DESCRIPTION
|
||||
Display metadata for a file or directory, including
|
||||
inode number, type, permissions, owner, group, size,
|
||||
and modification time.
|
||||
]])
|
||||
|
||||
mkIno(16, "f", "644", 0, 0, 0)
|
||||
mkFile(16, [[NAME
|
||||
man - display manual page
|
||||
|
||||
SYNOPSIS
|
||||
man <command>
|
||||
|
||||
DESCRIPTION
|
||||
Display the manual page for a command. Manual pages
|
||||
are stored in /etc/man/.
|
||||
|
||||
EXAMPLE
|
||||
man ls
|
||||
man cat
|
||||
|
||||
SEE ALSO
|
||||
help
|
||||
]])
|
||||
|
||||
local str = fsSerialize()
|
||||
out[5] = str
|
||||
|
||||
Reference in New Issue
Block a user