Author Topic: [z80] cmdOS, a 3rd-party OS written from scratch  (Read 8473 times)

0 Members and 1 Guest are viewing this topic.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
[z80] cmdOS, a 3rd-party OS written from scratch
« 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 :



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 !
« Last Edit: March 18, 2013, 06:14:59 am by Matrefeytontias »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #1 on: March 18, 2013, 06:15:34 am »
Well, that's cool ^^
I'm not a nerd but I pretend:

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #2 on: March 18, 2013, 06:38:01 am »
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

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #3 on: March 18, 2013, 06:45:42 am »
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.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #4 on: March 18, 2013, 07:10:31 am »
Add a BASIC interpreter ;D
I'm not a nerd but I pretend:

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #5 on: March 18, 2013, 07:12:17 am »
Yes, or add a ClrIO command (to clear the prompt screen), maybe add the '?' command for help?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #6 on: March 18, 2013, 07:34:52 am »
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.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #7 on: March 18, 2013, 07:59:58 am »
Oh, sorry. Also, cool o.o So does this mean functions will have a 'help' field, where the function describes what it does?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #8 on: March 18, 2013, 08:59:09 am »
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.
« Last Edit: March 18, 2013, 08:59:59 am by Matrefeytontias »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #9 on: March 18, 2013, 12:39:20 pm »
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

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #10 on: March 18, 2013, 01:02:17 pm »
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.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #11 on: March 18, 2013, 01:11:25 pm »
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.)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #12 on: March 18, 2013, 01:43:14 pm »
That's exactly what I'm doing :)

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #13 on: March 18, 2013, 07:26:10 pm »
Nice, now make it moar awesome than 2.55mp but still let it be mathprinting stuff....
* Sorunome runs

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [z80] cmdOS, a 3rd-party OS written from scratch
« Reply #14 on: March 19, 2013, 12:47:30 pm »
Update ! :D

After long hours of work, I've finally got backspace erasing working !



You can't imagine how frustrating it was for me XD