BoneOS icon indicating copy to clipboard operation
BoneOS copied to clipboard

New commands

Open double-fault opened this issue 9 years ago • 24 comments

I'm going to make a few new command for BoneOS.

  • [x] logname - prints current login name
  • [ ] man - help manual
  • [x] pwd - print current working directory
  • [ ] uname - print system info
  • [x] watch - execute a program periodically
  • [ ] time - get current time for process
  • [x] date - get current date
  • [ ] whatis - displays a one line description of a command
  • [x] whoami - just like logname prints the current user
  • [ ] uptime - displays total time since the computer started
  • [ ] alias - makes another temporary name for a command till the terminal is closed
  • [x] shutdown - already implemented by 'poweroff', but need some more improvements
  • [ ] tldr - simplified man pages, not installed by default

double-fault avatar Dec 31 '16 14:12 double-fault

If anyone has more ideas for commands, please post a comment, and if possible, I will add it to the list.

double-fault avatar Dec 31 '16 14:12 double-fault

time - check and set time

srifqi avatar Dec 31 '16 14:12 srifqi

@srifqi I'm afraid that is not possible right now. We have no way to get UTC time in the OS, and if we start the clock once the OS starts, it will be way too inaccurate.

double-fault avatar Dec 31 '16 14:12 double-fault

How about RTC?

sajadbanooie avatar Dec 31 '16 14:12 sajadbanooie

@sajadbanooie you mean a clock which starts when the OS boots up?

double-fault avatar Dec 31 '16 14:12 double-fault

CMOS RTC(real time clock) http://wiki.osdev.org/CMOS#The_Real-Time_Clock

sajadbanooie avatar Dec 31 '16 14:12 sajadbanooie

@sajadbanooie I see that, but the current state of the OS is not as advanced to do all that.

double-fault avatar Dec 31 '16 14:12 double-fault

it doesn't require any thing specific does it?

sajadbanooie avatar Dec 31 '16 14:12 sajadbanooie

@sajadbanooie how exactly will the OS tick the clock when the OS is not running? Most of us run it using vbox or qemu, not on a real computer.

If you can implement it, it'll be great, but AFAIK, it cannot be implemented in the current state of the OS.

double-fault avatar Dec 31 '16 14:12 double-fault

AFAIK RTC updates the clock it self.so that is not the job of OS.

sajadbanooie avatar Dec 31 '16 14:12 sajadbanooie

@sajadbanooie I really don't know much about an RTC, so it would be great if you could implement it, but I can't.

double-fault avatar Dec 31 '16 15:12 double-fault

@Fortunate-MAN and @sajadbanooie rtc is easy not hard. I will implement it after memory man's ger

amanuel2 avatar Dec 31 '16 15:12 amanuel2

Or you can implement it by looking at this @Fortunate-MAN https://github.com/levex/osdev/blob/master/drivers/rtc.c

amanuel2 avatar Dec 31 '16 15:12 amanuel2

@Fortunate-MAN to get i/o functions just #include<io/io.h> and do outb8 for outportb

amanuel2 avatar Dec 31 '16 15:12 amanuel2

@amanuel2 huh, will have a look at that. Thanks

double-fault avatar Dec 31 '16 15:12 double-fault

@Fortunate-MAN told you its not hard

sajadbanooie avatar Dec 31 '16 15:12 sajadbanooie

@sajadbanooie @srifqi @amanuel2 I have completed the basic function for the Real Time Clock. See the commit I referenced above. It is right now printing the UTC time at least when I run it on my computer.

double-fault avatar Jan 01 '17 10:01 double-fault

@Fortunate-MAN no that's noottt how u do uname lol. Not everyone is running 64 bit platform.. Ypu is ill need cpuid

amanuel2 avatar Jan 01 '17 15:01 amanuel2

Don't do cpuid yet, since it's arch dépendant and we need to setup Amd64 first.

amanuel2 avatar Jan 01 '17 21:01 amanuel2

@Fortunate-MAN added date command, but you add the options so i can work on memory manager and amd64 capability... Thanks .. Here is the manpage for date command : http://man7.org/linux/man-pages/man1/date.1.html .. Ofcourse you can add your twists as it dosent have to follow Linux , but just the *NIX Standard.

amanuel2 avatar Jan 03 '17 18:01 amanuel2

Hey, why there's no one say cd when we have pwd? I want cd command!

ghost avatar Jan 04 '17 01:01 ghost

@khanh2003 basically we need to implement an actual file system for cd. The current directory is put in a variable so for pwd we just store that variable and print it.. To change it u need to implement a file system (Virtual File system to be previce) whicb we will do.

amanuel2 avatar Jan 04 '17 02:01 amanuel2

I have added a bunch of commands to the list of pending commands. If someone wants a new command, or does not like a command in the list of pending commands, please comment.

double-fault avatar Jan 14 '17 09:01 double-fault

Finished command watch. The uptime command has some problems so won't check that for now.

double-fault avatar Jan 16 '17 06:01 double-fault