need sum help w/ my new OS 
Author Message
 need sum help w/ my new OS

I have made a really k-rad(yeah!) operating system that I need some help
with. one of the commands, for example, is 'st_usr'. Can you please tell
me how to do this: 'st_usr xxxxxxx' <-- btw, the stuff is all built into
the main code to limit size. I have (colorfully) dubbed this CUPOS
(Completely User-unfriendly Prompt-style Operating System) because it
has a prompt and really confusing commands. Any help would be

dont go off like I did there. ;-)

        --omega
           __
          /  \  
        __\  /__

        "your end has just begun"

p.s.  D00K13!!!!!! (inside joke)



Thu, 29 Mar 2001 03:00:00 GMT  
 need sum help w/ my new OS

   I have made a really k-rad(yeah!) operating system that I need some help
   with. one of the commands, for example, is 'st_usr'. Can you please tell
   me how to do this: 'st_usr xxxxxxx'

You're offtopic.  And if you wrote it then WTF don't you know what it
does?
--
(supporter of the campaign for grumpiness where grumpiness is due in c.l.c)

Please: do not email me copies of your posts to comp.lang.c
        do not ask me C questions via email; post them instead



Thu, 29 Mar 2001 03:00:00 GMT  
 need sum help w/ my new OS

Quote:
>I have made a really k-rad(yeah!) operating system that I need some help
>with. one of the commands, for example, is 'st_usr'. Can you please tell
>me how to do this: 'st_usr xxxxxxx' <-- btw, the stuff is all built into
>the main code to limit size. I have (colorfully) dubbed this CUPOS
>(Completely User-unfriendly Prompt-style Operating System) because it
>has a prompt and really confusing commands. Any help would be

>dont go off like I did there. ;-)

I'm not sure what you mean by "Can you please tell me how to do this:
'st_usr xxxxxxx'". However, I'll guess that you want to know how to make
your st_usr program accept and process arguments from the command prompt.

If you code your st_usr main() function like...

        int main(int argc, char *argv[])
        {
                /* your code goes here */
        }

then argc provides a count of the number of arguments passed from the
     operating system,
and  argv provides a pointer to an array of pointers to characters, with
     each element of the array pointing to one of the arguments passed
     by the operating system.
argv[0] is a pointer to a character string containing the name of the
    program (in your case "st_usr")
argv[1] is a pointer to a character string containing the first parameter
    (in your case "xxxxxxx")
and so on, with argv[argv] containing a NULL pointer.

Your main() can then evaluate argc and argv according to your logic's
requirements. For example...

        int main(int argc, char *argv[])
        {
                int     arg;

                for (arg = 0; arg < argc; ++arg)
                        printf("argv[%d] -> \"%s\"\n",arg,argv[arg]);

                return 0;
        }

As for how the operating system breaks up the commandline and provides the
parameters to your program, that's a question only you can answer
(considering you've "made a k-rad operating system" ;-) )

Lew Pitcher
Joat-in-training



Fri, 30 Mar 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. system call in Sun OS - need help

2. Need help deleting printer object from OS

3. Need while loop clue(was Summing Function)

4. Diff between PPC OS / HPC OS/ eXP OS

5. Questions about compilers and executable formats for a new OS

6. ****** New Os Development Idea ******

7. Porting C++ code to new compiler and OS

8. Send Message to OS to tell to redectect new device

9. New OS bootable disk

10. The new IPAQs have an OS named pocket 2002

11. Need help creating new process that is visible

12. New C Programmer Needs HELP!

 

 
Powered by phpBB® Forum Software