22-07-2013, 04:34 AM
Possible source code for how you could have customizable OS's on the client side, this is still a work in progress.
Code:
Hacker Online (Client Side)
OSv1
boot.sector
print "OS version 1"
print "(c) copywrite 2013, All Rights Reserved"
print ""
print "By Fatal1ty"
print ""
print "Kernel ";
if fileExists("kernel") then
print "Loading . . ."
goto Found
else
print "Not found ( Error #1: No Operating System Found )"
goto notFound
endif
:Found
execFile("kernel")
print ""
print "kernel exited, please reboot"
halt
:notFound
print ""
print "Please re-install Operating System"
goto notFound
kernel
print "OS Kernel v1.0"
if fileExists("OS/console") then
execFile("OS/console")
else
print "Error #2: OS/console not found"
quit
endif
OS/console
dim a$,prompt$,cmdline$,cmdArray,quit
print "OS Console v1.0"
if fileExists("autoexec") then
a$ = readFile("autoexec")
bufferPush(a$)
else
print "*No autoexec file found"
endif
prompt$="home/"
quit=false
:cmd
if bufferLength=0 then
print prompt$;
waitInput
endif
cmdline$=bufferPop()
print prompt$+" "+cmd$
cmdArray = splitLine(cmdline$," ")
if fileExists("/OS/CMDS/"+cmdArray[1]) then
execFile("/OS/CMDS/"+cmdArray[1],cmdArray)
else
if fileExists(cmdArray[1]) then
execFile(cmdArray[1],cmdArray)
else
print "unknown command or filename"
endif
endif
prompt$=currentDirectory()+"/"
if prompt$="/" then
prompt$="home/"
endif
goto cmd
:done
quit
OS/CMDS/ver
print "OS version 1"
print "Kernel version 1"
print "console version 1"
print ""
print "By Fatal1ty"
quit
OS/CMDS/chdir
if params(1)=".." then
currentDirectoryBack()
else
if directoryExists(params(1)) then
currentDirectorySet(params(1))
else
print "* Directory does not exist"
endif
endif
quit
OS/CMDS/dir
dim files$
files$=listFiles(currentDirectory())
print files$
quit
OS/CMDS/mkdir
if directoryExists(params(1)) then
print "* Error Directory already exists"
else
createDirectory(params(1))
endif
quit
OS/CMDS/rmdir
if directoryExists(params(1)) then
removeDirectory(params(1))
else
print "* Directory does not exist"
endif
quit
OS/CMDS/list
dim a$
if fileExists(params(1)) then
a$ = readFile(params(1))
print a$
else
print "*No "+params(1)+" file found"
endif
quit
OS/CMDS/help
dim a$
if fileExists("/OS/help/"+params$) then
a$=readFile("/OS/help/"params$)
print a$
else
print "Help [topic]"
print ""
print "help os"
print "help game"
endif
quit


