Can some one explain OS X layer.

Discussion in 'macOS' started by nec207, Aug 25, 2011.

  1. nec207 macrumors 6502

    Joined:
    Mar 21, 2011
    #1
    I'm looking for information on the OS layer.I think it goes some thing like this .


    The user interface talks to application layer the application layer talks to the OS the OS talks to the Kernel the Kernel talk to the hardware.

    But I'm not sure where user level and system level is or why have a user level and system level at all.

    Also I was saying that Lion has a new Shell but one of the members was saying it is not:eek::eek: The API is little different. The finder API is little different.
     
  2. Shawnpk, Aug 25, 2011
    Last edited: Aug 27, 2011

    Shawnpk macrumors 6502

    Joined:
    Jan 13, 2011
    Location:
    Los Angeles, CA
    #2
    Look at this. Scroll down to where it says "How Cocoa Fits into Mac OS X" and you'll see a graphic of what you're looking for. (I think)
     
  3. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #3

    The web site does not work.
     
  4. Shawnpk macrumors 6502

    Joined:
    Jan 13, 2011
    Location:
    Los Angeles, CA
  5. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #5
    Works fine here. I found it interesting, coming from a *NIX kernel background.
     
  6. drambuie macrumors 6502a

    Joined:
    Feb 16, 2010
    #6
    Are you using a PC or Apple? The link doesn't work on my Windows PC, so I tried it with my MBP, and it works.
     
  7. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #7
    Here is post from apple on OS X structure and OS layer.

    Very intresting.

    http://developer.apple.com/library/...ocoaFundamentals/WhatIsCocoa/WhatIsCocoa.html

    Can some one explain what is in bold above what it does .

    Also when people say application environment is this the same as desktop environment ie GUI?


    In the 90's apple used other desktop environment or GUI before OS X came out.Also Lion ues a different GUI than snow leopard.
     
  8. Shawnpk macrumors 6502

    Joined:
    Jan 13, 2011
    Location:
    Los Angeles, CA
    #8
    runtime system - A run-time system (also called runtime system or just runtime) is software designed to support the execution of computer programs written in some computer language. The run-time system contains implementations of basic low-level commands and may also implement higher-level commands and may support type checking, debugging, and even code generation and optimization.

    object-oriented software libraries is pretty self explanatory.
     
  9. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #9
    OS X does not use DLL files like windows that loads it self every where.
     
  10. munkery macrumors 68020

    munkery

    Joined:
    Dec 18, 2006
    #10
    Referring to user and system level is a model to explain permissions in relation to discretionary access controls. There is no reason to fit other levels into creating a model to explain permissions.

    Other models are used to explain how operating systems function in general. The separation of layers in those other models has no relationship to permissions. Various parts in each layer have restricted permissions while others do not.

    I think you are confused due to trying to blend these different models together.

    What function of the operating system are you trying to understand?

    If you want to understand permissions, read about Unix permissions and discretionary access controls.

    If you want to understand how an operating system functions in general, read about the OSI model.

    You have to keep in mind that how the various APIs and OS components are layered in the OSI model is independent of what permissions are applied to each item.

    Typically, APIs and components that are in lower layers of the OSI model have restricted permissions if discretionary access controls are enabled.
     
  11. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #11
    First I think I'm confused with Aqua vs Cocoa/Carbon . And that is why the very old thread I made called Cocoa/Carbon a GUI .Saying the finder got new look and feel to do Cocoa now using Carbon .So there is confused there.


    Also I'm confused what API or toolkits do.


    Second I think I'm getting confused with desktop environment that Linux and Unix calls it where windows and OS X calls it GUI.

    When you read stuff above like ''Cocoa is an application environment for both the Mac OS X operating system and iOS ''

    I'm still not sure what object-oriented software libraries or libraries do with Cocoa or Carbon.
     
  12. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #12
    "software libraries" or "libraries" are generally an interface between applications layer and system layer. For example, if you write an app that does a call like "Open" or "read" then the app merely makes a call to an object called "open" which converts the call into something the lower layer can deal with.

    This is very generalized, and the terminology can change between *Nixes.

    These whole layers were built up from the distant past when you had to know exactly how to program specific devices from your application. If you wanted to read from the console, you needed to know what low level instructions were needed to read from the console and how to check for busy or errors and when to stop reading. This was very tedious and fraught with problems, especially if you wanted to move your code to a different machine.

    Nowdays, the layers insulate the applications from what's going on down below.

    Hope this is somewhat helpful
     
  13. munkery, Aug 31, 2011
    Last edited: Aug 31, 2011

    munkery macrumors 68020

    munkery

    Joined:
    Dec 18, 2006
    #13
    Cocoa and Carbon are APIs which applications use to interact with the rest of OS X.

    Aqua is both the GUI and desktop environment of OS X that is used by applications, which use Cocoa and Carbon.

    APIs and toolkits (library or framework) provide a interface for the applications to function. Without APIs, applications would be unable to interact with the rest of the operating system.

    Apple's proprietary programming language, called Objective-C, is an object-oriented programming language.

    Understanding the difference between Objective-C and C programming languages is not really important to understanding how APIs and libraries function.

    A library is a collection of programming functions that serves one particular purpose.

    A framework is a collection of libraries that are used by an application to produce the functions of the application.

    An API is an interface for other parts of the operating system to interact with the application.
     
  14. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #14
    What is application environment than say desktop environment .

    I thought Linux and Unix calls it desktop environment and windows and OS X calls it GUI.

    Also why does OS X ,Linux and Unix have no DLL files but windows does?And windows loads DLL files every where. with you install new software.
     
  15. munkery, Aug 31, 2011
    Last edited: Aug 31, 2011

    munkery macrumors 68020

    munkery

    Joined:
    Dec 18, 2006
    #15
    Application environment = consists of APIs, frameworks, and libraries. This is an interface related to the interaction of applications with the operating system.

    Desktop environment = is the GUI. This is an interface related to the interaction of the user with applications and the operating system.

    Desktop environment and GUI are interchangeable terms. Both refer to the same thing.

    The term GUI can be used to refer to a subset of the desktop environment as well. For example, the specific GUI of a single application is referred to as a GUI but it is not a desktop environment.

    Desktop environment refers to the entire set of GUIs represented within the operating system.

    DLLs are shared libraries. Shared libraries are used by more than one application.

    OS X, Linux, and most other OSs have some implementation of shared libraries.

    OS X shared libraries are called dylibs. The dylibs are loaded into a single binary called dyld. Dylibs are not typically installed via third party software. This is because OS X uses app bundles that are self contained by having required libraries included in the bundle.

    Windows does not load dlls into a single binary. DLLs are commonly installed by third party software. Windows does not typically use a portable applications format, such as the app bundle architecture used in OS X.
     
  16. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #16
    I thought DLL files was reason for so much error messages and malware in windows . Why would Linux and OS X use it?


    sorry I do not understand .I thought windows comes with most DLL files and other DLL files you get when one installs the software.

    This is why one should not move app around in windows or install or remove apps in windows with out using the installer.


    If you move apps around in windows as windows makes DLL files and registry entry and moving it will break it.Also Microsoft wants people to use shortcuts and moving apps will break the shortcuts of path of the files.Most of the time there is a shortcuts on the desktop and start menu.

    So is it not in the best intrest for programmers to use DLL files and the registry as you can get error message and malware not to say you cannot move apps around or install or remove apps with out using the installer.

    I hear some small apps not the practice of big apps in windows are going this way where you do not have to install or unstall the apps it is a self contained bundle
     
  17. munkery macrumors 68020

    munkery

    Joined:
    Dec 18, 2006
    #17
    Shared libraries are not a problem in OS X because users do not typically install or modify the shared libraries in OS X. OS X avoids this using self contained app bundles.

    Linux avoids many issues related to shared libraries via using curated repositories as a source to get software for installation.

    OS X and Linux have fewer shared libraries than Windows as well. This reduces the likelihood of issues due to shared libraries.

    The install location of shared libraries is protected via DAC if DAC is enabled. DAC is much more easily bypassed in Windows and earlier versions of Windows do not have DAC enabled by default.

    More user modification of the system level and weaker DAC are the primary reasons that DLLs are related to more errors and malware issues in Windows.

    Also, the manner in which DLLs are loaded into memory doesn't allow applications in Windows to be fully position independent executables (PIE). Not having full PIE makes bypassing security mitigations easier in Windows.

    This is true. OS X avoids the user installing more shared libraries by using app bundles.

    App bundles are the reason that this is not an issue in OS X. Another factor is that few third party applications are installed in the system level of OS X.

    But, Windows requires the user to modify the system level of the OS to install most applications.

    The use of DLLs can be avoided.

    But, I think developers are stuck with using the registry. Not sure about this.

    Regardless if developers avoid the registry, MS will continue use the registry so most issues with the registry will remain.

    Don't know of too many apps that are doing this. The only example that I can think of is Chrome.
     
  18. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #18
  19. nec207 thread starter macrumors 6502

    Joined:
    Mar 21, 2011
    #19
    On site note Lion got new UI change and this as nothing to do with Cocoa or Carbon .

    Did Apple change Aqua little bit ? To get new UI change in Lion?
     
  20. munkery macrumors 68020

    munkery

    Joined:
    Dec 18, 2006
    #20
    Apple does make subtle changes to the Aqua interface across different versions of OS X.
     

Share This Page