duplication of code in lib/i386/string and lib/ansi - Minix

This is a discussion on duplication of code in lib/i386/string and lib/ansi - Minix ; Hi everybody, I am working on getting Minix to build using gcc/nasm. I find that code is duplicated in lib/i386/string and lib/ansi - one in assembly and one in 'c'... Can anyone please tell me if I should consume the ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: duplication of code in lib/i386/string and lib/ansi

  1. duplication of code in lib/i386/string and lib/ansi

    Hi everybody,
    I am working on getting Minix to build using gcc/nasm. I find that
    code is duplicated in lib/i386/string and lib/ansi - one in assembly
    and one in 'c'...
    Can anyone please tell me if I should consume the assembly version or
    the "c" version? I am personally inclined towards the c version.
    Regards,
    Kashyap

  2. Re: duplication of code in lib/i386/string and lib/ansi

    On 10/20/2008 04:06 PM, kashyap wrote:

    > I am working on getting Minix to build using gcc/nasm. I find that
    > code is duplicated in lib/i386/string and lib/ansi - one in
    > assembly and one in 'c'...
    > Can anyone please tell me if I should consume the assembly version
    > or the "c" version? I am personally inclined towards the c version.


    The assembler version is much faster since it uses the 'rep' prefix of
    the instruction set.

    IIRC in the old 2.0.4 version, the assembler versions replaced the C
    version of the functions in the library since it was compiled later in
    the src/lib/Makefile.

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  3. Request for help in porting mksh

    Hello,

    I was forwarded at FrOSCon to ask here about this. I’m, among quitesome
    other projects, developer of mksh – http://mirbsd.de/mksh –which I’d
    like to run on Minix 3. As it is a descendant of pdksh, which works, it
    should not be too big of a task. Unfortunately, pdksh used autoconf, but
    oksh, the thing in between of pdksh and mksh, was not portable to any-
    thing other than OpenBSD, so some of the portability had to be re-added.

    Well, it has been a while I tried, and with qemu it was not really that
    fast, so I do not remember any more exactly what went wrong. I used gcc
    at first, because once that works, porting to ACK becomes possible.

    Judging from my logs, there is probably a similar problem to Plan 9, where
    you could start the shell, use any builtins, but upon executing an exter-
    nal command, it would not return to the prompt. Or it just won’t really
    run anything. It has been a while, and I do not have the VM any more… but
    if someone would want to try, either grab a source snapshot from
    https://herc.mirbsd.org/pub/mksh.tgz
    or, preferred, check out the -current tree using AnonCVS over SSH via:
    $ cvs -d anoncvs@anoncvs.mirbsd.org:/cvs co -PA mksh

    Building should be relatively straight-forward once you set up gcc and
    its libraries, and pdksh as the shell to run the build script with, as
    I don’t know off-hand if the Minix 3 version of ash works well:
    $ cd mksh; CC=gcc pdksh Build.sh -r
    Then either run ./mksh and type some commands, or use
    $ ./test.sh -v
    to run the regression tests.

    I would very much appreciate replies in private mail or to miros-discuss@
    (our mailing list, you need not subscribe) if someone is interested and
    has the time and environment (hardware, resources, …) and possibly deeper
    knowledge to do this. I think something with jobs and/or signals is not
    quite “right” (at least from discussing with a Syllable developer, where
    similar behaviour can be seen).

    Thanks in advance!

    //mirabilos
    --
    "Using Lynx is like wearing a really good pair of shades: cuts out
    the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL."
    -- Henry Nelson, March 1999

  4. Re: Request for help in porting mksh

    On Oct 20, 1:38*pm, Thorsten Glaser wrote:
    > Hello,
    >
    > I was forwarded at FrOSCon to ask here about this. Im, among quite some
    > other projects, developer of mksh http://mirbsd.de/mksh which Id
    > like to run on Minix 3. As it is a descendant of pdksh, which works, it
    > should not be too big of a task. Unfortunately, pdksh used autoconf, but
    > oksh, the thing in between of pdksh and mksh, was not portable to any-
    > thing other than OpenBSD, so some of the portability had to be re-added.
    >



    Hi! What is mksh? I did the pdksh port to Minix, so I might be able
    to help you with your port. Please contact me via e-mail.

    The Grue - James T. Sprinkle
    http://www.myspace.com/jamestsprinkle


  5. Re: Request for help in porting mksh

    Oops, accidentally hit Ⓡeply instead of Ⓕollowup…

    The-Grue@hotmail.com dixit:

    >On Oct 20, 1:38*pm, Thorsten Glaser wrote:
    >> Hello,
    >>
    >> I was forwarded at FrOSCon to ask here about this. I’m, among quite some
    >> other projects, developer of mksh –http://mirbsd.de/mksh– which I’d
    >> like to run on Minix 3. As it is a descendant of pdksh, which works, it
    >> should not be too big of a task. Unfortunately, pdksh used autoconf, but
    >> oksh, the thing in between of pdksh and mksh, was not portable to any-
    >> thing other than OpenBSD, so some of the portability had to be re-added.
    >>

    >
    >
    >Hi! What is mksh? I did the pdksh port to Minix, so I might be able
    >to help you with your port. Please contact me via e-mail.


    That would be superb!

    mksh is the same codebase as pdksh, but very modified in the meantime.
    It bases off oksh (OpenBSD /bin/ksh), which has removed all portability
    and autoconf stuff in order to make the beast maintainable and introduce
    bugfixes. mksh has added back portability in some way, but with a least-
    effort approach instead of GNU autoconf. (Latest target is QNX.)

    Overall, mksh is a pdksh superset, with some of the FPOSIX and FSH stuff
    removed, local mailbox checking removed (use biff/comsat or some IMAP
    client for that), and a huge load of bugfixes (e.g. command line editing
    line length), UTF-8 support, improvements (better array and numeric
    handling) and enhancements (bash-style arrays, &>, ${foo/bar/baz}, to
    name just a few), while staying relatively KISS as per the BSD “codex”.

    http://mirbsd.de/mksh

    % env CVS_RSH=ssh cvs -d anoncvs@anoncvs.mirbsd.org:/cvs co mksh
    % cd mksh
    % CC=gcc pdksh Build.sh -r && ./test.sh -v

    The ACK port will be done once it works with gcc on Minix 3.


    I’m in irc.freenode.net as mirabilos, in case you want to do some real-
    time bug spotting, in the #!/bin/mksh channel (yes it is really called
    like that).


    Thanks for your offer!

    bye,
    //mirabilos
    --
    "Using Lynx is like wearing a really good pair of shades: cuts out
    the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL."
    -- Henry Nelson, March 1999

  6. Re: Request for help in porting mksh

    Dixi quod…

    >The-Grue@hotmail.com dixit:
    >>Please contact me via e-mail.


    >Oops, accidentally hit Ⓡeply instead of Ⓕollowup…


    I decided to throw it at the newsgroup anyway for benefit of
    both other interested parties and the archives. Plus I don’t
    know if you get my mail anyway or if it ends up in some spam
    filter…

    bye,
    //mirabilos
    --
    [...] if maybe ext3fs wasn't a better pick, or jfs, or maybe reiserfs, oh but
    what about xfs, and if only i had waited until reiser4 was ready... in the be-
    ginning, there was ffs, and in the middle, there was ffs, and at the end, there
    was still ffs, and the sys admins knew it was good. -- Ted Unangst über *fs

  7. Re: Request for help in porting mksh

    On Nov 4, 12:05*pm, Thorsten Glaser wrote:
    > Oops, accidentally hit Ⓡeply instead of Ⓕollowup…
    >
    > The-G...@hotmail.com dixit:
    >
    > >On Oct 20, 1:38*pm, Thorsten Glaser wrote:
    > >> Hello,

    >
    > >> I was forwarded at FrOSCon to ask here about this. I’m, among quite some
    > >> other projects, developer of mksh –http://mirbsd.de/mksh–which I’d
    > >> like to run on Minix 3. As it is a descendant of pdksh, which works, it
    > >> should not be too big of a task. Unfortunately, pdksh used autoconf, but
    > >> oksh, the thing in between of pdksh and mksh, was not portable to any-
    > >> thing other than OpenBSD, so some of the portability had to be re-added.

    >
    > >

    >
    > >Hi! *What is mksh? *I did the pdksh port to Minix, so I might be able
    > >to help you with your port. *Please contact me via e-mail.

    >
    > That would be superb!
    >
    > mksh is the same codebase as pdksh, but very modified in the meantime.
    > It bases off oksh (OpenBSD /bin/ksh), which has removed all portability
    > and autoconf stuff in order to make the beast maintainable and introduce
    > bugfixes. mksh has added back portability in some way, but with a least-
    > effort approach instead of GNU autoconf. (Latest target is QNX.)
    >
    > Overall, mksh is a pdksh superset, with some of the FPOSIX and FSH stuff
    > removed, local mailbox checking removed (use biff/comsat or some IMAP
    > client for that), and a huge load of bugfixes (e.g. command line editing
    > line length), UTF-8 support, improvements (better array and numeric
    > handling) and enhancements (bash-style arrays, &>, ${foo/bar/baz}, to
    > name just a few), while staying relatively KISS as per the BSD “codex”.
    >
    > http://mirbsd.de/mksh
    >
    > % env CVS_RSH=ssh cvs -d anon...@anoncvs.mirbsd.org:/cvs co mksh
    > % cd mksh
    > % CC=gcc pdksh Build.sh -r && ./test.sh -v
    >
    > The ACK port will be done once it works with gcc on Minix 3.
    >
    > I’m in irc.freenode.net as mirabilos, in case you want to do somereal-
    > time bug spotting, in the #!/bin/mksh channel (yes it is really called
    > like that).
    >
    > Thanks for your offer!
    >
    > bye,
    > //mirabilos
    > --
    > * "Using Lynx is like wearing a really good pair of shades: cuts out
    > * *the glare and harmful UV (ultra-vanity), and you feel so-o-oCOOL."
    > * * * * * * * * * * * * * * * * * * * * *--Henry Nelson, March 1999


    I followed the cvs download procedure and attempted to build using gcc
    and it failed. Do you have any of the code changes you made to get it
    to work under Minix with gcc? Otherwise I may just try to get it to
    work under ack since that is what I originally ported pdksh to.

    The Grue - James T. Sprinkle
    http://www.myspace.com/jamestsprinkle

  8. Re: Request for help in porting mksh

    The-Grue wrote...
    > On Nov 4, 12:05 pm, Thorsten Glaser wrote:
    > > The-Grue dixit:
    > >
    > > > On Oct 20, 1:38 pm, Thorsten Glaser wrote:
    > > >> Hello,

    > >
    > > >> I was forwarded at FrOSCon to ask here about this. I’m, among quite
    > > >> some
    > > >> other projects, developer of mksh – http://mirbsd.de/mksh – which I’d
    > > >> like to run on Minix 3. As it is a descendant of pdksh, which works,
    > > >> it
    > > >> should not be too big of a task. Unfortunately, pdksh used autoconf,
    > > >> but
    > > >> oksh, the thing in between of pdksh and mksh, was not portable to
    > > >> any-
    > > >> thing other than OpenBSD, so some of the portability had to be
    > > >> re-added.

    > >
    > > >

    > >
    > > > Hi! What is mksh? I did the pdksh port to Minix; so, I might be able
    > > > to help you with your port. Please contact me via e-mail.

    > >
    > > That would be superb!
    > >
    > > mksh is the same codebase as pdksh, but very modified in the meantime.
    > > It bases off oksh (OpenBSD /bin/ksh), which has removed all portability
    > > and autoconf stuff in order to make the beast maintainable and introduce
    > > bugfixes. mksh has added back portability in some way, but with a
    > > least-
    > > effort approach instead of GNU autoconf. (Latest target is QNX.)
    > >
    > > Overall, mksh is a pdksh superset, with some of the FPOSIX and FSH stuff
    > > removed, local mailbox checking removed (use biff/comsat or some IMAP
    > > client for that), and a huge load of bugfixes (e.g., command-line
    > > editing
    > > line-length), UTF-8 support, improvements (better array and numeric
    > > handling) and enhancements (bash-style arrays, &>, ${foo/bar/baz}, to
    > > name just a few), while staying relatively KISS as per the BSD “codex”.
    > >
    > > http://mirbsd.de/mksh
    > >
    > > % env CVS_RSH=ssh cvs -d anon...@anoncvs.mirbsd.org:/cvs co mksh
    > > % cd mksh
    > > % CC=gcc pdksh Build.sh -r && ./test.sh -v
    > >
    > > The ACK port will be done once it works with GCC on Minix 3.
    > >
    > > I’m in irc.freenode.net as mirabilos, in case you want to do some real-
    > > time bug spotting, in the #!/bin/mksh channel (yes, it really is called
    > > like that).

    >
    > I followed the CVS download procedure, and attempted to build using GCC --
    > and it failed. Do you have any of the code changes you made to get it
    > to work under Minix with GCC? Otherwise, I just may try to get it to
    > work under ACK, because that is what I originally ported pdksh to.


    They _haven't_ gotten it to work! That's the point of his post.
    He's asking for help.

    They assume that porting mksh to Minix's flavor of GCC will be easier than
    jumping all the way over to a different compiler system. They're thinking,
    "crawl before we walk."


  9. Re: Request for help in porting mksh

    Greg King dixit:

    >> I followed the CVS download procedure, and attempted to build using GCC --
    >> and it failed. Do you have any of the code changes you made to get it
    >> to work under Minix with GCC? Otherwise, I just may try to get it to
    >> work under ACK, because that is what I originally ported pdksh to.


    You may, of course, try to get it working under ACK as well, however,
    at one time in the past, I managed to get a (nōn-working) executable
    compiled using gcc.

    > They _haven't_ gotten it to work! That's the point of his post.
    > He's asking for help.


    Indeed.

    > They assume that porting mksh to Minix's flavor of GCC will be easier than
    > jumping all the way over to a different compiler system. They're thinking,
    > "crawl before we walk."


    Yes. Because I cannot test it with ACK on a nōn-Minix, known to work,
    platform, the port to Minix+gcc would certainly be easier.

    The goal is, eventually, to have _both_ working, of course. If you are
    going to try and help, to get it running with at least one of these, I
    am not the person to prescribe which of these

    If you have questions regarding parts of the build script, or run into
    other problems with ACK, please just contact me. After all, this stuff
    works on platforms like DEC ULTRIX 4.5 and OSF/1 V2.0 even…

    Thanks,
    //mirabilos
    --
    > Hi, does anyone sell openbsd stickers by themselves and not packaged
    > with other products?

    No, the only way I've seen them sold is for $40 with a free OpenBSD CD.
    -- Haroon Khalid and Steve Shockley in gmane.os.openbsd.misc

  10. Re: Request for help in porting mksh

    On Nov 5, 11:37*pm, "Greg King" wrote:
    > The-Grue wrote...
    > > On Nov 4, 12:05 pm, Thorsten Glaser wrote:
    > > > The-Grue dixit:

    >
    > > > > On Oct 20, 1:38 pm, Thorsten Glaser wrote:
    > > > >> Hello,

    >
    > > > >> I was forwarded at FrOSCon to ask here about this. *Im, amongquite
    > > > >> some
    > > > >> other projects, developer of mksh http://mirbsd.de/mksh which Id
    > > > >> like to run on Minix 3. *As it is a descendant of pdksh, which works,
    > > > >> it
    > > > >> should not be too big of a task. *Unfortunately, pdksh used autoconf,
    > > > >> but
    > > > >> oksh, the thing in between of pdksh and mksh, was not portable to
    > > > >> any-
    > > > >> thing other than OpenBSD, so some of the portability had to be
    > > > >> re-added.

    >
    > > > >

    >
    > > > > Hi! *What is mksh? *I did the pdksh port to Minix; so, I might be able
    > > > > to help you with your port. *Please contact me via e-mail.

    >
    > > > That would be superb!

    >
    > > > mksh is the same codebase as pdksh, but very modified in the meantime..
    > > > It bases off oksh (OpenBSD /bin/ksh), which has removed all portability
    > > > and autoconf stuff in order to make the beast maintainable and introduce
    > > > bugfixes. *mksh has added back portability in some way, but with a
    > > > least-
    > > > effort approach instead of GNU autoconf. *(Latest target is QNX.)

    >
    > > > Overall, mksh is a pdksh superset, with some of the FPOSIX and FSH stuff
    > > > removed, local mailbox checking removed (use biff/comsat or some IMAP
    > > > client for that), and a huge load of bugfixes (e.g., command-line
    > > > editing
    > > > line-length), UTF-8 support, improvements (better array and numeric
    > > > handling) and enhancements (bash-style arrays, &>, ${foo/bar/baz}, to
    > > > name just a few), while staying relatively KISS as per the BSD codex.

    >
    > > >http://mirbsd.de/mksh

    >
    > > > % env CVS_RSH=ssh cvs -d anon...@anoncvs.mirbsd.org:/cvs co mksh
    > > > % cd mksh
    > > > % CC=gcc pdksh Build.sh -r && ./test.sh -v

    >
    > > > The ACK port will be done once it works with GCC on Minix 3.

    >
    > > > Im in irc.freenode.net as mirabilos, in case you want to do some real-
    > > > time bug spotting, in the #!/bin/mksh channel (yes, it really is called
    > > > like that).

    >
    > > I followed the CVS download procedure, and attempted to build using GCC--
    > > and it failed. *Do you have any of the code changes you made to get it
    > > to work under Minix with GCC? *Otherwise, I just may try to get it to
    > > work under ACK, because that is what I originally ported pdksh to.

    >
    > They _haven't_ gotten it to work! *That's the point of his post.
    > He's asking for help.


    Excuse me Greg...I guess I should have been more clear. He stated
    that he got it to build, not work. I was asking for the code changes
    that he had made to get to the point that it would build. From there
    it is backtracking and debugging instead of starting the port fresh.

    > They assume that porting mksh to Minix's flavor of GCC will be easier than
    > jumping all the way over to a different compiler system. *They're thinking,
    > "crawl before we walk."- Hide quoted text -


    Point taken. I'll start with gcc. However, keep in mind that Ack is
    the default Minix compiler platform. It is preferred, last I was told
    anyway, to get things to work with Ack if possible.

    The Grue - James T. Sprinkle
    http://www.myspace.com/jamestsprinkle

  11. Re: Request for help in porting mksh

    The-Grue@hotmail.com dixit:

    >Excuse me Greg...I guess I should have been more clear. He stated
    >that he got it to build, not work. I was asking for the code changes
    >that he had made to get to the point that it would build.


    The entire codebase has changed a lot, so the hacks from back then
    would be useless now. Which difficulties did you have? If you mail
    me (privately would be better, I think) the Build.sh output, I’ll
    provide you with patches.

    >Point taken. I'll start with gcc. However, keep in mind that Ack is
    >the default Minix compiler platform. It is preferred, last I was told
    >anyway, to get things to work with Ack if possible.


    Yes, of course, that is the ultimate aim. However, when dealing with
    a platform where the base code does not yet work correctly, it’s better
    to not ALSO have to deal with problems with the compiler.

    bye,
    //mirabilos
    --
    Sometimes they [people] care too much: pretty printers [and syntax highligh-
    ting, d.A.] mechanically produce pretty output that accentuates irrelevant
    detail in the program, which is as sensible as putting all the prepositions
    in English text in bold font. -- Rob Pike in "Notes on Programming in C"

+ Reply to Thread