Where can I get the source from commands? - Minix

This is a discussion on Where can I get the source from commands? - Minix ; Hi there. I'm a newbie and I'm having a hard time finding the source for the date command. I have to do a program to show the actual time in a format I will specify and I thought the date ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Where can I get the source from commands?

  1. Where can I get the source from commands?

    Hi there.

    I'm a newbie and I'm having a hard time finding the source for the date
    command.
    I have to do a program to show the actual time in a format I will
    specify and I thought the date command would be a good start.

    >From what I understand, it's a gnu program (right??), I've been

    googling it but no success.

    I will apreciate any help knowing where the source is.

    (If any ideas on getting te time and date come to mind, I would
    apreciate them too)


    Cheers. Techflat


  2. Re: Where can I get the source from commands?

    Hi

    techflat wrote:
    > Hi there.
    >
    > I'm a newbie and I'm having a hard time finding the source for the date
    > command.



    It is nearby the source of the kernel. Look in
    /usr/src/commands/simple.

    Regards
    --
    Matej Kosik


  3. Re: Where can I get the source from commands?

    Thanx Matej

    I have another question. You might know...

    How should I compile if I want to change the file
    /usr/src/lib/ansi/asctime.c ??


    Thanx

    kosik@fiit.stuba.sk wrote:
    > Hi
    >
    > techflat wrote:
    > > Hi there.
    > >
    > > I'm a newbie and I'm having a hard time finding the source for the date
    > > command.

    >
    >
    > It is nearby the source of the kernel. Look in
    > /usr/src/commands/simple.
    >
    > Regards
    > --
    > Matej Kosik



  4. Re: Where can I get the source from commands?


    techflat wrote:
    > Thanx Matej
    >
    > I have another question. You might know...
    >
    > How should I compile if I want to change the file
    > /usr/src/lib/ansi/asctime.c ??


    There is (should always be) proper Makefile. The sources `libc' are in
    various directories. However, if you do:

    cd /usr/src/lib && make install

    all the changed sources get compiled, linked and installed. I would
    guess that this command can help you.

    >
    >
    > Thanx
    >
    > kosik@fiit.stuba.sk wrote:
    > > Hi
    > >
    > > techflat wrote:
    > > > Hi there.
    > > >
    > > > I'm a newbie and I'm having a hard time finding the source for the date
    > > > command.

    > >
    > >
    > > It is nearby the source of the kernel. Look in
    > > /usr/src/commands/simple.
    > >
    > > Regards
    > > --
    > > Matej Kosik



  5. Re: Where can I get the source from commands?

    Thanx, I guess it works... but here's the thing:

    I want to use asctime.c when I press F8 to show me the time, but I
    changed it a little to show me the time in a different format.

    So, when I change things to do so, I press F8 but the time gets printed
    like it should be by default. So, I'm guessing no compilation changes
    have been made...

    Any ideas? I'm finding this a little bit anoying...


    Thanx for all your help.


    kosik@fiit.stuba.sk wrote:
    > techflat wrote:
    > > Thanx Matej
    > >
    > > I have another question. You might know...
    > >
    > > How should I compile if I want to change the file
    > > /usr/src/lib/ansi/asctime.c ??

    >
    > There is (should always be) proper Makefile. The sources `libc' are in
    > various directories. However, if you do:
    >
    > cd /usr/src/lib && make install
    >
    > all the changed sources get compiled, linked and installed. I would
    > guess that this command can help you.
    >
    > >
    > >
    > > Thanx
    > >
    > > kosik@fiit.stuba.sk wrote:
    > > > Hi
    > > >
    > > > techflat wrote:
    > > > > Hi there.
    > > > >
    > > > > I'm a newbie and I'm having a hard time finding the source for the date
    > > > > command.
    > > >
    > > >
    > > > It is nearby the source of the kernel. Look in
    > > > /usr/src/commands/simple.
    > > >
    > > > Regards
    > > > --
    > > > Matej Kosik



  6. Re: Where can I get the source from commands?


    techflat wrote:
    > Thanx, I guess it works... but here's the thing:
    >
    > I want to use asctime.c when I press F8 to show me the time, but I
    > changed it a little to show me the time in a different format.
    >
    > So, when I change things to do so, I press F8 but the time gets printed
    > like it should be by default. So, I'm guessing no compilation changes
    > have been made...
    >
    > Any ideas? I'm finding this a little bit anoying...
    >
    >


    I do not know. What functions (in which files) did you change and where
    do you assume those functions are used?


  7. Re: Where can I get the source from commands?

    I changed these files:
    proto.h
    dmp.c
    dmp_kernel.c

    I put in dmp_kernel.c this function so when I press F8 it will be
    executed:
    *********************************************
    void timeprinter_dmp()
    {
    time_t now;
    time(&now);
    printf("%s",asctime(localtime(&now)));
    }
    *********************************************

    This works fine since I can see the time displayed with no problem.

    I then edited the file /usr/src/lib/ansi/asctime.c and changed some
    stuff so the format would be different.
    For instance, I replaced "??? ??? ?? ??:??:?? ????\n"
    with "???_???_??_??:??:??_????\n".

    I compiled, shutdown minix and then booted. To test my changes, I tried
    pressing F8, But no succes...

    That's it. I'm feeling not so bright right now :-$...

    Cheers



    kosik@fiit.stuba.sk wrote:
    > techflat wrote:
    > > Thanx, I guess it works... but here's the thing:
    > >
    > > I want to use asctime.c when I press F8 to show me the time, but I
    > > changed it a little to show me the time in a different format.
    > >
    > > So, when I change things to do so, I press F8 but the time gets printed
    > > like it should be by default. So, I'm guessing no compilation changes
    > > have been made...
    > >
    > > Any ideas? I'm finding this a little bit anoying...
    > >
    > >

    >
    > I do not know. What functions (in which files) did you change and where
    > do you assume those functions are used?



  8. Re: Where can I get the source from commands?


    techflat wrote:
    > I changed these files:
    > proto.h
    > dmp.c
    > dmp_kernel.c
    >
    > I put in dmp_kernel.c this function so when I press F8 it will be
    > executed:
    > *********************************************
    > void timeprinter_dmp()
    > {
    > time_t now;
    > time(&now);
    > printf("%s",asctime(localtime(&now)));
    > }
    > *********************************************
    >
    > This works fine since I can see the time displayed with no problem.
    >
    > I then edited the file /usr/src/lib/ansi/asctime.c and changed some
    > stuff so the format would be different.
    > For instance, I replaced "??? ??? ?? ??:??:?? ????\n"
    > with "???_???_??_??:??:??_????\n".
    >
    > I compiled, shutdown minix and then booted. To test my changes, I tried
    > pressing F8, But no succes...


    Did you recompiled the `is' server with the new versions of libraries?
    There are no dynamicly linked libraries in Minix. If you changed libc
    and you all the executables to use it, you should recompile them all.

    >
    > That's it. I'm feeling not so bright right now :-$...
    >
    > Cheers
    >
    >
    >



  9. Re: Where can I get the source from commands?

    OHH!!

    It worked, finally. You where right. I did
    # cd /usr/src/
    # make install

    and it all worked. So, now, everytime I want to make some change to a
    file inside /usr/src/lib will I have to do what I did? or is there a
    way with smaller compilation (i.e. only compiling the files by hand).

    I would have thought that compiling only the /usr/src/lib stuff would
    change the executables so when I use them It would be the laste
    version.
    Where are these different versions put?


    Thanx for your patience to a newbie.


    kosik@fiit.stuba.sk wrote:
    > techflat wrote:
    > > I changed these files:
    > > proto.h
    > > dmp.c
    > > dmp_kernel.c
    > >
    > > I put in dmp_kernel.c this function so when I press F8 it will be
    > > executed:
    > > *********************************************
    > > void timeprinter_dmp()
    > > {
    > > time_t now;
    > > time(&now);
    > > printf("%s",asctime(localtime(&now)));
    > > }
    > > *********************************************
    > >
    > > This works fine since I can see the time displayed with no problem.
    > >
    > > I then edited the file /usr/src/lib/ansi/asctime.c and changed some
    > > stuff so the format would be different.
    > > For instance, I replaced "??? ??? ?? ??:??:?? ????\n"
    > > with "???_???_??_??:??:??_????\n".
    > >
    > > I compiled, shutdown minix and then booted. To test my changes, I tried
    > > pressing F8, But no succes...

    >
    > Did you recompiled the `is' server with the new versions of libraries?
    > There are no dynamicly linked libraries in Minix. If you changed libc
    > and you all the executables to use it, you should recompile them all.
    >
    > >
    > > That's it. I'm feeling not so bright right now :-$...
    > >
    > > Cheers
    > >
    > >
    > >



+ Reply to Thread