www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/13/06:57:36

Message-ID: <6MhNRh-jccB@jocokko.edition.bonbit.org>
MIME-Version: 1.0
From: kay AT edition DOT bonbit DOT org (Kay Hayen)
Subject: Reducing file size - again
Date: 12 Dec 1996 00:00:00 +0000
Newsgroups: comp.os.msdos.djgpp
Distribution: world
Lines: 71
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hallo.

So I read Section 8.15 of the FAQ 2.02, and there it says: ( reformated  
a bit )

>Apart from getting to protected-mode, the DJGPP startup code also
>includes such functionality as

> - command-line argument expansion

This is explicitly NOT wishfull for my programm as I use a alternative  
command line parsing lib. I currently construct a plain "char *" with  
the command line to pass it.

> - long command-line support

Think my tool won't need this.

> - loading the environment from a disk file

I'm not so sure, what the enviroment would be. But as I needn't ever  
make changes to such a thing, I suppose the defaults are fine for my  
tool.

> - Exception handling

Needn't be that infomative for my tool. Most of the information is only  
usefull for debugging.

> - FPU detection and emulator loading

Yes, my tool need's this.

>If your program doesn't need parts of the startup code, it can be made
>smaller by defining certain functions with empty bodies. These
>functions are __crt0_glob_function , __crt0_load_environment_file , and
>__crt0_setup_arguments. By defining empty substitutes for all three of
>these, you can make the "Hello" program be 18KB on disk.

I tried it out. Effects seemed like

__crt0_glob_function empty  -> malloc fails allways
__crt0_load_enviroment_file -> nothing noticeable
__crt0_setup_arguments      -> can't get the command line

Now the situation for my tool. It has a simple task to do, it applies  
patches generated with another tool.

It does some command line parsing, but all it needed was as simple  
pointer to the textual infomation. Tried some things, but I couldn't use  
the __crt0_setup_arguments to intercept it somehow, for I don't know the  
correct defination of it. Could somebody post it ?

Also it does some standard IO to read/write files and some screen  
output.

It's memory usage depends on the patches, but I could rewrite it to use  
only a bit. Are there DOS-alternatives to malloc, I could use ?

Maybe one could give a URL to the crt0 source ? This would sure help a  
lot too.

        Mls, Kay


-- =
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
>>Shareware nutzen ist gut, sie zu registrieren auch.
>Diese Nachricht besteht zu 100% aus recycelten Elektronen.
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019