{"id":1225,"date":"1997-01-01T00:00:00","date_gmt":"1997-01-01T00:00:00","guid":{"rendered":"https:\/\/seegras.discordia.ch\/Blog\/?p=1225"},"modified":"2019-01-17T23:54:44","modified_gmt":"2019-01-17T22:54:44","slug":"open-the-sources","status":"publish","type":"post","link":"https:\/\/seegras.discordia.ch\/Blog\/open-the-sources\/","title":{"rendered":"Open the Sources"},"content":{"rendered":"<div id=\"fortune\"><i><br \/>\nDon&#8217;t give in to the Dark Side<\/i><\/div>\n<p>There is a growing pool of software, originally written for MS-DOS, which now<br \/>\nbecomes more and more impossible to run. People maybe liked a certain program<br \/>\nor used it for their hobbies, but now, they have another Operating System, and<br \/>\nthey don&#8217;t want to use DOS or to reboot just to use this peace of program.<\/p>\n<p>This, of course, happened to me with roleplaying-related programs when<br \/>\nI switched to Linux. I only use DOS for playing computer-games, and I only<br \/>\nboot it when I am sure that I will need it for an hour or more. Surely not<br \/>\nfor using some DOS program which probably even runs on the commandline.<\/p>\n<p>So there goes the solution: Recompile it. Simply. If there is a source, I<br \/>\nnormally do that, and so I&#8217;ve got quite a collection of programs which I<br \/>\nported from DOS to Linux. And so, I&#8217;d like everyone to tell:<\/p>\n<div id=\"center\">\n<h2>Release your Sourcecodes!<\/h2>\n<\/div>\n<p>It doesn&#8217;t hurt you to release a source-code of some program you wrote<br \/>\nfive years ago. There is plenty of possibility to recycle old sourcecodes,<br \/>\neven when they&#8217;re written in some weird language such as BASIC.<\/p>\n<p>So I take a look now at some possibilities and quirks regarding different<br \/>\nprogramming languages, their implementations and their portability. Especially<br \/>\nin regard to Unix\/Linux.<\/p>\n<h3>Where, please?<\/h3>\n<p>Todays standard is C. Or some variation of it like Objective-C or C++.<br \/>\nSo the point is:<\/p>\n<ul>\n<li>Port your Program to C if possible.<\/li>\n<li>Make it run on another operating system.<\/li>\n<\/ul>\n<p>We&#8217;re gonna use the GNU C-Compiler, because it&#8217;s one of the best, and it&#8217;s<br \/>\navailable on nearly <b>every<\/b> platform (Unix, Windows NT, OS\/2, DOS, only<br \/>\nto mention the most common ones).<\/p>\n<p>GNU C or GCC comes in three different variations, as C-compiler, C++-compiler<br \/>\nand objective-C-compiler. And then there are some add-ons (or merely pre-<br \/>\nprocessors) which can translate pascal and fortran to C. So there&#8217;s no such<br \/>\nbig problem translating fortran or pascal to C. So here we go examining some<br \/>\ncompilers and how their code can be translated to GCC.<\/p>\n<p><i><b>Note:<\/b> You cannot normally use conio.h or dos.h for programs not running on<br \/>\nDOS. So this must be circumvented in some way.<\/i><\/p>\n<h3>What general problems are to expect?<\/h3>\n<ul>\n<li>Command-line based programs should easily be ported. Problems can arise<br \/>\nout of different length of data-types.<\/li>\n<li>Character based programs using console io might give some troubles. The<br \/>\nproblem most often encountered will be that other operating systems do<br \/>\nnot allow direct manipulation of their console. This appears with conio.h<\/li>\n<li>Graphically enhanced programs really aren&#8217;t easy to port. Instead of using<br \/>\nlanguage-specific or self-programmed graphic enhancements, svgalib must be<br \/>\nused. This can be as difficult as rewriting the whole program from scratch.<\/li>\n<\/ul>\n<h3>What problems are to expect using specific languages?<\/h3>\n<h4>C<\/h4>\n<ul>\n<li><b>DJGPP<\/b> &#8211; The GNU-C for DOS, no changes necessary.<\/li>\n<li><b>Symantec C<\/b> &#8211; dos.h and conio.h, as well as makefiles<\/li>\n<li><b>Turbo C<\/b> &#8211; dos.h and conio.h, as well as makefiles<\/li>\n<li><b>Borland C<\/b> &#8211; dos.h and conio.h, as well as makefiles<\/li>\n<li><b>Microsoft C<\/b> &#8211; dos.h and conio.h, as well as makefiles<\/li>\n<li><b>Quick C<\/b> &#8211; dos.h and conio.h, as well as makefiles<\/li>\n<\/ul>\n<h4>Pascal<\/h4>\n<ul>\n<li><b>Turbo Pascal<\/b>  &#8211; dos.h and conio.h<\/li>\n<li><b><\/b><\/li>\n<\/ul>\n<h4>Basic<\/h4>\n<ul>\n<li><b>GW or MS-Basic<\/b> &#8211; line-numbering<\/li>\n<li><b>Turbo Basic<\/b><\/li>\n<li><b>Quick Basic<\/b><\/li>\n<\/ul>\n<h3>C Problems<\/h3>\n<h4>dos.h<\/h4>\n<p>This one defines variable types and FAT-filesystem-specific things. Problems<br \/>\ncan arise out of different lengths of data types (16 vs 32 bits).<\/p>\n<h4>conio.h<\/h4>\n<p>conio.h (console i\/o) does not exist on Unix. There is a port of conio.h,<br \/>\nbut this shouldn&#8217;t be used. Instead, ncurses.h or curses.h should be used.<\/p>\n<p>Peter Keel,<\/p>\n<div id=\"date\">1997-01<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Don&#8217;t give in to the Dark Side There is a growing pool of software, originally written for MS-DOS, which now becomes more and more impossible to run. People maybe liked a certain program or used it for their hobbies, but now, they have another Operating System, and they don&#8217;t want to use DOS or to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,87],"tags":[],"class_list":["post-1225","post","type-post","status-publish","format-standard","hentry","category-computers","category-copyright-politics"],"_links":{"self":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/1225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/comments?post=1225"}],"version-history":[{"count":1,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/1225\/revisions"}],"predecessor-version":[{"id":1274,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/1225\/revisions\/1274"}],"wp:attachment":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/media?parent=1225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/categories?post=1225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/tags?post=1225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}