OSDev.org
https://forum.osdev.org/

allocated space
https://forum.osdev.org/viewtopic.php?f=1&t=10816
Page 1 of 1

Author:  HardEnough [ Fri Aug 19, 2005 3:55 am ]
Post subject:  allocated space

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) ?

Author:  Candy [ Fri Aug 19, 2005 4:18 am ]
Post subject:  Re:allocated space

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) ?


kernel data/code/stack: what it needs (depending on its size). In address space, say, half?

User process: look at the file and make space for it.

Author:  AR [ Fri Aug 19, 2005 4:32 am ]
Post subject:  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)

Author:  Solar [ Fri Aug 19, 2005 5:15 am ]
Post subject:  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.

Author:  HardEnough [ Fri Aug 19, 2005 6:29 am ]
Post subject:  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).

Author:  Solar [ Fri Aug 19, 2005 6:33 am ]
Post subject:  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... ;)

Author:  HardEnough [ Fri Aug 19, 2005 12:48 pm ]
Post subject:  Re:allocated space

Quote:
how much money should I take with me for my holiday?
;D i'm going to hawaii
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 ?

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/