How To Create and Deploy Programs in Minix




Дата канвертавання22.04.2016
Памер5.85 Kb.

How To Create and Deploy Programs in Minix


This manual will illustrate as to how you can create and deploy your programs in minix. For Compiling Minix User Programs, we use the sunread and sunwrite commands. I have this example for your reference, so you start running your programs with ease. Please feel free to use it

 

Type cd /home/seed/785/san/smx/src/tools



Create your C program (let’s call ours helloworld.c)

Type mcc helloworld.c –o helloworld (Note: you can create it anywhere, but you would need to put the program entry in your Makefile)

Run minix

Login as root

Type sunread helloworld > helloworld

Type chmod +x helloworld

Run helloworld


 

Suppose you want to run the following test.c program in Minix:

#include

main (int argc, char **argv)

{

printf ("Testing For Minix\n");



}

A copy of this program is located in your src/tools directory. Compile the program with the command mcc test.c -o test. Next, while running Minix you can type the command sunread test > test to read in the compiled test program. You can't read it into /usr/bin since those are read-only file systems. Next, make the program executable with the command chmod +x test. Then type test to run the program. There is an analogous sunwrite command, which writes a file from a Minix file system into a Solaris file system. Type man sunread and man sunwrite, in Minix, for more information.



 

NOTE: if you recompile your libraries (make in src/lib), the newly recompiled libraries will not be used until you then recompile the code that uses those libraries. So if you recompile your libraries, then recompile Minix, the Minix test code (if needed), and any Minix user programs that you've written.


База данных защищена авторским правом ©shkola.of.by 2016
звярнуцца да адміністрацыі

    Галоўная старонка