Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Matrefeytontias on March 18, 2013, 06:14:36 am
-
Hey guys !
A few days ago I started working on cmdOS, a command line-based 3rd-party OS. I only do that as a training to improve my ASM skills, so I don't plan any future for it. But hey, who knows ? ;)
I started with SirCmpwn's OS starter kit, which provides LCD and flash set up, RAM unlocking and memory mapping. I also used KnightOS's fontmap and putSpriteOR routine with the agreement of SirCmpwn, but I wrote myself everything else (that means, the text routine, the interpreter, and other functions that you don't see in the screenie below).
So, for now the OS boots on a command-line, which fully supports functions with no arguments :) so if you can think of one, please tell me.
Here are the functions already available :- SHUTDOWN : guess its use
- CLS : clear the command-line
- PING : prints "Pong !" ;D
- VERSION : prints cmdOS's version
Of course, screenie :
(http://img.removedfromgame.com/imgs/cmdOS1.gif)
Also, I don't show it in the screenie because I thought of it just after uploading the image, but the text wraps when you reach the bottom and the right edge of the screen :)
Share comments !
-
Well, that's cool ^^
-
Awesome! I should really look at this OS starter kit thing >.> Would you like some routines for reading strings of numbers so the user can pass arguments? Or are you creating that yourself? :D
-
No thanks, if I use others' routines it lost its interest as a training :) I'll do myself as much things as possible, I'll ask for help for the rest.
-
Add a BASIC interpreter ;D
-
Yes, or add a ClrIO command (to clear the prompt screen), maybe add the '?' command for help?
-
aeTIos : maybe I'll never do that :P
Xeda112358 : that's what CLS is doing o_O and for the '?' thing, I planned something for arguments when the functions will be programs, so you'll can do command -h.
-
Oh, sorry. Also, cool o.o So does this mean functions will have a 'help' field, where the function describes what it does?
-
The supported options will be up to the programmer. Arguments starting with - will be copied to a certain memory area which programs will can access and use easily.
-
Nice o.o Maybe you can make it set or reset bits as actual flags. For example, you can set IY to point to a bunch of flags, and -a would reset bit 0, +a would set bit 0. Then bit 7,(IY+0) is the 'h' flag so the program knows that its 'help' code should be called.
Since it is your OS, you can control the IY register without any harm o.o
-
I use IY register to pass buffers to functions. And with this system of flags you can't define your own - prefixed arguments. For example, that would fit if there was a fixed number of allowed - prefixed options.
-
Oh, I see. Do you store the input string in RAM somewhere? For example, do you have "func -h" stored somewhere in RAM as you type? If so, you can just pass a pointer to the arguments in HL or something. So your interpreter reads "func ", and as soon as it hits the end of the input or a space, it searches for the function, and passes a pointer to whatever follows. This way, each function completely handles its own inputs, like stings and file names. (This is how I did it in FileSyst, too.)
-
That's exactly what I'm doing :)
-
Nice, now make it moar awesome than 2.55mp but still let it be mathprinting stuff..../me runs
-
Update ! :D
After long hours of work, I've finally got backspace erasing working !
(http://img.removedfromgame.com/imgs/cmdOS2.gif)
You can't imagine how frustrating it was for me XD
-
Update !
Got the argument parsing work :)
(http://img.removedfromgame.com/imgs/cmdOS3.gif)
I planned command input like this : when you input a command, you can specify two kinds of parameters, classic and special. A special parameter is the minus character - followed by one letter, and a classic parameter is at least one letter, A to Z, or one number, 0 to 9. Special parameters will be copied to another memory area than classic parameters so they'll be easier to handle by user programs.
As I said sonner, each and every command will be a program stored in the filesystem (currently working on it) and which will be ran with the given arguments, if any. So, the OS itself will be a tiny command-line which can run programs, a filesystem, and many, many functions for the programmers to use in their programs.
The main interest of this OS is that I try to make it use as little RAM as possible, so there will be a great free space for user programs. Also, I try to provide as many routines as possible to make user programs as small as possible, allowing for even more features in each.
-
I made a GitHub repository, for those who wants to test the OS or to see the source code : https://github.com/matrefeytontias/cmdOS
-
So, ultimately, the programs could theoretically be paraphrased in TIBASIC as
prgmFunction1
prgmFunction2
prgmFunction3
... and so on, like writing a program entirely out of bcalls?
-
No, don't misunderstand programs and inline commands. Programs are actual ASM programs, written and compiled on a PC, sent to the calc and then executed in the command line as functions.
For example, if mario happens to be written for cmdOS, you'd do >> mario in the command line to run it.
-
INteresting. If this comes to fruition, will it eventually support programs like Axe Parser and math tools so that people who want to code, for example, can use something different than ASM and those who need regular math tools for class can install them as add-in?
-
I think you misunderstood the main goal of the OS :P
What I want to achieve while writing this OS is to provide an easy-to-use development environment, with a lot of available RAM, functions etc. In fact, it's an empty OS which only wait for ASM programmers to feature it. You want a math program ? Do it and share it ! :P
-
Well GlassOS is too difficult for me to understand because of it's C nature. Maybe this OS will be better for me :)
-
It sounds pretty cool. Where are programs run from? Is there a gbuf or some area(s) dedicated to saferam? Or is the RAM always completely free (ie programs will always be in archive)?
-
Looking a bit like UNIX shell now, nice work!
Looks like a fun project. I've wanted to make an OS for practice too, but never got around to it. Thanks for reminding me :D
-
Update :)
File system is here (but in RAM for now) ! Plus the FILEINFO command to retrieve some info from the filename given as argument :) I also made a findVar routine, which is equivalent to TI-OS's _checkFindSym (used in the command). For now, the file is hard-coded using Wabbit's debugger but I'll make an editor for those who wants to program in hexadecimal on-calc ;)
(http://img.removedfromgame.com/imgs/cmdOS4.gif)
Btw, as it's been requested on IRC, I join the zip of the full current source and executable.
-
/me lost
Looks awesome!
-
yeah, that is looking awesome :D/me lost too
-
To thank Sircmpwn to have given you his font, you should explain him how to make a filesystem like that...
I'm not sure that he is comfortable with that...
-
Are you kidding ? XD
KnightOS's filesystem is 1000 times better than mine, only to mention that it's fully in archive.
-
There is one ? The last version I have of KnightOS doesn't have a filesystem...
I thought he was making one... and that he had difficulties.
-
He is having difficulties, due to the use of flash only for storage.