Side focus of programming again to renew m drive

I have a renewed interest in C and Ada programming.  Since I worked on a project for a long time that was ultimately in vain -- a shell written in pure Ada -- I have realized that with the Ada-run-time limitations, the only way I can create a shell that works on multiple operating systems is to write in the code base that is most common between them.  That is C.  Objective C is the primary for macOS, C++, and a little more and more C#, is the primary for MS Windows, but those directly support C calls and syntax and C is the primary for Linux, so there you go.  C preprocessing also allows me to write conditional code for each operating system, so that I can artificially create the kind of interface to the system that matches one Ada library regardless of what system it is compiled on.  These are the definitions I have fortunately discovered:

    __linux__       Defined on Linux
    __sun           Defined on Solaris
    __FreeBSD__     Defined on FreeBSD
    __NetBSD__      Defined on NetBSD
    __OpenBSD__     Defined on OpenBSD
    __APPLE__       Defined on Mac OS X
    __hpux          Defined on HP-UX
    __osf__         Defined on Tru64 UNIX (formerly DEC OSF1)
    __sgi           Defined on Irix
    _AIX            Defined on AIX
    _WIN32  Defined on Windows
    _WIN64  Defined on Windows x64 systems

This is a start toward my Terminal interface libraries that I was working on a while ago.  I may simply start over and reference my old work for the nitty-gritty of unix terminals.  Windows Console interface is not so difficult.  My biggest problem with Windows is going to be permissions and security stuff.  With Unix like systems, it is all built-in to the OS and the process instance in a simplistic tag or name that I can fully comprehend, but with Windows, there is no simple security check against a name or a simplistic file permission tag.  With Windows there is a full lookup within the OS for anything requiring permissions. 

The significant OS differences make it more difficult to show the finer control commands in my little Ada shell.  I can label all character input/output, file types, input/output handles, and similar interfaces to the operating system with Integer and have that integer be the index of an array that is looked up in the local C code.  This way the integer is handled in the Ada code and the system-dependent types in C are reference-able

I want my Ada-shell system to work so that I can produce the interactive learning system that I started for the Math class this year.

I hope that this programming drive I have may be used as fuel for my recently diminishing drive to continue and succeed at school work.  I have been getting depressed at the challenge of keeping both my school schedule and my otherwise-life schedule.


Comments

Popular posts from this blog

Week 12 Family Relationship Goals

RELPC 122