hi guys
what do u think is the best memory space i should reserve for kernel code, data, stack ?
and for user process, how much mem space i should allocate for each process (code, data, stack) ?
allocated space
Re:allocated space
kernel data/code/stack: what it needs (depending on its size). In address space, say, half?HardEnough wrote: hi guys
what do u think is the best memory space i should reserve for kernel code, data, stack ?
and for user process, how much mem space i should allocate for each process (code, data, stack) ?
User process: look at the file and make space for it.
Re:allocated space
In physical size of the kernel, as much as you need, in terms of the address space, the conventional size is 1GB of virtual addressing.
The conventional address space size for user apps is 2GB with 1GB reserved for loading libraries (aka DLLs). In terms of preallocation, you can allocate enough space for the whole binary straight up or you can use the typical 'faulting approach' (load nothing at all and just load the program in page by page as page faults occur)
The conventional address space size for user apps is 2GB with 1GB reserved for loading libraries (aka DLLs). In terms of preallocation, you can allocate enough space for the whole binary straight up or you can use the typical 'faulting approach' (load nothing at all and just load the program in page by page as page faults occur)
Re:allocated space
2 / 1 / 1 GB, as said above, is default for most desktop systems.
Servers (proxy caches, databases, that kind of stuff) frequently require much more user data to be kept than mere 2 GB; there are solutions that allow 3 GB and more to be allocated for application data, which is very welcome in such environments.
Games also tend into that direction. Consider "World of Warcraft" with a recommended physical memory of 1 GByte or more... won't be long before games, too, will consider 2 GB of allocateable RAM to be too small.
Servers (proxy caches, databases, that kind of stuff) frequently require much more user data to be kept than mere 2 GB; there are solutions that allow 3 GB and more to be allocated for application data, which is very welcome in such environments.
Games also tend into that direction. Consider "World of Warcraft" with a recommended physical memory of 1 GByte or more... won't be long before games, too, will consider 2 GB of allocateable RAM to be too small.
Every good solution is obvious once you've found it.
Re:allocated space
that's for the virtual mem. but what about the physical one ?
i won't start with paging and swapping, i will be using pure segmentation so i need to know the how much mem. i need for the kernel code, data, stack .
i know it depends on the kernel but i mean in general (the average).
i won't start with paging and swapping, i will be using pure segmentation so i need to know the how much mem. i need for the kernel code, data, stack .
i know it depends on the kernel but i mean in general (the average).
Re:allocated space
No idea. Depends on your kernel architecture (monolithic or microkernel?), scope of your OS (generic desktop, server, game engine, embedded, ...), and many other factors that are also bound to change over time.
As for "pure segmentation"... what's your compiler of choice? I'm asking because GCC does not support segmentation, but assumes a flat memory model...
Edit: I was a bit at a loss for words, but now I found the metaphor: Your question is like asking us, "how much money should I take with me for my holiday?", but not telling us where you're going, how long you stay, and what your acount balance is. And even then we couldn't really give good advice...
As for "pure segmentation"... what's your compiler of choice? I'm asking because GCC does not support segmentation, but assumes a flat memory model...
Edit: I was a bit at a loss for words, but now I found the metaphor: Your question is like asking us, "how much money should I take with me for my holiday?", but not telling us where you're going, how long you stay, and what your acount balance is. And even then we couldn't really give good advice...
Every good solution is obvious once you've found it.
Re:allocated space
;D i'm going to hawaiihow much money should I take with me for my holiday?
here is the problem, i will use grub to load the kernel at 100000h, then i will create gdt with Code segment, Data segment with base 0 and limit 4 GB to access the whole ram and Code,Data,Stack for the kernel which i don't know how to set their base or limit that's all.
all i know that the kernel is loaded at 100000h which means that the base of kernel code should be 100000h but what about the limit ?
and what about data where it starts and where it ends?
the stack can be any where but what about its size ?