Tokonoma.de

Analysis of the VIM-package in Minix

I use vim. Often I don't like vim, because I cannot remember all of these 2^10 different commands. But vim is powerful, using it feels a bit like magic sometimes.

I downloaded the vim-Minix package from: http://www.minix3.org/software/vim-6.3.tar.bz2 and the original source from:ftp://ftp.vim.org/pub/vim/unix/vim-6.3.tar.bz2

Then I used diff to compare the source-trees. I wonder why there is no README_Minix.txt file.

I ignored the "tags"-files, because they are generated files (and shouldn't be in a source-distribution). The tags-file in Minix has zero-length anyway.

I also ignored the vim-files, because all differences in them were trivial, because they were only those automatic CVS-comments like this one

Version: $Id: ada.vim,v 1.27 2004/02/24 12:54:14 nabird Exp $

They can be safely ignored. VIM-scripts are platform independent anyway.

This left 8 modified files and 5 files that are unique in the Minix-package:

Let's start with the 5 new files in the Minix-package:

  • The file "./build" contains

#!/bin/sh make make install

It contains no information.

  • The file "./.descr" contains

vi improved

It contains no (new) information. Possibly it's a sort of container for the package name.

  • The file "src/auto/config.log" is obviously a generated file, produced during the configure run. I wonder why it has been put in the source-distribution. The same is true for

  • the file "src/auto/config.status" and

  • the file "src/auto/config.cache".

Now, this is encouraging. There have no substantial files been added to get vim compiling on Minix.

Let's have a look at the modified files.

  • The files "src/pty.c" and "src/mkinstalldirs" are changed in the same fashion like the vim-files noted above. They can be ignored.

  • The files "src/auto/config.h" and "src/auto/config.mk" are generated again (see. 3.-5. in the previous section). They can be ignored.

This leaves four files with real changes:

  • In "src/memfile.c" the following change was applied (new lines in red font):

#undef STATFS #undef USE_FSTATFS #if defined(STATFS) && defined(UNIX) && !defined(__QNX__) # define USE_FSTATFS struct STATFSstf; #endif

Obviously Minix doesn't want to haveUSE_FSTATFS defined.

  • In "src/os_unix.c" the follwoing changes were applied.

include "vim.h" #define _POSIX_SOURCE 1 #define _MINIX 1 #include «termios.h» include «sys/select.h» ifdef HAVE_FCNTL_H include «fcntl.h» #endif

Two pre-processor vars are defined and two header-files are included. I didn't dig deeper into this.

  • In "src/proto/os_unix.pro" the line

int mch_get_uname __ARGSuid_t uid;

was added. Why beats me, since this function is never used. And I didn't inquire what this proto-directory is for. Probably this change is not important.

  • The biggest changes were done in "src/Makefile".

  • a. Most of the "ln" commands got the option "-s" removed. But some were kept. Perhaps this was an oversight. All occurrences where there is:

cd $(DEST_BIN); or cd $(DEST_MAN);

the link command was "unsoftenend". Perhaps Minix doesn't support softlinks?

original: cd $(DEST_BIN); ln -s $(VIMTARGET) $(EXTARGET) patched: cd $(DEST_BIN); ln $(VIMTARGET) $(EXTARGET)

If this assumption is true, then there is a problem in the Makefile emerging from the use of "ln -s" in several more places.

  • b. The $(TOOLS) target was removed here:

all: $(VIMTARGET) languages

The porter was obviously not willing to port those tools and/or make-instructions.

This line got commented out. Therefore the helptags don't get created.

-@cd $(HELPSOURCE); $(MAKE) VIMEXE=$(DEST_BIN)/$(VIMTARGET) vimtags
  • c. In the target installvimbin a new command was added:

chmem =1200000 $(DEST_BIN)/$(VIMTARGET)

Now this is important and indeed Minix-specific. From the Minix-webpages I learn, that chmem is used to change the memory allocation mode for a binary. The size of the stack space seems arbitrary here and violates the programmers mantra "Don't use literals". So I cannot derive a recommendation for other applications from this value.

For reference see http://www.minix3.org/manpages/man1/chmem.1.html

File last modified: 19:14:22 18-Aug-2009