{"id":747,"date":"2010-07-26T00:57:26","date_gmt":"2010-07-26T03:57:26","guid":{"rendered":"http:\/\/wordpress.matbra.com\/?p=747"},"modified":"2010-07-27T23:28:03","modified_gmt":"2010-07-28T02:28:03","slug":"criando-uma-biblioteca-do-sistema-no-minix","status":"publish","type":"post","link":"https:\/\/wordpress.matbra.com\/en\/2010\/07\/26\/criando-uma-biblioteca-do-sistema-no-minix\/","title":{"rendered":"Creating a system library in Minix."},"content":{"rendered":"<p>First of all go to \/usr\/src\/include and create a header file with this structure:<\/p>\n<p>NAME.h<\/p>\n<blockquote><p>_PROTOTYPE(int FUNCTION_NAME, (int PARAM));<\/p><\/blockquote>\n<p><!--more--><\/p>\n<p>After this go to \/usr\/src\/lib\/other and create the file with this structure:<\/p>\n<p>NAME.c<\/p>\n<blockquote><p>#include&lt;lib.h&gt;<br \/>\n#include&lt;unistd.h&gt;<br \/>\n#include&lt;stdio.h&gt;<\/p>\n<p>PUBLIC int FUNCTION_NAME(int PARAM) {<br \/>\n\/\/ WHAT TO DO?!<br \/>\n}<\/p><\/blockquote>\n<p>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.<\/p>\n<p>What to do now?<\/p>\n<p>You need to regenerate the Makefile.<\/p>\n<blockquote><p>$ cd \/usr\/src\/lib\/other\/<br \/>\n$ make Makefile<\/p><\/blockquote>\n<p>Generate the libraries: (slow process)<\/p>\n<blockquote><p>$ cd \/usr\/src\/tools<br \/>\n$ make libraries<\/p><\/blockquote>\n<p>And when it ends without erros &#8220;compile&#8221; the system:<\/p>\n<blockquote><p>$ cd \/usr\/src\/tools<br \/>\n$ make hdboot<\/p><\/blockquote>\n<p>It will replace your system with the new one automaticlly, you must restart to see the changes.<\/p>\n<p>Now how to test? Create a file in \/root dir.<\/p>\n<p>testTest.c<\/p>\n<blockquote><p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;unistd.h&gt;<br \/>\n#include &lt;lib.h&gt;<br \/>\n#include &lt;fcntl.h&gt;<br \/>\n#include &lt;NAME.h&gt;<\/p>\n<p>int main(int argc, char *argv[]) {<br \/>\nFUNCTION_NAME(PARAM);<br \/>\n}<\/p><\/blockquote>\n<p>Now you can create your own libraries to Minix system.<\/p>\n<p><a href=\"http:\/\/wordpress.matbra.com\/wp-content\/uploads\/Test-Files.tar.gz\">Example of library created by user to Minix<\/a><\/p>\n<p>Best Regards,<br \/>\nMatheus<\/p>","protected":false},"excerpt":{"rendered":"<p>First of all go to \/usr\/src\/include and create a header file with this structure: NAME.h _PROTOTYPE(int FUNCTION_NAME, (int PARAM));<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,15],"tags":[175,173,174,172],"class_list":["post-747","post","type-post","status-publish","format-standard","hentry","category-aprendendo","category-c","tag-creation","tag-learning","tag-library","tag-minix","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/psjGE-c3","_links":{"self":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/comments?post=747"}],"version-history":[{"count":5,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/747\/revisions"}],"predecessor-version":[{"id":751,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/747\/revisions\/751"}],"wp:attachment":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/media?parent=747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/categories?post=747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/tags?post=747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}