can anyone help please...(urgent)

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
arunkumar
Posts: 1
Joined: Tue Jun 03, 2008 1:01 am

can anyone help please...(urgent)

Post by arunkumar »

hi,
i would like to have the information of exactly how a file/program is stored in secondary memory? how it is then loaded into main memory and how execution actually take place there?

i have the basic understanding of scheduling, paging and segmentation but i want an example (or theory) which clearly tells how a program is executed in the main memory? like (code segment data segment ........what and all will be loaded of a file when it is to be loaded into the pri mem)

i would appreciate replies as early as possible
:)
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

@Mods: Wrong subforum - likely only to get flames here.
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

If u really want theory

Post by DeletedAccount »

If you really want theory , just take a look Maurice J Bach , Design of the Unix Operating System . Read File Systems Chapter on Andy S Tanenbaums Book and Dinosour book . Try Nachos and OS -161 - they are great to learn theory . Also please try to solve the exercise too ...

Regards
Sandeep Mathew
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Post by DeletedAccount »

As a side note : people here treat u with scant repect if you havent done much reading . Just make sure u read before posting :P
Last edited by DeletedAccount on Tue Jun 03, 2008 2:51 am, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Urgent? What the heck :shock:

If you are on a school deadline or something then let us take it easy - the exercise exists for a reason. :evil:

As for the actual question: You can do paging, scheduling and everything, and you *do not know* how a program works? Either I'm completely missing something or you should really elaborate on what exactly you can't figure out. :?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: can anyone help please...(urgent)

Post by jal »

arunkumar wrote:i would like to have the information of exactly how a file/program is stored in secondary memory? how it is then loaded into main memory and how execution actually take place there?
You mean by 'secondary memory' a storage device (e.g. hard drive), and by 'main memory' the RAM I assume? Anyway, that of course depends on the operating system, the file system used and the executable format used. There is no 'exactly', there are a myriad of OSes and different fs/exe formats.

In general though, an executable on disk (or another storage device) consists of the actual program code, any predefined data it needs, and an executable header (that's the header of the executable, not a header that is executable, of course) that tells the operating system everything it needs to load the code and data, and to start running the code. Usually an OS part called a 'loader' will do the actual reading from disk, create the right environment and tell the OS to schedule the code for running. As for execution, it doesn't take place in the memory of course, but inside the CPU.


JAL
Post Reply