System programming question.

This is a discussion on System programming question. within the C++ Programming forums, part of the General Programming Boards category; I'd like to know whether the loader is a part of the operating system or the compiler. Also, is the ...

  1. #1
    Registered User kiss_psycho's Avatar
    Join Date
    Feb 2003
    Posts
    49

    System programming question.

    I'd like to know whether the loader is a part of the operating system or the compiler. Also, is the loader architecture dependant? I mean, can there be two m/c's with different architecture and having the same executable headers, load the same program into memory using the same loader.
    Definition of Programmer : A red-eyed mumbling mammal capable of conversing with inanimate objects.

    Happy Hunting...
    The Root

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Can you rephrase? i dont quite follow, loader? m/c?

  3. #3
    Registered User kiss_psycho's Avatar
    Join Date
    Feb 2003
    Posts
    49
    I mean the loader program that is used to load a program into core memory. It is system software and is used to transfer an object program into main memory after assembling by the assembler. Now is the loader a part of the Operating system or is it compiler dependant/ architecture dependant.

    O, by m/c, i meant machine (lingo problem i guess)
    Definition of Programmer : A red-eyed mumbling mammal capable of conversing with inanimate objects.

    Happy Hunting...
    The Root

  4. #4
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    >>Now is the loader a part of the Operating system or is it compiler dependant/ architecture dependant

    Not compiler, either o/s, processor, or a combination of the two.

    >>I mean, can there be two m/c's with different architecture and having the same executable headers, load the same program into memory using the same loader.

    I dont see why not granted the o/s is the same.

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    The loader itself would be part of the OS.....it would have its own responsibilities (memory mapping, import/export resolution...etc)

    Also each loader expects certian types of executables....for instance the windows version works with PE executables...which is based on the COFF format........I think linux uses a format called ELF...but I'm not familiar with it

  6. #6
    Registered User kiss_psycho's Avatar
    Join Date
    Feb 2003
    Posts
    49
    So when run is selected, the program is compiled, assembled by TASM, and then the OS loader is invoked. If this is the case, then why is it that with win2k, we cannot access more than the conventional memory of 640 Kb. If the windows loader was used, then the memory available to the program should have been the available RAM capacity. In TC++ (DOS ) I tried and tried but could not allocate memory beyond the conventional segment. Don't tell me the loader is program dependant too.

    Help !!!
    Definition of Programmer : A red-eyed mumbling mammal capable of conversing with inanimate objects.

    Happy Hunting...
    The Root

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Your programs are a special case...if you use TASM.exe and TLINK.exe then your code is compiled for dos. (TASM32.exe and TLINK32.exe can produce fill Win32 applcations - but its not for the faint hearted!)

    When Windows sees a dos executable, it loads it to run in a "virtual machine"...that is, that it loads it into an environment where the dos program thinks it's running in dos...it thinks it has full access to the hardware and memory, but in fact its an emulation...that's why some dos programs work on windows 95, but some dont (some old dos games ask too much and so cant run properly in emulation mode)........so as you are not restricted from using dos tricks (well...some anyway), you still suffer from the 64KB memory access problem....

    Best bet....get Programming Windows by Charles Petzold and move to Win32.....

  8. #8
    Registered User kiss_psycho's Avatar
    Join Date
    Feb 2003
    Posts
    49
    I cant lift that book, let alone skim over it. well think i have to move on, getting queasy out here in DOS land. but lemme design a compiler first.
    Definition of Programmer : A red-eyed mumbling mammal capable of conversing with inanimate objects.

    Happy Hunting...
    The Root

  9. #9
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Originally posted by kiss_psycho
    but lemme design a compiler first.
    LOL.....yeah....first things first huh?


  10. #10
    Registered User kiss_psycho's Avatar
    Join Date
    Feb 2003
    Posts
    49
    Thats true, neway, got a lil game here. made it early years. its 640 480 bgi graphics, with a touch of userfriendliness using buttons, clicks, etc. check it out man.
    and yes, u gotta have the bgi folder in the .zip file in the path c:\tc

    i.e there should be in c:\tc\bgi all the bgi graphics files.
    Attached Files Attached Files
    • File Type: zip c.zip (173.9 KB, 48 views)
    Definition of Programmer : A red-eyed mumbling mammal capable of conversing with inanimate objects.

    Happy Hunting...
    The Root

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 10:13 AM
  2. another exercise question
    By luigi40 in forum C# Programming
    Replies: 3
    Last Post: 11-28-2005, 03:52 PM
  3. Question about the System() function...
    By YankeePride13 in forum Linux Programming
    Replies: 4
    Last Post: 11-18-2005, 02:45 PM
  4. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM
  5. Number system base M, print numbers N digits wide...
    By biterman in forum C Programming
    Replies: 12
    Last Post: 11-19-2001, 04:31 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21