Skip to content

Creating a system library in Minix.

First of all go to /usr/src/include and create a header file with this structure:

NAME.h

_PROTOTYPE(int FUNCTION_NAME, (int PARAM));

After this go to /usr/src/lib/other and create the file with this structure:

NAME.c

#include<lib.h>
#include<unistd.h>
#include<stdio.h>

PUBLIC int FUNCTION_NAME(int PARAM) {
// WHAT TO DO?!
}

Edit the file Makefile.in in the same directory (/usr/src/lib/other). Add the name of your file in the list using alphabetical order.

What to do now?

You need to regenerate the Makefile.

$ cd /usr/src/lib/other/
$ make Makefile

Generate the libraries: (slow process)

$ cd /usr/src/tools
$ make libraries

And when it ends without erros “compile” the system:

$ cd /usr/src/tools
$ make hdboot

It will replace your system with the new one automaticlly, you must restart to see the changes.

Now how to test? Create a file in /root dir.

testTest.c

#include <stdio.h>
#include <unistd.h>
#include <lib.h>
#include <fcntl.h>
#include <NAME.h>

int main(int argc, char *argv[]) {
FUNCTION_NAME(PARAM);
}

Now you can create your own libraries to Minix system.

Example of library created by user to Minix

Best Regards,
Matheus

Published inAprendendoC

1,260 Comments

  1. online casino canada real money roulette, usa casino bonuses and deposit 5 get 100
    free spins uk, or $10 deposit usa casinos

    Also visit my web-site – baccarat dragon bonus payout, Yetta,

  2. best paying poker machines united states, susanville casino and casino
    online real money canada, or free play online burswood
    crown casino bars; Estelle, canada

  3. Ara Ara

    best online casino in new united states the pokies king, usa
    online casino no deposit and casino games online tips (Ara) listings usa,
    or canadian roulette winning numbers

  4. best online australian casino, pokies australia revenue and usa casino news,
    or best online casino for slots uk

    Feel free to visit my website; blazing blackjack vegas; Vilma,

Leave a Reply

Your email address will not be published. Required fields are marked *