Here's a few silly questions I still don't know the answer to
1. What is the "heap" ?
2. Will your memory manager only come in to use once you have a linkage loader so you can actualy load programs into memory and execute them?
A Few Questions
Re:A Few Questions
It's a pile of stuff.chris wrote: 1. What is the "heap" ?
In a more technical context, it's an area of memory that is used to satisfy allocation requests. For a more detailed explanation, feel free to read the source to malloc(3) or the books Windows Internals or Windows 95 System Programming Secrets. Or any discussion of application-level (as opposed to system-level) memory management.
I don't know about other people, but my memory manager will be an integral part of the system, to the point where device drivers will have to be carefully written -not- to use it.2. Will your memory manager only come in to use once you have a linkage loader so you can actualy load programs into memory and execute them?
At least, that's the plan. Not like I have much time right now for follow-through...
Re:A Few Questions
a mechanism for dynamically allocating and freeing chunks of memory on demand of the program, like what is returned by "new" operator and malloc()1. What is the "heap" ?
the heap allocator requests large blocks of memory from the operating system, breaks them up into smaller chunks of the requested size and returns the address of a chunk.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:A Few Questions
the "heap" is the name given to the memory area that can be used for dynamic allocation. malloc, the C++ and pascal new operators return references on data structure that are on the heap, which means their lifetime is not bound to a specific function call, but that their existence needn't to be forseen at compile-time.
This is very convenient when you have to handle variable-sized containers like lists, vectors, trees, etc.
I wouldn't recommend to postpone the devlopment of the dynamic memory manager until you start loading programs in a modern OS, because there will be many structures (process list, sleeping threads, pending timers, etc) that you'll have to deal with *before* you actually start loading programs and which will have to be dynamic once you'll start running user programs.
It's just like making the system thread-safe before you have many threads: it sounds silly, but once you add the second thread, the code is ready to deal with it ...
This is very convenient when you have to handle variable-sized containers like lists, vectors, trees, etc.
I wouldn't recommend to postpone the devlopment of the dynamic memory manager until you start loading programs in a modern OS, because there will be many structures (process list, sleeping threads, pending timers, etc) that you'll have to deal with *before* you actually start loading programs and which will have to be dynamic once you'll start running user programs.
It's just like making the system thread-safe before you have many threads: it sounds silly, but once you add the second thread, the code is ready to deal with it ...
Re:A Few Questions
Hmm, two other quick questions ;D
Whats the difference between iret and iretd; and popad and pushad?
*and*
In the multiboot_info struct in the multiboot.h for GRUB, what does mem_upper and mem_lower represent? Is it the top and bottom of the physical memory? How can I use this to determine the physical memory size?
Thanks ;D
Whats the difference between iret and iretd; and popad and pushad?
*and*
In the multiboot_info struct in the multiboot.h for GRUB, what does mem_upper and mem_lower represent? Is it the top and bottom of the physical memory? How can I use this to determine the physical memory size?
Thanks ;D